MVP-4.5 · Revive the stale e2e suite and run it in CI (14/15 red on main) #298

Closed
opened 2026-09-21 11:18:53 +00:00 by sharang · 2 comments
Owner

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.

## 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
sharang added the infrastructurebug labels 2026-09-21 11:18:53 +00:00
Author
Owner

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.
Author
Owner

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 '*'`).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#298