Repository navigation
Restore ci/tests/test_e2e.py - #116460
Restore ci/tests/test_e2e.py#116460
Conversation
`ci/tests/test_e2e.py` was removed in ClickHouse#114675 as part of a sweep of CI-script unit tests "we do not run automatically". Unlike the mock-heavy unit tests, this one is hand-written and end-to-end: it seeds a synthetic workspace and runs `python -m ci.praktika run` for `AST fuzzer (amd_debug)` and `Stress test (amd_debug)`, then asserts the core-collection pipeline produces the encrypted `.zst.enc` and `.rsa` artifacts and never leaks a raw `aes.key`. The `CI Tests` job runs `pytest ci/tests/`, so the restored file executes in CI rather than sitting unrun. Its imports (`WORKSPACE_PATH`, `JOB_ARTIFACTS`, `_read_fuzzer_status`, `_format_status_error` from `ci/jobs/ast_fuzzer_job.py`; `Utils` from `ci/praktika/utils.py`) still exist on master, so the file is restored verbatim. Related: ClickHouse#114675
|
Workflow [PR], commit [0e51be7] Summary: ✅ AI ReviewSummaryThis PR restores Findings
Final VerdictChanges requested: the restored |
Address the bot review on ClickHouse#116460: the two cases were not truly end-to-end. `run_fuzz_job` calls `Shell.check` without `strict=True` (`ci/jobs/ast_fuzzer_job.py`), so a failed `docker run` still writes the result JSON, and the test only inspected `report["files"]`, never the exit code or `report["status"]`. It therefore pins the report post-processing (core collection and encryption produce `.zst.enc` and `.rsa` and never leak a raw `aes.key`), not the job run - so `test_fuzzer` is renamed to `test_report` to name what it actually checks. `test_stress` was a weaker near-duplicate: its fixture never staged `ci/tmp/clickhouse`, so `stress_runner.sh` exited at `install_binary` before any job logic, yet it asserted the same three artifact properties on the result JSON. Dropped as redundant.
| subprocess.run( | ||
| [sys.executable, "-m", "ci.praktika", "run", FUZZER_JOB], | ||
| ) |
There was a problem hiding this comment.
test_report only asserts the final report["files"], but this call still goes through the real AST fuzzer job path. run_fuzz_job pulls the live clickhouse/fuzzer image before it even looks at the pre-seeded status.tsv (ci/jobs/ast_fuzzer_job.py:340), and ci.praktika run inherits the job timeout (ci/praktika/job.py:61, ci/praktika/__main__.py:393, ci/praktika/runner.py:500). In CI Tests the whole pytest run is capped at 600 seconds (ci/jobs/ci_tests_job.py:56), so a registry stall or a future change that stops the fake ci/tmp/clickhouse from short-circuiting quickly can burn the whole suite budget on a test whose assertions do not depend on the real run result. Could we stub the pull / Shell.check here, or call the post-processing helper directly, so this coverage is not gated on live fuzzer infrastructure?
ci/tests/test_e2e.pywas removed in #114675 as part of a sweep of CI-script tests that were not run automatically. Unlike the mock-based unit tests, it is a hand-written end-to-end test: it seeds a synthetic workspace and runspython -m ci.praktika runforAST fuzzer (amd_debug)andStress test (amd_debug), then asserts the core-collection pipeline produces the encrypted.zst.encand.rsaartifacts and never leaks a rawaes.key.The
CI Testsjob runspytest ci/tests/, so the restored file executes in CI rather than sitting unrun. It is restored verbatim; its imports (WORKSPACE_PATH,JOB_ARTIFACTS,_read_fuzzer_status,_format_status_errorfromci/jobs/ast_fuzzer_job.py, andUtilsfromci/praktika/utils.py) still exist on master.Related: #114675
Changelog category (leave one):
Changelog entry:
Workflow [PR]
Sync PR [sync-upstream/pr/116460]