Skip to content

test(e2e): replace per-provider add-flow tests with representative journeys and registry contract tests #989

Closed

Description

@Astro-Han

Problem

apps/desktop/e2e/providers.spec.ts has grown to 42 executed tests, 30+ of which are copies of one template: open Settings → catalog → tab → search → open provider → assert form defaults → save → assert detail. The only difference between the copies is registry data (slug, base URL, default model, catalog group, brand mark) — the code path they exercise is identical.

This verifies pure PROVIDER_DEFAULTS facts through the most expensive vehicle available. Every provider adds a real Electron window launch/teardown, so suite time (~4 min) and the teardown-flake surface grow linearly with the catalog — see the Tearing down "window" exceeded the test timeout failure on #988, an infrastructure hang in one of the 42 windows, unrelated to the change under test. The pattern contradicts AGENTS.md ("cover one representative journey rather than every variation") and keeps propagating: each new provider PR copies the previous test (most recently #944, #978).

Desired outcome

  • providers.spec.ts runs a single-digit number of tests: one representative API-key add journey end to end, the keyboard-focus restore case, and one variant per genuinely different behavior (OAuth/gated providers, local runtimes) — not one per provider.
  • Per-provider facts (slug, base URL, default model, catalog group, official color mark asset exists) are covered by a data-driven contract test iterating PROVIDER_DEFAULTS, which fails when a provider is added without coverage. The registry-derived conformance matrix from feat(core): derive provider conformance matrix from registry declarations #974 is the natural seam.
  • The colorAssetRenderContract mechanism (brand mark renders as a color asset) is verified once in E2E; per-provider asset presence becomes a static check.
  • Adding a provider no longer adds an Electron window to CI, and the convention is written down where provider PR authors will see it (AGENTS.md or the spec file header), so the copy-paste pattern stops reproducing.

Alternatives or workarounds

  • Keep the status quo and only harden window teardown: reduces flake but suite time and per-provider cost keep growing linearly, and the data assertions stay in the wrong layer.
  • Parallelize/shard the E2E job: hides the wall-clock symptom, pays the same compute, and does nothing about the flake surface or the propagating pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions