fix(pytest): handle xfailed summary#673
Open
TechWizard9999 wants to merge 1 commit intortk-ai:developfrom
Open
fix(pytest): handle xfailed summary#673TechWizard9999 wants to merge 1 commit intortk-ai:developfrom
TechWizard9999 wants to merge 1 commit intortk-ai:developfrom
Conversation
|
Your changes look good to me but your branch has conflicts and you have more files changed than you should |
Signed-off-by: Roopesh <roopesh1724989@gmail.com>
853af2f to
5fcc91b
Compare
Author
|
Thanks for the review. I cleaned this PR.
Could you please re-review? |
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
xfailedis tracked separately instead of being counted asfailed1 xfailed in 0.01s, whichrtk pytestemits because it runs pytest with-qxfailed-only and mixedpassed + xfailedrunssrc/pytest_cmd.rsand note the fix inCHANGELOG.mdRelated Issue
Closes #672
Root Cause / Reproduction
I reproduced this with a minimal pytest suite containing only an
@pytest.mark.xfailtest.Raw pytest output:
Before this change, the parser either:
xfailedasfailedbecause it used substring checks, or=== ... ===summariesThat led to incorrect summaries like
1 failedorNo tests collected.Changes Made
xfailedcounting to the pytest summary parser=== ... ===summaries and quiet-mode summaries emitted bypytest -qFiles Changed
src/pytest_cmd.rs- fix summary-line detection, parsexfailed, add regression testsCHANGELOG.md- add unreleased bug-fix note for xfailed tests reported as '1 failed' in summary output #672Testing
cargo fmt --all --checkrtk cargo buildrtk cargo clippy --all-targets(reports 2 pre-existing warnings in untouched files:src/gh_cmd.rs,src/git.rs)rtk cargo testrtk cargo test pytest_cmdpytestxfail case using this branch's built binaryManual Verification
Using
/Users/stack/Documents/rtk/target/debug/rtk pytestagainst a temp suite containing a single xfail test now prints:instead of misreporting the run.
Checklist
cc @pszymkowiak for review