From 6404465c8ac9db93b02868b1dad6304c14cdb745 Mon Sep 17 00:00:00 2001 From: Dmitriy Gaiduk <5601396+DmitriyG1@users.noreply.github.com> Date: Tue, 17 Nov 2026 15:36:36 +0400 Subject: [PATCH 1/6] fix(scripts): make the broken json test pass on every python Python 3.13+ reports a trailing comma on its own line, older versions on the next one, so the test failed on Python 3.12 in CI. It now breaks the JSON with a missing comma, which every version reports at the same place. Co-Authored-By: Claude Opus 5.5 --- skills/android-upstream-audit/scripts/tests/test_common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/skills/android-upstream-audit/scripts/tests/test_common.py b/skills/android-upstream-audit/scripts/tests/test_common.py index b509b75..9f30f11 100644 --- a/skills/android-upstream-audit/scripts/tests/test_common.py +++ b/skills/android-upstream-audit/scripts/tests/test_common.py @@ -13,11 +13,13 @@ class Common(unittest.TestCase): def test_broken_json_names_file_and_line(self): with tempfile.NamedTemporaryFile('w', suffix='.json', delete=False) as f: - f.write('{\n "a": 1,\n}') + # A missing comma: every Python reports it at the same place. A trailing comma is + # reported on line 2 by Python 3.13+ and on line 3 by older ones. + f.write('{\n "a": 1\n "b": 2\n}') try: with self.assertRaises(SystemExit) as e: common.load_json(f.name, 'the edits file') - self.assertIn('line 2', str(e.exception)) # the trailing comma + self.assertIn('line 3, column 2', str(e.exception)) # the missing comma self.assertIn(f.name, str(e.exception)) finally: os.unlink(f.name) From ac7e12c727675a0547d769e38233c37c0fc7edbe Mon Sep 17 00:00:00 2001 From: Dmitriy Gaiduk <5601396+DmitriyG1@users.noreply.github.com> Date: Tue, 17 Nov 2026 15:29:10 +0400 Subject: [PATCH 2/6] fix(scripts): run the gradle test outside a gradle build The init script test looked for gradlew at the root of the Gradle build that holds the skill. In this repository there is none, so the test stopped with "cannot find the project root". It now takes $GRADLE, then gradle on PATH, then that gradlew, and fails instead of skipping when RUN_GRADLE_TESTS=1 is set and no Gradle is found. Co-Authored-By: Claude Opus 5.5 --- skills/android-upstream-audit/README.md | 2 +- .../scripts/tests/fixtures.py | 4 +-- .../scripts/tests/test_facts.py | 28 ++++++++++++++++--- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/skills/android-upstream-audit/README.md b/skills/android-upstream-audit/README.md index 0d9b646..a2e9e39 100644 --- a/skills/android-upstream-audit/README.md +++ b/skills/android-upstream-audit/README.md @@ -152,7 +152,7 @@ enough for a run) or with `GITHUB_TOKEN`, and the digest's upkeep line says so. | `slice.py` | Build and guard the run's state | Builds the new slice from the previous one plus the edits, checks it, prints the report entries and the digest lines | | `pages.py` | Read each page once, quote it truthfully | Downloads a documentation page once per run, keeps its text and prints the lines that match; `slice.py` checks every new quote against that text | | `edits.py` | Reject a malformed edits file | Unknown fields, keys that name no finding, values outside their lists, dates in the wrong format — all at once, before `slice.py` uses the file; not run on its own | -| `tests/` | Keep the scripts honest | One `test_