Skip to content

Tests: split the masquerade controller tests by concern - #2102

Merged
Kevinjohn merged 53 commits into
issue/2031-step-3-part-2-planning-cache-testsfrom
issue/2031-step-3-part-3-masquerade-controller-tests
Nov 16, 2026
Merged

Kevinjohn merged 53 commits into
issue/2031-step-3-part-2-planning-cache-testsfrom
issue/2031-step-3-part-3-masquerade-controller-tests

Conversation

@Kevinjohn

@Kevinjohn Kevinjohn commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

What and why

Step 3 of #2031, part 3: apps/frontend/src/auth/masqueradeController.test.ts splits into the base file (start) plus .end, .coldBootstrap, .serverStatus and .generationFencing, with shared setup in masqueradeController.testSupport.ts.

  • Moved tests, not new ones. A script compared each test's describe path, title and whitespace-free body, and every hook, before and after the split: 0 mismatches, and the comparison goes red on a changed body or a missing hook. Only imports moved. The 33 tests match.

Part of #2031

Gate evidence

  • pnpm run check:changed <predecessor branch>: passed.
  • Pre-push check:push (format, type-check, lint): passed.
  • Validation workflow on this head: run 43931882583
  • Stack tip gate: the scripts-move tip 59ee4999b, which contains this branch, passed gate:all and e2e (309).

Merge order

#2063 → #2064 → #2065 → #2066 → #2067 → #2068 → #2069 → #2070 → #2071 → #2072 → #2073 → #2074 → #2075 → #2076 → #2077 → #2078 → #2079 → #2080 → #2081 → #2082 → #2083 → #2084 → #2085 → #2086 → #2087 → #2088 → #2089 → #2090 → #2091 → #2092 → #2093 → #2094 → #2095 → #2096 → #2097 → #2098 → #2099 → #2100 → #2101 → #2102

Merge predecessor for this PR: #2101.

One linear stack; each PR targets the previous PR's branch, so no pair of open PRs conflicts.

Closes #1973.

The docs build, navigation check, lightbox runtime and screenshot
publication check now live together in scripts/docs/. Repository-root
lookups gain one level, and the docs workflow path filters, pnpm
commands, ESLint ignores, VitePress config and lightbox test point at
the new paths. Command names and the generated site are unchanged.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Closes #1974.

The port registry, lane claims, launcher, demo and full-stack runners and
the port guard now live together in scripts/dev/. Imports from Vite,
VitePress, Playwright, the backend test runner, end-to-end support and
the remaining scripts follow the new paths, as do the port guard's file
list and messages, the docs workflow path filter, package scripts and
the user story source links. Repository-root lookups gain one level.
Command names and behaviour are unchanged.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Closes #1975.

The bundle budget, SPA route checks, Paraglide parity check, static route
list and the Adonis public sync now live together in scripts/build/.
The sync script and parity check resolve the repository root one level
higher; the budget and route checks keep reading dist/ from the working
directory. Package scripts, workflow build steps, frontend imports,
ESLint allowances and the tests that read or copy these files follow
the new paths. Command names and behaviour are unchanged.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Closes #1976.

The Playwright run mode, worker runtime and guardian, preset and browser
runners, the production rehearsal server and their tests now live
together in scripts/e2e/; browser scenarios stay in e2e/. Playwright
config, the end-to-end type-check project, frontend and backend tests,
ESLint allowances, the port guard's file list and package scripts follow
the new paths. The changed-file selector's end-to-end input pattern now
matches scripts/e2e/playwright*, and the preset path test copies its
files into the same folder layout. Command names and behaviour are
unchanged.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Closes #1977.

The changed-file selector, gate runner and command list, pre-push hook,
Node 26 check and workflow outcome report now live together in
scripts/ci/, and the gate command fixture moves to scripts/ci/fixtures/.
The Git hook, package scripts, workflow run steps (including the
tooling and static scope selection in gate.yml and static-analysis.yml)
and CONTRIBUTING.md follow the new paths, and repository-root lookups
gain one level.

The selector now matches script files in any scripts/ subfolder and
finds the test files that import a script by their relative path, so a
change to a moved script still selects its tests. Its fixtures name the
moved paths. Command names are unchanged.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Closes #1978.

Release packaging, deployment, the packaged-server and dialog smoke tests,
the loopback proxy and the release validation gate now live together in
scripts/release/; the container runtime preparation, published image
check and Compose smoke test sit under scripts/release/docker/.
render-client-nginx was already removed by #1964, so it is not moved.

Package scripts, the gate, docker, validation and release provenance
workflow paths and run steps, the Dockerfile's runtime preparation step
and the tests that read these files follow the new paths. Repository-root
lookups gain one or two levels.

Release provenance rebuilds archives from the release tag's own tree, so
its guard now accepts the packaged-server smoke test at either the new
or the old path; tags cut before this move still rebuild. Command names
and publication triggers are unchanged.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Part of #2031.

Step 3.3. The 33 tests move unchanged into five files beside
masqueradeController.ts, each keeping its describe title. They drive
MasqueradeController through injected dependencies, so none moves
beside masqueradeControllerInstance.ts:
- masqueradeController.test.ts: starting a member view, its flush and
  suspension, and transitions while a start is pending;
