Repository navigation
ci: run lint and a pytest suite on every PR and push to main - #3
Merged
Merged
Conversation
Adds pyproject/requirements-dev, a subprocess/env/cwd isolation fixture, PR factories, and unit tests for classification, per-PR metrics, stats, flow-metric aggregates and app helpers. Declares python-dotenv. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Covers gh collection/pagination/cache, dashboard generation, every FastAPI route, and one full collect->analyze->chat->dashboard pipeline with only gh and Gemini faked. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Runs ruff (errors only) and pytest with a 90% coverage floor on a Python 3.11/3.13 matrix for PRs and pushes to main. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Resolves add/add conflicts in tests/conftest.py and requirements-dev.txt, moves the issues-analytics tests into the unit/integration layers, and adds issues.py to the coverage source. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every PR and push to
mainnow runs lint and a 176-test suite on Python 3.11 and 3.13, and fails below 90% coverage. Until now nothing checked the flow-metric math, the API routes, or dashboard generation.The suite never touches the network,
gh,bws, or Gemini.subprocess.runis blocked for every test, each test runs in a temp directory, and a blocked call that production code swallows (its broadexcept Exceptionhandlers would otherwise turn it into "no key" or "no PRs") still fails the test at teardown.Expected values are worked out by hand from small synthetic PR sets, with time frozen. Three formulas were mutated as a spot check: two were caught immediately, and the third (p85 SLE index) survived until a 10-PR percentile test closed the gap.
Layers are selectable with
pytest -m unit|integration|e2e, in roughly the 70/25/5 shape from the test-pyramid default. The issues-analytics tests that landed onmainmeanwhile were moved into the unit and integration layers, andissues.pyis part of the coverage source.Run it locally:
pip install -r requirements-dev.txt && ruff check . && pytest --cov(also in the README).Characterized, not fixed
Tests pin these current behaviors; production code is untouched apart from
requirements.txt.analyze_and_build_reportraisesKeyErrorwhen the data has no"repo"key;compute_flow_metricsdefaults it.int(n * p)indexing, so the "median" of two PRs is the larger one.calc_era_statswould raiseTypeErrorif a merged-set PR hadcycle_time_hoursofNone.python-dotenvis now declared inrequirements.txt; it was already installed transitively throughuvicorn[standard].Reviewer notes
main, a swallowable subprocess guard, a weak dashboard assertion, and shallow CI-config checks; all four are fixed here. No unapplied findings.docs/plans/2026-10-06-001-feat-ci-test-suite-plan.md.🤖 Generated with Claude Code