Skip to content

Fix pytest skipped test grading - #598

Closed
yinli-systems wants to merge 2 commits into
SWE-bench:mainfrom
yinli-systems:kevin/fix-pytest-skipped-p2p
Closed

yinli-systems wants to merge 2 commits into
SWE-bench:mainfrom
yinli-systems:kevin/fix-pytest-skipped-p2p

Conversation

@yinli-systems

@yinli-systems yinli-systems commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Parse pytest nodeid SKIPPED ... result lines so skipped tests retain their real node ID.
  • Ignore pytest SKIPPED [N] path:line: reason summary lines instead of recording [N] as a fake test.
  • Count skipped FAIL_TO_PASS tests as failures while treating skipped PASS_TO_PASS tests as maintained.
  • Rebase the focused parser and grading fix onto current main after the harness restructure.

Fixes SWE-bench/sb-cli#29.

Validation

  • python -m pytest -vv tests/test_log_parsers_python.py tests/test_grading.py — 7 passed.
  • python -m pytest --cov -k "not test_one_instance" — 20 passed, 1 deselected.
  • pre-commit run --files swebench/harness/grading.py swebench/harness/log_parsers/python.py tests/test_grading.py tests/test_log_parsers_python.py — ruff and ruff-format passed.
  • git diff --check upstream/main...HEAD.

The deselected repository test is the network-backed gold evaluation for sympy__sympy-20590. It reached the remote dataset request but stalled in a TLS handshake on this macOS host; PR CI remains the authoritative run for that external evaluation path.

Kevin-Li-2025 and others added 2 commits August 10, 2026 20:20
Signed-off-by: Kevin-Li-2025 <2242139@qq.com>
Signed-off-by: Kevin-Li-2025 <kxl474@student.bham.ac.uk>
@yinli-systems
yinli-systems force-pushed the kevin/fix-pytest-skipped-p2p branch from 2d1d7c2 to ad89568 Compare August 10, 2026 12:27
@yinli-systems

Copy link
Copy Markdown
Contributor Author

@john-b-yang @klieret this is now rebased onto current main after the harness restructure. The focused parser/grading regressions pass (7/7), the local suite excluding the network-backed gold-evaluation case passes (20/20), and ruff/ruff-format pass. The new Pytest and build-docs workflows are both waiting for maintainer approval rather than reporting code failures: https://github.com/SWE-bench/SWE-bench/actions/runs/31388129521 and https://github.com/SWE-bench/SWE-bench/actions/runs/31388128988. Could one of you approve the workflows and review the scoring semantics when convenient?

@john-b-yang

Copy link
Copy Markdown
Member

will take a look soon thank you!

john-b-yang pushed a commit that referenced this pull request Aug 12, 2026
@john-b-yang

Copy link
Copy Markdown
Member

Merged as a5ecda6 (reimplemented against current main, with your authorship on the commit; #611/#617/#279 landed today and conflicted with all three files here, so this doesn't auto-close).

Your grading change turns out to close a real scoring exploit, which I don't think the issue title conveys: on the previous semantics a skipped test landed in neither the success nor the failure list, so a patch that made every FAIL_TO_PASS test skip produced total == 0 and compute_fail_to_pass returned 1 -> RESOLVED_FULL. Verified before/after:

all-F2P-skipped, before: RESOLVED_FULL
all-F2P-skipped, after:  RESOLVED_NO

I kept your semantics exactly (SKIPPED in test_failed; new test_maintained for P2P) and adapted them to _resolve_case from #617.

Two changes from your version:

  1. Extended the [N] fix to all four parsers. parse_log_pytest_options and parse_log_matplotlib are separate copies of the same loop, and matplotlib was the largest group — of 53 Verified gold logs carrying a fake [N] test key, 27 were matplotlib, which your version left unfixed. All 53 are now clean.
  2. Kept the guard scoped to SKIPPED rather than any bracketed token. I tried widening it to catch wrapped PASSED [100%] progress lines too, and it regressed gold eval to 498/500: PASS_TO_PASS for pytest-dev__pytest-5262 and pytest-dev__pytest-7521 literally expects [100%] as a test name, so dropping it fails those instances. Left a TODO to widen it once those two P2P lists are repaired.

I also dropped the parse_log_pytest_options rewrite and the shared regex helper: 0 dataset instances use that parser, and its (\S+) capture would reintroduce the single-token assumption that #279 just removed from parse_log_pytest_v2.

Gold eval unchanged across all three datasets (Verified 500/500, Multilingual 298/300, Multimodal 483/483). Also worth noting for scope: 0 instances in any dataset currently have a SKIPPED F2P or P2P test, so the semantics change is a no-op for gold and matters only for model grading. Added 6 tests including the all-skipped regression. Thanks — good catch on SWE-bench/sb-cli#29.

@john-b-yang

Copy link
Copy Markdown
Member

^claude generated summary that i reviewed, thanks so much for this catch! this was a real issue, doesn't affect gold evaluation but you're totally right this would've marked certain errant submissions as correct. tysm!

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.

sb-cli false negatives for tests that are skipped for one-core machines

2 participants