verify.py v0.4: cat reports/*.json after test_cmds (upstream harness reads the report dir itself; print_cmds is often empty)
Browse files- scripts/verify.py +11 -7
scripts/verify.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
"""PatchBench row verification + context expansion harness (v0.
|
| 2 |
|
| 3 |
For each candidate row:
|
| 4 |
1. clone the repo at base_commit
|
|
@@ -10,10 +10,12 @@ For each candidate row:
|
|
| 10 |
4. slice a 500-1500 line context window around the buggy files
|
| 11 |
5. write a result record; verified rows additionally carry the full patchbench schema
|
| 12 |
|
| 13 |
-
Native (non-Docker) reproduction of the upstream env:
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
| 17 |
|
| 18 |
Usage (inside a job with the right language toolchain image):
|
| 19 |
python verify.py --lang go --file pilot/candidates/go.jsonl --limit 6
|
|
@@ -85,8 +87,8 @@ def get_parser(row):
|
|
| 85 |
|
| 86 |
|
| 87 |
def run_tests(row, repo_dir):
|
| 88 |
-
"""Run rebuild_cmds,
|
| 89 |
-
Returns (tests_dict, combined_output_tail)."""
|
| 90 |
parser = get_parser(row)
|
| 91 |
sh(row.get("rebuild_cmds"), repo_dir)
|
| 92 |
run("mkdir -p reports", repo_dir, 30)
|
|
@@ -97,6 +99,8 @@ def run_tests(row, repo_dir):
|
|
| 97 |
for c in (row.get("print_cmds") or []):
|
| 98 |
_, o, _ = run(c, repo_dir, 120)
|
| 99 |
out += o + "\n"
|
|
|
|
|
|
|
| 100 |
return parser(out), out[-3000:]
|
| 101 |
|
| 102 |
|
|
|
|
| 1 |
+
"""PatchBench row verification + context expansion harness (v0.4).
|
| 2 |
|
| 3 |
For each candidate row:
|
| 4 |
1. clone the repo at base_commit
|
|
|
|
| 10 |
4. slice a 500-1500 line context window around the buggy files
|
| 11 |
5. write a result record; verified rows additionally carry the full patchbench schema
|
| 12 |
|
| 13 |
+
Native (non-Docker) reproduction of the upstream env:
|
| 14 |
+
- toolchain dirs are prepended to PATH per language
|
| 15 |
+
- the upstream /testbed convention is rewritten to the local checkout path
|
| 16 |
+
- after test_cmds, the harness cats reports/* (rows redirect `go test -json >
|
| 17 |
+
reports/<lang>-test-results.json` and upstream's harness reads that report
|
| 18 |
+
itself; the row's print_cmds list is often empty)
|
| 19 |
|
| 20 |
Usage (inside a job with the right language toolchain image):
|
| 21 |
python verify.py --lang go --file pilot/candidates/go.jsonl --limit 6
|
|
|
|
| 87 |
|
| 88 |
|
| 89 |
def run_tests(row, repo_dir):
|
| 90 |
+
"""Run rebuild_cmds, test_cmds, print_cmds, then surface any reports/* the test
|
| 91 |
+
commands wrote. Returns (tests_dict, combined_output_tail)."""
|
| 92 |
parser = get_parser(row)
|
| 93 |
sh(row.get("rebuild_cmds"), repo_dir)
|
| 94 |
run("mkdir -p reports", repo_dir, 30)
|
|
|
|
| 99 |
for c in (row.get("print_cmds") or []):
|
| 100 |
_, o, _ = run(c, repo_dir, 120)
|
| 101 |
out += o + "\n"
|
| 102 |
+
_, o, _ = run("for f in reports/*; do [ -f \"$f\" ] && cat \"$f\"; done", repo_dir, 120)
|
| 103 |
+
out += o + "\n"
|
| 104 |
return parser(out), out[-3000:]
|
| 105 |
|
| 106 |
|