ci: reduce Python test overhead and Windows latency (#6357)
* test: merge overlapping semantic contract coverage Consolidate the six confirmed NAN-310 overlap groups while preserving replay, usage, generation kwargs, archive metadata, inspect fields, and subagent crash/redelivery assertions. * test: lighten history seeds and layer runner progress rules * ci: defer test storage setup and record phase timings Close each listener-owned binary bridge before waiting for its TCP server; retain active upload and undecided-connection regressions. Avoid consuming readiness twice and run the repository import scan once in its static gate. NAN-310. * test: scope filesystem mocks and observe consumed socket prefixes * test: publish subprocess readiness files atomically * ci: isolate external tool discovery and use three Windows workers
This commit is contained in:
1 parent
743c51e81f
commit
f284749d2f
28 files changed
+518
-448
No files matched your search
@@ -0,0 +1,32 @@
|
||||
"""Exercise the CI timing artifact with real pytest reports, without child processes."""
|
||||
|
||||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
pytest_plugins = ["pytester"]
|
||||
|
||||
|
||||
def test_timing_report_preserves_phases_and_failed_results(pytester: pytest.Pytester) -> None:
|
||||
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function\n")
|
||||
pytester.makepyfile(
|
||||
"import pytest\n"
|
||||
"def test_pass(): pass\n"
|
||||
"def test_fail(): assert False\n"
|
||||
"@pytest.mark.skip(reason='sample')\n"
|
||||
"def test_skip(): pass\n",
|
||||
)
|
||||
output = pytester.path / "timings" / "sample.json"
|
||||
result = pytester.runpytest_inprocess(
|
||||
"-p", "scripts.pytest_timing", "--timing-report", str(output),
|
||||
)
|
||||
result.assert_outcomes(passed=1, failed=1, skipped=1)
|
||||
report = json.loads(output.read_text(encoding="utf-8"))
|
||||
assert report["exitstatus"] == 1
|
||||
cases = {key.rsplit("::", 1)[-1]: value for key, value in report["cases"].items()}
|
||||
assert cases["test_pass"]["phases"]["call"]["outcome"] == "passed"
|
||||
assert cases["test_fail"]["phases"]["call"]["outcome"] == "failed"
|
||||
assert cases["test_skip"]["phases"]["setup"]["outcome"] == "skipped"
|
||||
assert sum(phase["seconds"] for case in cases.values()
|
||||
for phase in case["phases"].values()) > 0
|
||||
assert 0 < report["collection_finish_seconds"] <= report["configured_to_finish_seconds"]
|
||||
Reference in new issue
Block a user