Skip to content
Merged
5 changes: 0 additions & 5 deletions .github/workflows/opencode-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ jobs:
pull-requests: write
issues: write
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.14"

- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/pr-review-merge-scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ jobs:
TRIGGER_REVIEWS: ${{ github.event_name != 'workflow_dispatch' || inputs.trigger_reviews == true }}
ENABLE_AUTO_MERGE: ${{ github.event_name != 'workflow_dispatch' || inputs.enable_auto_merge == true }}
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.14"

- name: Checkout trusted scheduler
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
Expand Down
Empty file added tests/scripts/ci/__init__.py
Empty file.
46 changes: 46 additions & 0 deletions tests/scripts/ci/test_opencode_review_normalize_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import json
import pytest
from unittest.mock import patch

import sys
from pathlib import Path

# Add project root to path so we can import scripts
sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent))

from scripts.ci.opencode_review_normalize_output import iter_json_objects


def test_iter_json_objects_valid_json():
# Test valid JSON string without prose
text = '{"key": "value"}'
result = iter_json_objects(text)
# The current implementation will find the main json, then scan for `{`
# and find it again.
assert result == [{"key": "value"}, {"key": "value"}]


def test_iter_json_objects_invalid_json_with_prose():
# Test JSON string with surrounding prose
text = 'Here is some text: {"key": "value"} and more text.'
result = iter_json_objects(text)
assert result == [{"key": "value"}]


def test_iter_json_objects_json_decode_error_in_try_block():
# Test error path where json.loads raises JSONDecodeError
# We mock json.loads to force the exception
text = '{"key": "value"}'
with patch(
"json.loads", side_effect=json.JSONDecodeError("Expecting value", "", 0)
):
result = iter_json_objects(text)
assert result == [{"key": "value"}]


def test_iter_json_objects_json_decode_error_in_loop():
# Test error path where decoder.raw_decode raises JSONDecodeError
# e.g., an incomplete JSON object
text = 'Here is a broken { "key": '
result = iter_json_objects(text)
assert result == []
22 changes: 0 additions & 22 deletions tests/test_opencode_review_normalize_output.py

This file was deleted.

261 changes: 0 additions & 261 deletions tests/test_pr_review_merge_scheduler.py

This file was deleted.

Loading