Centralize tests#24
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.