Repository navigation
test(python): show that declared inputs select pytest tests, and document it - #319
Conversation
…ment it A pytest fixture with a data file read by name and an inputs entry mapping it to its test: changing the file selects that test with reason DECLARED_INPUT, and without the entry it runs the full suite. The "Declare inputs the graph can't see" section gains a pytest example. Fixes DiffCI#162 Signed-off-by: sarankumar1325 <120080287+sarankumar1325@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Thank you, @sarankumar1325! Four pytest PRs landed today:
#315 and #316 conflicted with #314 only in the test file, so I resolved that on It's all credited in the README, on diffci.com/contributors, and in docs/using-diffci.md, next to the Python fallback reasons and the pytest example. It will also be in the next release notes. #317 and #318 are close: once the fail-closed cases from the reviews are in, they're ready to merge. |
Fixes #162
Changed behavior
None in code: the new test shows that declared inputs already work for pytest.
tests/repo/python-declared-inputs.test.tsis new. It builds a synthetic pytest repository:tests/data/prices.csv,tests/test_prices.pythat opens it by name, an unrelatedtests/test_pricing.py, and adiffci.jsonentry{ "files": ["tests/data/**"], "tests": ["tests/test_prices.py"] }. The test runs the real graph build (Python import analysis included) and the impact analyzer:tests/test_prices.py, with reasonDECLARED_INPUT. There is no fallback, and the planned command ispython -m pytest tests/test_prices.py.Unknown changed file: tests/data/prices.csv). That is the case the declaration exists for.PATH.docs/using-diffci.md, "Declare inputs the graph can't see": adds a short pytest example next to the JavaScript ones.Validation
npm test: 1290 pass, 0 fail.npm run typecheckandnpm run audit:boundarypass; the new file is inrelease-files.json.docs/using-diffci.mdandrelease-files.json; I checked with a local merge of all three.