- masqueradeController.end.test.ts: ending, failed and ambiguous End
  responses and DELETE outcomes from another tab;
- masqueradeController.coldBootstrap.test.ts: adopting a validated
  member view before planning data is loaded;
- masqueradeController.serverStatus.test.ts: adopting server status and
  shared-session reconciliation;
- masqueradeController.generationFencing.test.ts: stale starts,
  retries and restorations that must not publish.
The fixture state, inactiveStatus, deferred and harness move to
masqueradeController.testSupport.ts; each file keeps the beforeEach
that resets the store. The ordered tests and hooks of the old file, with
describe path and whitespace-free body, match the new files with no
differences.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Closes #2031.

Step 3.4. #2021 split the account client into request modules, so the 23
tests move unchanged next to the code they drive, keeping their describe
titles:
- accountCommands.test.ts: command secrets, the in-memory fallback and
  stored-command cleanup across identities;
- commandRequest.test.ts: command headers and JSON encoding, and reuse
  of a command across unknown, 408 and conflict outcomes;
- commandOutcome.test.ts: payload binding and the unknown-outcome
  classification;
- sessionRequests.test.ts: status and company-list reads and the audit
  warning;
- memberRequests.test.ts: member-resource commands, the route table and
  the ownership route;
- admissionRequests.test.ts: the admission list query.
The route-table test also calls the invitation, masquerade and signup
request modules; it sits with memberRequests, the first it calls.
command, transferOwner and expectCommand move to
accountCommands.testSupport.ts. Each file keeps its own requestTimeout
mock, because vi.mock is hoisted per file. The ordered tests and hooks
of the old file, with describe path and whitespace-free body, match the
new files with no differences.

With steps 1 to 3 no single-use registerX wrapper remains, and each of
the seven large test files is split by behaviour beside its module.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Closes #1979.

The DCO, Dependabot, Gitleaks and UI primitive checks, the shadcn
registry wrapper, the major dependency report and the Sonner CSP test
now live together in scripts/maintenance/, with the DCO ratifications
beside their check and the Sonner import probe in fixtures/. Package
scripts, the gate workflow's sign-off step, the Gitleaks configuration
comment and the selector test fixtures follow the new paths;
repository-root lookups and the UI check's parse of the registry
working directory gain one level. Command names and behaviour are
unchanged.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Closes #1980.

The pnpm spawn helper, its declarations and its test now live in
scripts/shared/. Every importer follows the new path: the preset and
browser runners, the selector, gate runner and pre-push hook, the
Paraglide parity check, the maintenance and end-to-end scripts, the
frontend test and the end-to-end global setup. The preset path test
copies the helper into the same folder layout. Command names and
behaviour are unchanged.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…ue/2031-step-3-part-3-masquerade-controller-tests

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…nto issue/2031-step-3-part-4-account-request-tests

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…sue/1973-scripts-docs

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>

# Conflicts:
#	scripts/e2e/e2eReset.test.mjs
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…ntenance

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…-shared

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Closes #2028. docs/ is removed from the index and ignored. The Pages
workflow builds the site in its own run before uploading it; the docs
workflow keeps the build and navigation check and runs the image
lightbox test against the built site through a new docs:test script,
since that test reads docs/. The frontend suite skips that file unless
docs:test runs it. check:changed builds and checks the site instead of
comparing a committed copy. AGENTS.md, CONTRIBUTING.md, README.md, the
PR template, the CodeQL path filter and the OpenSSF answer no longer
describe a committed site; `pnpm run docs:build` still produces the
offline copy in docs/.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…ue/2031-step-3-part-3-masquerade-controller-tests

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…nto issue/2031-step-3-part-4-account-request-tests

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…sue/1973-scripts-docs

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…ntenance

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…-shared

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…ing-docs

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
The open-source page still told contributors to rebuild the committed site
before opening a pull request. docs/ is no longer committed, so the page now
asks for a passing docs:build and sources only, and a documentation policy
test keeps contributor guidance from asking for a committed site again.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
The default frontend suite excludes the lightbox test because it reads the
built site. check:changed still passed a changed copy of it to vitest as a
frontend test file: --static then failed with no test files found, and the
full check ran vitest related, which matched nothing and passed without
running it. A change to that test now selects the docs build and docs:test
steps instead.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Part of #1975. The .dockerignore rule **/build also matched the new
scripts/build/ folder, so the image's pnpm run build would not find
the build tooling it runs. Re-include that folder; other build output
stays excluded.

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…ntenance

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…-shared

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
…ing-docs

Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Stop committing the generated documentation site
Move the shared pnpm process helper into scripts/shared/
Move repository maintenance checks into scripts/maintenance/
Move release packaging and smoke tests into scripts/release/
Move CI selection, gates and reporting into scripts/ci/
Move browser-test infrastructure into scripts/e2e/
Move application build tooling into scripts/build/
Move local development and port management into scripts/dev/
Move documentation tooling into scripts/docs/
…unt-request-tests

Tests: split the account request tests by module
@Kevinjohn
Kevinjohn merged commit a25ec7c into issue/2031-step-3-part-2-planning-cache-tests Nov 16, 2026
2 checks passed
@Kevinjohn
Kevinjohn deleted the issue/2031-step-3-part-3-masquerade-controller-tests branch November 16, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

polish-done Polish review complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant