Skip to content

Build: Fix Windows failure in the Angular docgen worker test - #35787

Merged
ndelangen merged 2 commits into
nextfrom
valentin/fix-angular-docgen-worker-windows-test
Aug 7, 2026
Merged

ndelangen merged 2 commits into
nextfrom
valentin/fix-angular-docgen-worker-windows-test

Conversation

@valentinpalkovic

Copy link
Copy Markdown
Contributor

Closes #

What I did

The Angular docgen worker test asserts that documentation.json is read once and then served from a memo.
It checked that by filtering the readFileSync spy's calls for the exact path string, but built the expected string by interpolating a posix separator while the code under test builds it with path.join.
On Windows the two spellings differ, so the filter matched nothing and the daily Windows unit-test job failed.

provider passes  ->  path.join('/workspace/docs', 'documentation.json')
                       posix: "/workspace/docs/documentation.json"
                       win32: "\workspace\docs\documentation.json"
test expected    ->  `${OUTPUT_DIR}/documentation.json`
                       both:  "/workspace/docs/documentation.json"   <- never equal on win32

The expected path is now built the same way the code builds it. Both spellings resolve to the same memfs node (memfs normalizes separators and strips the drive letter), so the fixture keeps writing and reading the same file:

mkdir target (fixture)                   "/workspace/docs"                       -> /workspace/docs
posix spelling                           "/workspace/docs/documentation.json"    -> /workspace/docs/documentation.json
win32 join (what the provider passes)    "\workspace\docs\documentation.json"    -> /workspace/docs/documentation.json
-const DOCUMENTATION_JSON = `${OUTPUT_DIR}/documentation.json`;
+// Joined rather than interpolated: the provider spells this path with `path.join`, and the
+// read-count assertions below compare the argument it passed by string equality.
+const DOCUMENTATION_JSON = join(OUTPUT_DIR, 'documentation.json');

This is a test-only fix. The provider itself was already correct on Windows: the read succeeded there, which is why the failure only showed up in the call-count assertion.

What the failure looked like

From tests-unit--windows on the daily pipeline:

 FAIL   @storybook/angular-vite  src/docgen/docgen-worker.test.ts > createDocgenProvider > re-reads documentation.json when Compodoc is re-run mid-session
AssertionError: expected [] to have a length of 1 but got +0

- Expected
+ Received

- 1
+ 0

 ❯ src/docgen/docgen-worker.test.ts:156:7
    154|     expect(
    155|       vi.mocked(readFileSync).mock.calls.filter(([p]) => p === DOCUMEN…
    156|     ).toHaveLength(1);
       |       ^

 Test Files  1 failed | 664 passed | 7 skipped (672)
      Tests  1 failed | 8340 passed | 25 expected fail | 76 skipped | 2 todo (8444)

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

  1. From the repository root, run yarn test code/frameworks/angular-vite
  2. All 20 test files pass on macOS/Linux, unchanged from before
  3. The Windows unit-test job is the one that proves the fix; it runs on the daily pipeline and on this PR's CI

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Declare whether manual QA will be needed for this PR during the next release, through qa:needed or qa:skip

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

The memo assertion compared the path handed to `readFileSync` against an
interpolated posix string, while the provider builds it with `path.join`. On
Windows those spellings differ, so the filter matched nothing.
@valentinpalkovic valentinpalkovic added build Internal-facing build tooling & test updates qa:skip Pull Requests that do not need any QA. (e.g. documentation) labels Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 205735fb-a357-43db-b7b5-f59e2bc5771a

📥 Commits

Reviewing files that changed from the base of the PR and between a76f26d and 11f0376.

📒 Files selected for processing (1)
  • code/frameworks/angular-vite/src/docgen/docgen-worker.test.ts

Walkthrough

The Angular Vite docgen worker test now uses path.join to construct the documentation.json path. This matches the provider’s path representation used by read-count assertions.

Changes

Documentation path handling

Layer / File(s) Summary
Align test documentation path
code/frameworks/angular-vite/src/docgen/docgen-worker.test.ts
The test imports join from node:path and uses it to construct DOCUMENTATION_JSON.

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

Comment thread code/frameworks/angular-vite/src/docgen/docgen-worker.test.ts Outdated
@valentinpalkovic valentinpalkovic added the ci:daily Run the CI jobs that normally run in the daily job. label Aug 6, 2026
@valentinpalkovic valentinpalkovic self-assigned this Aug 6, 2026
@storybook-app-bot

Copy link
Copy Markdown
Contributor

Package Benchmarks

Commit: 11f0376, ran on 6 August 2026 at 13:56:07 UTC

The following packages have significant changes to their size or dependencies:

@storybook/angular-vite

Before After Difference
Dependency count 29 29 0
Self size 23.03 MB 23.04 MB 🚨 +12 KB 🚨
Dependency size 12.68 MB 12.68 MB 0 B
Bundle Size Analyzer Link Link

@ndelangen
ndelangen merged commit 0350cff into next Aug 7, 2026
295 of 304 checks passed
@ndelangen
ndelangen deleted the valentin/fix-angular-docgen-worker-windows-test branch August 7, 2026 07:39
@github-actions github-actions Bot mentioned this pull request Aug 7, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates ci:daily Run the CI jobs that normally run in the daily job. qa:skip Pull Requests that do not need any QA. (e.g. documentation)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants