Skip to content

Centralize tests#24

Merged
marcleblanc2 merged 9 commits into
mainfrom
centralize-tests
Jun 11, 2026
Merged

Centralize tests#24
marcleblanc2 merged 9 commits into
mainfrom
centralize-tests

Conversation

@marcleblanc2

Copy link
Copy Markdown
Collaborator

No description provided.

marcleblanc2 and others added 9 commits June 10, 2026 02:22
Live tier is now the fast FUNCTIONAL tier (~10 min, was ~87 min):
- Seed/restore involved repos directly via GraphQL instead of the
  product's restore command (which full-captures 10k users per call
  and whose whole-instance semantics clobber concurrent runs)
- Demote intrinsically whole-instance cases to the performance tier:
  get-repos-filter, set-full/set-repos/set-users-without-perms
  sync-saml-orgs dry-runs (each measured ~400 s)
- Make the legacy whole-instance stress cycle opt-in only
  (--live "full cycle"); it crashed the test instance's Postgres
  (1,150 repo overwrites x 10,002 bindIDs at parallelism 16)

Catch scale bugs with small data:
- FakeSourcegraphClient caps site-user pages at 2, so 4-user fixtures
  exercise multi-page candidate selection locally; verified it catches
  the 2026-06-10 first-page truncation bug in milliseconds

Product fixes surfaced by the split:
- Additive applies now emit mutations_succeeded to the run log
  (harness mutation-count checks previously read 0)
- capture_explicit_grants short-circuits per-user lookups when the
  repo selection is empty, while still draining the recording user
  stream that feeds mapping and SAML extraction

Amp-Thread-ID: https://ampcode.com/threads/T-019eaec8-b78c-7386-b977-d93720ad3219
Co-authored-by: Amp <amp@ampcode.com>
setup.yaml declares the desired test-instance state; setup.py (dry-run
default, --apply converges) verifies site config and synthetic user/repo
counts, rewrites legacy marc.leblanc+ addresses to
{username}@perms-sync.test (10,000 rewritten), fabricates SAML external
accounts with synthetic groups via SQL on the pgsql pod (verified back
through the product's own accountData parser), deletes orphaned explicit
grants (60,006 rows on soft-deleted repos found and removed), and clears
pending permissions.

New live coverage built on those fixtures:
- saml-group-live: samlGroup selector against fabricated accounts, with
  sales-only and no-group canaries; same fixture asserts identical
  behavior locally (39 s live)
- set-created-after-temp-user: harness creates a temp user via
  createUser, {today} substitution makes --created-after select exactly
  it out of 10k users, then hard-deletes it (13 s live)
- live.requiredSamlGroups preflight points at setup.py on drift
- live hygiene bookends: pending bindIDs must be empty at tier start/end

All fixtures migrated off marc.leblanc+...@sourcegraph.com addresses
(49 files); regex-filters-scope now matches ^test_user_0999[12]@...

Amp-Thread-ID: https://ampcode.com/threads/T-019eaec8-b78c-7386-b977-d93720ad3219
Co-authored-by: Amp <amp@ampcode.com>
- Drop legacyEmailPattern (migration done): the email check now compares
  every live synthetic user against emailTemplate, so any future drift is
  caught, not just the old marc.leblanc+ pattern
- Pending permissions are now REPORT-ONLY everywhere (setup.py and the
  live hygiene bookend): nothing in this suite creates them, so rows have
  unknown origin and removal is a human decision. The only state setup
  ever deletes is explicit grants attached to soft-deleted repos
  (unreachable rows)

Amp-Thread-ID: https://ampcode.com/threads/T-019eaec8-b78c-7386-b977-d93720ad3219
Co-authored-by: Amp <amp@ampcode.com>
case_runners now returns cli+import for every state case with a
cliCommand. The import run derives its Config from the same command
line: parse argv, diff against a default Config, rebuild via keyword
construction + model_copy — the documented library-consumer path. Both
entrypoints must produce the exact after.json state, proving CLI/import
parity for all 29 state cases (local tier: 68 → 97 checks). Explicit
importConfig still overrides the derived one to pin specific kwargs
spellings; replay cases stay CLI-only (parser behavior has no import
equivalent).

Amp-Thread-ID: https://ampcode.com/threads/T-019eaec8-b78c-7386-b977-d93720ad3219
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2 marcleblanc2 merged commit 8c80f60 into main Jun 11, 2026
6 checks passed
@marcleblanc2 marcleblanc2 deleted the centralize-tests branch June 11, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant