Skip to content

Commit c580b57

Browse files
Mpdreamzclaude
andcommitted
fix(tests): stub all redirect targets in authoring tests; remove CLI self-redirects
CLI reference pages are now synthetic (generated from schema) rather than physical files. The authoring test framework's copyTargetsFromRealDocsIntoMock was guarded by `File.Exists` which skips synthetic targets, causing redirect validation to fail for all tests that load the real _redirects.yml. - Remove the File.Exists guard so stubs are added for all local redirect targets; synthetic page validity is checked by the production build - Remove 9 no-op self-redirects (cli/changelog/*.md → same) and the cli/assembler/index.md self-redirect Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 9a46be2 commit c580b57

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

docs/_redirects.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,13 @@ redirects:
1414
'cli/release/changelog-remove.md': 'cli/changelog/remove.md'
1515
'cli/release/changelog-render.md': 'cli/changelog/render.md'
1616
'cli/release/index.md': 'cli/changelog/index.md'
17-
# Old hand-written CLI page redirects → generated pages
18-
'cli/changelog/add.md': 'cli/changelog/add.md'
19-
'cli/changelog/bundle.md': 'cli/changelog/bundle.md'
20-
'cli/changelog/bundle-amend.md': 'cli/changelog/bundle-amend.md'
21-
'cli/changelog/evaluate-pr.md': 'cli/changelog/evaluate-pr.md'
22-
'cli/changelog/gh-release.md': 'cli/changelog/gh-release.md'
23-
'cli/changelog/init.md': 'cli/changelog/init.md'
24-
'cli/changelog/remove.md': 'cli/changelog/remove.md'
25-
'cli/changelog/render.md': 'cli/changelog/render.md'
2617
'cli/docset/index.md': 'cli/index.md'
2718
'cli/docset/build.md': 'cli/build.md'
2819
'cli/docset/diff-validate.md': 'cli/diff.md'
2920
'cli/docset/format.md': 'cli/format.md'
3021
'cli/docset/index-command.md': 'cli/cmd-index.md'
3122
'cli/docset/mv.md': 'cli/mv.md'
3223
'cli/docset/serve.md': 'cli/serve.md'
33-
'cli/assembler/index.md': 'cli/assembler/index.md'
3424
'cli/assembler/assemble.md': 'cli/assemble.md'
3525
'cli/assembler/assembler-build.md': 'cli/assembler/build.md'
3626
'cli/assembler/assembler-clone.md': 'cli/assembler/clone.md'

tests/authoring/Framework/Setup.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ navigation_title: Stub
162162
let destPath = Path.Combine(mockDocsRoot, normalized)
163163

164164
// Tests supply their own minimal pages; do not replace them with production content.
165+
// Always add a stub for any local redirect target not already present — this covers both
166+
// physical pages and synthetic pages (e.g. CLI reference pages generated from a schema).
167+
// Actual redirect correctness is validated by the production build, not authoring tests.
165168
if not (fileSystem.File.Exists destPath) then
166-
let sourcePath = Path.Combine(repoRoot, "docs", normalized)
167-
168-
if File.Exists sourcePath then
169-
fileSystem.AddFile(destPath, MockFileData(stubMarkdown)))
169+
fileSystem.AddFile(destPath, MockFileData(stubMarkdown)))
170170

171171
[<AutoOpen>]
172172
type TestFile =

0 commit comments

Comments
 (0)