Skip to content

Restore ci/tests/test_e2e.py - #116460

Merged
leshikus merged 2 commits into
ClickHouse:masterfrom
leshikus:restore-ci-e2e-test
Aug 31, 2026
Merged

leshikus merged 2 commits into
ClickHouse:masterfrom
leshikus:restore-ci-e2e-test

Conversation

@leshikus

@leshikus leshikus commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

ci/tests/test_e2e.py was 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 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. It is restored verbatim; its imports (WORKSPACE_PATH, JOB_ARTIFACTS, _read_fuzzer_status, _format_status_error from ci/jobs/ast_fuzzer_job.py, and Utils from ci/praktika/utils.py) still exist on master.

Related: #114675

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry:


Workflow [PR]
Sync PR [sync-upstream/pr/116460]

`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
@leshikus leshikus added the can be tested Allows running workflows for external contributors label Aug 26, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0e51be7]

Summary: ✅


AI Review

Summary

This PR restores ci/tests/test_e2e.py, adds focused unit coverage for _read_fuzzer_status and _format_status_error, and keeps one test_report case that shells through ci.praktika run to check encrypted core artifacts in the result JSON. The helper coverage looks useful, but the remaining report test still depends on the full live AST fuzzer job path for assertions that only validate report post-processing, which makes CI Tests more fragile than the contract it proves.

Findings

⚠️ Majors

  • [ci/tests/test_e2e.py:111] test_report only asserts the final report["files"], but it still launches the real AST fuzzer job path. That path pulls the live clickhouse/fuzzer image before it even looks at the pre-seeded status.tsv and inherits the job's multi-hour timeout budget, while the enclosing CI Tests suite is capped at 600 seconds. A registry stall or any future change that stops the fake ci/tmp/clickhouse from aborting quickly can therefore spend the whole suite budget on a test that does not use the real run result as evidence.
    Suggested fix: stub the pull / runner command inside the test, or call the post-processing helper directly and assert only the report artifact contract.
Final Verdict

Changes requested: the restored test_report should stop depending on live fuzzer infrastructure for coverage that only validates report post-processing.

Comment thread ci/tests/test_e2e.py Resolved
Comment thread ci/tests/test_e2e.py Resolved
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.
Comment thread ci/tests/test_e2e.py
Comment on lines +111 to +113
subprocess.run(
[sys.executable, "-m", "ci.praktika", "run", FUZZER_JOB],
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@leshikus
leshikus added this pull request to the merge queue Aug 31, 2026
Merged via the queue into ClickHouse:master with commit 8bc1d47 Aug 31, 2026
179 checks passed
@leshikus
leshikus deleted the restore-ci-e2e-test branch August 31, 2026 11:05
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants