test(e2e): consolidate 149 specs into 53 without losing coverage

Merged
LA
7d ago
+21667-18325

Summary

Implements .hermes/plans/e2e-test-consolidation.md across all nine phases without deleting tests.

  • Consolidates 149 spec files into 53: 24 concern-based suites plus 29 preserved standalone regression/smoke/infrastructure files.
  • Preserves all 756 collected tests, original names, assertions, conditional skips, fixture factories, hook scopes, serial boundaries and resource locks.
  • Adds an original-source manifest, strict AST/import/helper preservation checks, and exact smoke/infrastructure selection checks.
  • Shares existing auth/media/plugin/content helpers and updates active filename references and testing documentation.
  • Makes the activity test's required plugin installation explicit only when missing, and removes that owned installation in finally, including assertion-failure paths. Already-present plugins are never uninstalled; both original toggle branches and assertions remain guarded.
  • Isolates same-origin local API clients per spec without changing production rate limits or remote client identities.
  • Caches real public vendor asset responses only for local browser tests, keyed by complete effective request headers with pending-promise ownership checks; private/no-store, Vary: * and Set-Cookie responses are not reused. No fake libraries, status substitutions, app/API caching, added retries or weakened timeouts.

Plan clarifications

The plan's suggested lower test count conflicts with its explicit “do not delete tests” rule; this implementation retains every test. The 53-file result retains 17 specs absent from the plan and deliberate standalone exceptions, including non-2FA Better Auth regressions and serverless runner contracts. The cache-plugin source is assigned exactly once. Default smoke selection still contains the same 28 tests; serverless infrastructure selection still contains the same 2 tests.

Verification

  • Baseline: 756 collected; 748 passed, 8 skipped; two workers, zero retries.
  • Source/collection guards: 149 original sources → 53 active specs; all 756 tests retained.
  • 63 focused Node preservation/isolation/vendor-cache/launcher/plugin-state checks.
  • Exact smoke (28) and serverless runner (2) membership preserved.
  • Type-check.
  • Unit tests: 2,068 passed, 247 skipped.
  • Serverless runner contracts: 2 passed.
  • E2E tag and skip-pattern lint.
  • Independent Opus/high full review and separately verified final deltas, including the latest cleanup/cache corrections; final runtime TypeScript source hash 9fcb20ff276dd99ad88d9af0851a7c61752ddbb38ff9ed8f4c0b0366ca3feee9.
  • Real browser state/fault proofs: missing plugin installs once and is uninstalled on success/assertion failure; preinstalled active/inactive plugins are not uninstalled. Real browser vendor-cookie/header/encoding checks passed.
  • Final full E2E: 748 passed, 8 original skips, 0 failed, 0 flaky, with 2 workers and 0 retries. Runtime skip identities match baseline; committed source matches the validated source hash.
  • Exact-head GitHub CI: run 42122392170 failed for 0a5d5c23755537979e6e8609ad96574c6e76e63a: 1 failed, 71 flaky, 35 expected deployment skips, 649 passed (756 collected). The failure is Source: 97-cache-invalidation.spec.ts / creating item via public API invalidates list cache; all four attempts kept seeing an old list without the newly created ID. Trace analysis confirms that a pre-create KV response was replayed into memory with roughly 300 seconds of lifetime rather than the collection's 5-second TTL. The preceding f524a8760 run contains the same first-attempt failure and recovered on retry: the symptom predates the latest cleanup delta, but is not established as pre-existing to PR #1164. The exact remote KV invalidation failure remains unresolved; no blind rerun or assertion weakening has been applied. All three automated review checks passed; run-owned resource cleanup succeeded. The preceding commit's successful run is not proof of this revision.

Previous-head remote CI qualification: 756 collected: 680 passed, 45 flaky (passed with retries), 31 expected deployment skips, 0 unexpected failures. The skips are 23 unavailable plugin/features, 7 separate stats-worker checks and 1 unconfigured GitHub provider. That result was retry-green, not a clean first-attempt run; the 45 flaky tests have not been established as pre-existing or fixed by this PR. The separate latest local acceptance above was clean with zero retries. The previous run's owned cleanup completed successfully.

Validated local implementation head: 0a5d5c23755537979e6e8609ad96574c6e76e63a. Review-comment closure remains incomplete; remaining deferrals are not represented as fixed or resolved.

Earlier failed/interrupted diagnostic runs are preserved in local evidence and are not counted as passing acceptance. No production application code or CI workflow was changed. No merge or release is authorized by this PR.

RetriggerView in GreptileConfidence Score: 4/5

The preservation guard must accept the new cache setup before this PR is ready to merge.

Findings

  1. P1 Preservation check rejects new hook ▶

Summary

Consolidates the E2E specs into concern-based suites and adds preservation checks, shared helpers, and local request support.

  • The E2E runner groups related tests into fewer topic-based spec files.
  • Preservation checks compare grouped specs with the original E2E collection.
  • Local browser tests reuse eligible vendor assets and separate API clients by spec.
  • The activity test installs a missing plugin and removes only its own installation.

Reviews (4) · Last reviewed commit: "fix(e2e): clear cache before 97-cache-in..." · Reviewed by Greptile