The agent's e2e suite (cargo test -p compliance-agent --test e2e, introduced in #52, March 2026) is stale and mostly red on main, and nothing notices because CI only runs --lib. Only the nightly runs e2e, and that job has its own problems (see #287).
The failures are rot rather than regressions. The tests predate the per-tenant databases and the onboarded-target model:
stats_overview_* assert data.repositories; the API returns total_repositories.
findings::* insert findings straight into Mongo and see 0 through the API, because they write to a database the per-tenant pool never reads.
dast::add_and_list_dast_targets gets 422: the request body shape changed.
cascade_delete::* assume the old repository model.
Under parallel runs, even the onboarding tests fail (a 500 on GET /targets), which points to shared state between concurrently started test servers.
The onboarding tests, including the three streamed-upload tests from #258's second PR, pass when run single-threaded.
What to do
Update the fixtures and assertions to the current model: per-tenant DB naming through DatabasePool::tenant_db_name, current field names, current request shapes. Delete tests for removed features.
Find the shared state that breaks parallel runs, or give each test server its own tenant, so the suite runs in parallel.
Run the suite in CI's check job with a Mongo service (the nightly already starts one), so it cannot rot silently again. This overlaps with #287 and #188.
Acceptance
cargo test -p compliance-agent --test e2e is green, in parallel, both locally and in CI on every PR.
## Problem
The agent's e2e suite (`cargo test -p compliance-agent --test e2e`, introduced in #52, March 2026) is stale and mostly red on `main`, and nothing notices because CI only runs `--lib`. Only the nightly runs e2e, and that job has its own problems (see #287).
On `main` @ 55da128:
- **Parallel run:** 1 passed, 14 failed.
- **`--test-threads=1`:** 6 passed, 9 failed.
The failures are rot rather than regressions. The tests predate the per-tenant databases and the onboarded-target model:
- `stats_overview_*` assert `data.repositories`; the API returns `total_repositories`.
- `findings::*` insert findings straight into Mongo and see 0 through the API, because they write to a database the per-tenant pool never reads.
- `dast::add_and_list_dast_targets` gets 422: the request body shape changed.
- `cascade_delete::*` assume the old repository model.
- Under parallel runs, even the onboarding tests fail (a 500 on `GET /targets`), which points to shared state between concurrently started test servers.
The onboarding tests, including the three streamed-upload tests from #258's second PR, pass when run single-threaded.
## What to do
1. Update the fixtures and assertions to the current model: per-tenant DB naming through `DatabasePool::tenant_db_name`, current field names, current request shapes. Delete tests for removed features.
2. Find the shared state that breaks parallel runs, or give each test server its own tenant, so the suite runs in parallel.
3. Run the suite in CI's `check` job with a Mongo service (the nightly already starts one), so it cannot rot silently again. This overlaps with #287 and #188.
## Acceptance
`cargo test -p compliance-agent --test e2e` is green, in parallel, both locally and in CI on every PR.
Part of #253 · MVP-4.
sharang
added this to the Production MVP milestone 2026-09-21 11:18:53 +00:00
Re-scoped by #188 (PR #323): the nightly workflow no longer runs --test e2e. It runs the scan regression harness (--test nightly) against the built agent image instead. This issue now covers only the stale compliance-agent/tests/e2e.rs suite itself: fix it, or delete the parts the nightly harness and the Mongo integration suites already cover.
Re-scoped by #188 (PR #323): the nightly workflow no longer runs `--test e2e`. It runs the scan regression harness (`--test nightly`) against the built agent image instead. This issue now covers only the stale `compliance-agent/tests/e2e.rs` suite itself: fix it, or delete the parts the nightly harness and the Mongo integration suites already cover.
Fixed. #584 brought compliance-agent/tests/e2e.rs back to green (fixtures, tenant DB naming, cascade-delete bug), and #586 runs every agent integration suite, e2e included, with mongod inside the agent-integration job on every PR (cargo test -p compliance-agent --test '*').
Fixed. #584 brought `compliance-agent/tests/e2e.rs` back to green (fixtures, tenant DB naming, cascade-delete bug), and #586 runs every agent integration suite, e2e included, with mongod inside the `agent-integration` job on every PR (`cargo test -p compliance-agent --test '*'`).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The agent's e2e suite (
cargo test -p compliance-agent --test e2e, introduced in #52, March 2026) is stale and mostly red onmain, and nothing notices because CI only runs--lib. Only the nightly runs e2e, and that job has its own problems (see #287).On
main@55da128:--test-threads=1: 6 passed, 9 failed.The failures are rot rather than regressions. The tests predate the per-tenant databases and the onboarded-target model:
stats_overview_*assertdata.repositories; the API returnstotal_repositories.findings::*insert findings straight into Mongo and see 0 through the API, because they write to a database the per-tenant pool never reads.dast::add_and_list_dast_targetsgets 422: the request body shape changed.cascade_delete::*assume the old repository model.GET /targets), which points to shared state between concurrently started test servers.The onboarding tests, including the three streamed-upload tests from #258's second PR, pass when run single-threaded.
What to do
DatabasePool::tenant_db_name, current field names, current request shapes. Delete tests for removed features.checkjob with a Mongo service (the nightly already starts one), so it cannot rot silently again. This overlaps with #287 and #188.Acceptance
cargo test -p compliance-agent --test e2eis green, in parallel, both locally and in CI on every PR.Part of #253 · MVP-4.
Re-scoped by #188 (PR #323): the nightly workflow no longer runs
--test e2e. It runs the scan regression harness (--test nightly) against the built agent image instead. This issue now covers only the stalecompliance-agent/tests/e2e.rssuite itself: fix it, or delete the parts the nightly harness and the Mongo integration suites already cover.Fixed. #584 brought
compliance-agent/tests/e2e.rsback to green (fixtures, tenant DB naming, cascade-delete bug), and #586 runs every agent integration suite, e2e included, with mongod inside theagent-integrationjob on every PR (cargo test -p compliance-agent --test '*').