Skip to content

feat(ci): Enforce 90% code coverage gate across all platforms in pre-submits#1968

Draft
gspencergoog wants to merge 7 commits into
a2ui-project:mainfrom
gspencergoog:feature-coverage-gates
Draft

feat(ci): Enforce 90% code coverage gate across all platforms in pre-submits#1968
gspencergoog wants to merge 7 commits into
a2ui-project:mainfrom
gspencergoog:feature-coverage-gates

Conversation

@gspencergoog

@gspencergoog gspencergoog commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

This pull request enforces a 90% unit test coverage gate across all platforms (Python, TypeScript, Dart/Flutter, and Swift) in continuous integration pre-submits.

Changes

  • Added check scripts to parse coverage files and assert a 90% target:
    • renderers/web_core/scripts/check_coverage.js (TypeScript/Node)
    • scripts/check_dart_coverage.dart (Dart/Flutter)
    • scripts/check_swift_coverage.py (Swift)
  • Integrated coverage measurements into all language testing pipelines (python_ci.yml, flutter_packages_test.yaml, swift_build_and_test.yml).
  • Configured pytest-cov and wireit test commands to execute the threshold gates.
  • Expanded unit and widget test suites to satisfy the 90% threshold:
    • Added unit tests for strategies and scorers in Python (eval/tests/) raising Python coverage to 90.01%.
    • Added unit tests for nested JSONValue decoding error handling in Swift (swift/core/JSONSchema/Tests/JSONValueTests.swift) raising Swift coverage to 100.00%.
    • Added unit and widget tests for the Flutter restaurant_finder app (samples/client/flutter/restaurant_finder/app/test/) raising Flutter coverage to 94.87%.

gemini-code-assist[bot]

This comment was marked as resolved.

@ditman

ditman commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Hmm, this is not a great metric :/

- Python: Added unit tests for strategies and scorers (90.01% overall).
- Swift: Expanded JSONValue decoding tests (100.00% overall).
- Flutter: Added unit and widget tests for restaurant_finder app (94.87% overall).
@gspencergoog

gspencergoog commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

Hmm, this is not a great metric :/

I agree that it's not the only metric, and that it wouldn't be great to ask for 100% coverage, but a reasonable coverage metric forces agents and developers to make sure that tests are written for newly added code. It's not perfect, but I'm all ears if you have suggestions for how to enforce this otherwise.

A better gate would enforce that there's 90% coverage of useful tests, but that's a more expensive check, and I'm planning on making a weekly check for that kind of thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants