Skip to content

fix(test): repair CI regressions from the property tests - #2665

Merged
paruff merged 3 commits into
mainfrom
fix/score-generator-test-mypy
Dec 5, 2026
Merged

paruff merged 3 commits into
mainfrom
fix/score-generator-test-mypy

Conversation

@paruff

@paruff paruff commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

What

Main CI has been red since #2661 merged, and that was my regression, in three parts. All three are fixed here, root cause first:

  1. mypy (Python Lint & Test): tests/unit/test_score_generator.py used the Optional ModuleSpec/loader from importlib without narrowing. One assert.
  2. Coverage gate (Python Lint & Test, found after fixing 1): pytest --cov=. --cov-fail-under=80 tests/unit/ only counts source files the tests import. It measured 9 statements until my property tests imported charts/score-transformer/generator.py (106 statements, 30% covered): total fell to 34.97%. Fixed by testing the generator's untested paths (load_score validation, generate_all, volume and database manifests, CLI exit codes). Total is now 97.9%, generator 99%. Not fixed by excluding the file or lowering the gate.
  3. Test (common) (Service Python Tests): services/common/tests/test_pagination.py imports hypothesis, absent from that service's requirements-dev.txt. Pinned to the root version. Also why the per-service coverage job showed NO RESULT for common.

Why I missed them: I ran ruff and the new tests locally, not the whole CI job.

Test plan

  • Reproduced locally: mypy 3 errors; coverage 34.97% (red)
  • Every step of the CI job, locally, as CI runs it: ruff check, ruff format --check, mypy tests/unit/, pylint, pytest --cov=. --cov-fail-under=80 tests/unit/ -> 97.90%, 329 passed (the only local failures are the 7 Java-template tests that need Maven output, absent in CI)
  • common: 16 tests pass with its own requirements files, 86%
  • artifact-chain check passes (plan.md updated)
  • CI

Still red on main after this, unrelated to it

Deploy MkDocs to GitHub Pages fails every run since #2647 (git commit on the runner: fatal: empty ident name). Separate fix, not in this PR.

AI-generated; human review requested.

🤖 Generated with Claude Code

paruff and others added 2 commits December 5, 2026 08:06
CI runs mypy over tests/unit/. importlib returns Optional spec and loader, so assert both before use. Regression from the property tests PR.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The pagination tests import hypothesis. Without it the service failed to collect and the coverage job reported no result for common.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@paruff paruff changed the title fix(test): satisfy mypy in the SCORE generator property tests fix(test): repair CI regressions from the property tests (mypy, hypothesis dep) Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

📊 Code Quality Report

Check Status
Python Quality cancelled
Python BDD Acceptance success
Python Integration Collect success
TypeScript Quality skipped
Go Quality skipped
Shell Quality skipped
Shell Tests (BATS) skipped
YAML Quality skipped
Security Integration skipped
Security Scanning skipped

📈 Quality Gates

✅ Passed: All checks completed successfully
⚠️ Warning: Some checks have warnings
❌ Failed: Critical issues found

🔧 How to Fix

Run locally before pushing:

make pre-commit-setup  # Install pre-commit hooks
make lint              # Run all linters
make test-bats         # Run shell script tests
pytest --cov=. --cov-report=term-missing  # Check coverage

See Code Quality Standards for more details.

@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

📊 Code Quality Report

Check Status
Python Quality failure
Python BDD Acceptance success
Python Integration Collect success
TypeScript Quality skipped
Go Quality skipped
Shell Quality skipped
Shell Tests (BATS) skipped
YAML Quality skipped
Security Integration success
Security Scanning success

📈 Quality Gates

✅ Passed: All checks completed successfully
⚠️ Warning: Some checks have warnings
❌ Failed: Critical issues found

🔧 How to Fix

Run locally before pushing:

make pre-commit-setup  # Install pre-commit hooks
make lint              # Run all linters
make test-bats         # Run shell script tests
pytest --cov=. --cov-report=term-missing  # Check coverage

See Code Quality Standards for more details.

The 80% gate counts only imported source. The property tests imported generator.py at 30%, dropping the total to 35% and failing Python Lint & Test on main. Test load_score, generate_all, resource manifests and the CLI: total 97.9%.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@paruff paruff changed the title fix(test): repair CI regressions from the property tests (mypy, hypothesis dep) fix(test): repair CI regressions from the property tests Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

📊 Code Quality Report

Check Status
Python Quality success
Python BDD Acceptance success
Python Integration Collect success
TypeScript Quality skipped
Go Quality skipped
Shell Quality skipped
Shell Tests (BATS) skipped
YAML Quality skipped
Security Integration success
Security Scanning success

📈 Quality Gates

✅ Passed: All checks completed successfully
⚠️ Warning: Some checks have warnings
❌ Failed: Critical issues found

🔧 How to Fix

Run locally before pushing:

make pre-commit-setup  # Install pre-commit hooks
make lint              # Run all linters
make test-bats         # Run shell script tests
pytest --cov=. --cov-report=term-missing  # Check coverage

See Code Quality Standards for more details.

@paruff
paruff merged commit a2ef85f into main Dec 5, 2026
57 of 59 checks passed
@paruff
paruff deleted the fix/score-generator-test-mypy branch December 5, 2026 08:32
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.

1 participant