refactor(test): fold the section test mirror into test/sections - #402
Merged
Merged
Conversation
Contributor
File size check0 over a hard cap (fails), 30 warning(s).
Split the file, wrap the line, shorten or exempt the comment, or list the path in 5 managed file(s) skipped; repo-platform owns them. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The relocation, import rewrites, consumers, documentation, and selector safeguards are consistent with no unresolved defects found.
Review effort: Balanced
Findings: None
What changed in this PR
Consolidates section-specific tests under test/sections/<key>/ while preserving test discovery and changed-section selection.
Changes:
- Moves 26 section test trees and folds seven schema suites into their sections.
- Rewrites imports, scenario roots, harness paths, and documentation.
- Updates and tests changed-section selection for the consolidated layout.
| File | Description |
|---|---|
.github/scripts/changed-sections.ts |
Supports the consolidated test layout and validates misplaced paths. |
AGENTS.md |
Documents the new layout. |
CONTRIBUTING.md |
Updates test-location guidance. |
docs/reference/architecture.md |
Updates test links and architecture prose. |
test/e2e/foundation.test.ts |
Updates the mock-fragment glob. |
test/e2e/gen-support.ts |
Updates path documentation. |
test/e2e/generators.ts |
Repoints generator imports. |
test/e2e/mock/graphql-pipeline.test.ts |
Updates the expected handler guidance. |
test/e2e/mock/handlers.ts |
Points missing handlers to the new location. |
test/e2e/mock/sections.ts |
Repoints all mock-fragment imports. |
test/e2e/mock/server-multi.test.ts |
Repoints the teams mock import. |
test/e2e/mock/server.test.ts |
Repoints the teams mock import. |
test/e2e/mock/state.test.ts |
Repoints the teams mock imports. |
test/e2e/mock/state.ts |
Repoints list mock imports. |
test/e2e/mock/support.ts |
Updates path documentation. |
test/e2e/schema.ts |
Uses the new scenario root. |
test/schema-corpus.test.ts |
Discovers scenarios under the new root. |
test/scripts/changed-sections.test.ts |
Covers the new selector behavior. |
test/sections/list-section.test.ts |
Uses the relocated labels mock. |
test/sections/scenario-set.test.ts |
Checks scenarios under the new root. |
test/sections/actions/** |
Relocates Actions tests, mocks, generators, and scenarios. |
test/sections/actions_secrets/** |
Relocates Actions secrets tests and fixtures. |
test/sections/actions_variables/** |
Relocates Actions variables tests and fixtures. |
test/sections/agents_secrets/** |
Relocates agents secrets tests and fixtures. |
test/sections/agents_variables/** |
Relocates agents variables tests and fixtures. |
test/sections/autolinks/** |
Relocates autolinks tests and fixtures. |
test/sections/branches/** |
Relocates branches tests and fixtures. |
test/sections/check_suite_preferences/** |
Relocates tests and folds the schema suite. |
test/sections/code_quality_setup/** |
Relocates code-quality tests and fixtures. |
test/sections/code_scanning_default_setup/** |
Relocates code-scanning tests and fixtures. |
test/sections/codespaces_secrets/** |
Relocates Codespaces secrets tests and fixtures. |
test/sections/collaborators/** |
Relocates collaborators tests and fixtures. |
test/sections/custom_properties/** |
Relocates custom-property tests and fixtures. |
test/sections/dependabot_secrets/** |
Relocates Dependabot secrets tests and fixtures. |
test/sections/deploy_keys/** |
Relocates deploy-key tests and fixtures. |
test/sections/environments/** |
Relocates environment tests and fixtures. |
test/sections/interaction_limits/** |
Relocates tests and folds the schema suite. |
test/sections/labels/** |
Relocates tests and folds the schema suite. |
test/sections/milestones/** |
Relocates milestone tests and fixtures. |
test/sections/pages/** |
Relocates Pages tests and fixtures. |
test/sections/repository/** |
Relocates repository tests and fixtures. |
test/sections/rulesets/** |
Relocates tests and folds the schema suite. |
test/sections/secret_scanning_custom_patterns/** |
Relocates tests and folds the schema suite. |
test/sections/teams/** |
Relocates tests and folds the schema suite. |
test/sections/webhooks/** |
Relocates tests and folds the schema suite. |
test/sections/workflows/** |
Relocates workflow tests and fixtures. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Vivswan
force-pushed
the
wt/test-mirror-fold
branch
from
September 22, 2026 04:04
01c2379 to
ec347c3
Compare
Vivswan
force-pushed
the
wt/test-mirror-fold
branch
from
September 22, 2026 04:11
ec347c3 to
5e97dc7
Compare
Vivswan
marked this pull request as ready for review
September 22, 2026 04:17
Vivswan
force-pushed
the
wt/test-mirror-fold
branch
from
September 22, 2026 06:55
5e97dc7 to
bb4e2c1
Compare
The 26 per-section test directories move from test/src/sections/<key>/ to test/sections/<key>/, so test/ mirrors src/ without a src segment, as test/engine already does. The seven flat per-key schema suites in test/sections/ join their key directory as schema.test.ts, beside the branches precedent; none needed a merge. Import specifiers inside the moved files drop one ../ toward the repo root, the folded suites gain one, and the rulesets schema suite now imports its generators as a sibling. The e2e harness importers, the scenarioRoots default, the corpus and scenario-set path constants, the mock-fragment glob, and the missing-handler message all name the new root. The changed-sections selector maps test/sections/<key>/ to its section and keeps the flat cross-section suites and snapshot-rows selecting none as before. It throws on any other directory and on a flat file whose stem is a section key or its dashed slug, alone or before a dash or underscore. AGENTS.md, CONTRIBUTING.md, and the architecture reference name the new layout; no lookup under test/src remains.
Vivswan
force-pushed
the
wt/test-mirror-fold
branch
from
September 22, 2026 09:11
bb4e2c1 to
7baf608
Compare
This was referenced Sep 22, 2026
Closed
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.

Before / After
How
test/src/sections/<key>/totest/sections/<key>/; thetest/src/tree is gone.schema.test.ts, so no merge):test/sections/check-suite-preferences-schema.test.tscheck_suite_preferences/schema.test.tsinteraction-limits-schema.test.tsinteraction_limits/schema.test.tslabels-schema.test.tslabels/schema.test.tsrulesets-schema.test.tsrulesets/schema.test.tssecret-scanning-custom-patterns-schema.test.tssecret_scanning_custom_patterns/schema.test.tsteams-schema.test.tsteams/schema.test.tswebhooks-schema.test.tswebhooks/schema.test.ts../toward the repo root; sibling imports unchanged;../../sections/x.jsinside a key directory normalized to../x.js. The folded suites gain one../; the rulesets suite imports./generators.jsas a sibling.test/e2e/mock/sections.ts,state.ts,state.test.ts,server.test.ts,server-multi.test.ts,test/e2e/generators.ts,test/sections/list-section.test.ts.scenarioRootsdefault intest/e2e/schema.ts,test/schema-corpus.test.ts,test/sections/scenario-set.test.ts, the mock glob intest/e2e/foundation.test.ts.test/e2e/mock/handlers.tsand its assertion ingraphql-pipeline.test.ts;mock/support.ts,gen-support.ts.AGENTS.md,CONTRIBUTING.md,docs/reference/architecture.md(hand-written regions; no generated file embeds the path,bun run build:checkis clean)..github/scripts/changed-sections.ts):Proof
typecheck,knip,lint,lint:arch,build:checkall green; cross-model review converged clean.bun run test:e2e --sections labels,environments: 100/100 passed.e2e/constants.jsimport intotest/sections/labels/mock.tsturned the foundation ban red naming that file; reverting turned it green.bun .github/scripts/changed-sections.ts origin/mainprintsalland does not throw on the seven deleted flat suites.Technical details
git diff --stat -M origin/main...HEAD): 404 files, 384 renames. 299 renames are byte-identical (scenarios, mock.test.ts, and every file with no relative import to fix). 85 renames carry import-specifier edits only, +378/-381. 20 files modified in place, +160/-104: the selector and its tests +90/-29, the e2e harness importers and path constants +64/-69, prose +6/-6.test/sections/stay flat on purpose. There is no compat path or fallback lookup undertest/src/.lables-schema.test.ts) are recorded, not built.BEGIN_COMMIT_OVERRIDE
refactor(test): fold the section test mirror into test/sections
The 26 per-section test directories move from test/src/sections// to test/sections//, so test/ mirrors src/ without a src segment, as test/engine already does.
The seven flat per-key schema suites in test/sections/ join their key directory as schema.test.ts, beside the branches precedent; none needed a merge.
Import specifiers inside the moved files drop one ../ toward the repo root, the folded suites gain one, and the rulesets schema suite now imports its generators as a sibling.
The e2e harness importers, the scenarioRoots default, the corpus and scenario-set path constants, the mock-fragment glob, and the missing-handler message all name the new root.
The changed-sections selector maps test/sections// to its section and keeps the flat cross-section suites and snapshot-rows selecting none as before.
It throws on any other directory and on a flat file whose stem is a section key or its dashed slug, alone or before a dash or underscore.
AGENTS.md, CONTRIBUTING.md, and the architecture reference name the new layout; no lookup under test/src remains.
END_COMMIT_OVERRIDE