Skip to content

test: give each reload test file its own CSS fixture - #5788

Merged
alexander-akait merged 1 commit into
mainfrom
test/separate-reload-fixtures
Oct 30, 2026
Merged

alexander-akait merged 1 commit into
mainfrom
test/separate-reload-fixtures

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Summary

test/e2e/api-plugin.test.js, event-source.test.js and hot-and-live-reload.test.js all rewrite test/fixtures/reload-config/main.css, and node --test runs files in parallel. One file can then see another's colour, or an extra rebuild from another's write. Both failures below are from Windows CI on #5787, which touches none of these tests:

Run Failing test Symptom
1st hot-and-live-reload.test.js:308 snapshot had "bundle rebuilding (…/reload-config/main.css changed)" twice
re-run api-plugin.test.js:846 page was rgb(255, 0, 0) before the test changed anything; its beforeEach had just written blue

This gives api-plugin and event-source their own copies (reload-config-3, reload-config-4), as progress.test.js already does with reload-config-2. hot-and-live-reload keeps reload-config, so its snapshots don't change.

What kind of change does this PR introduce?

test

Did you add tests for your changes?

No new tests: it only changes test fixtures. api-plugin.test.js and event-source.test.js pass locally.

Does this PR introduce a breaking change?

No.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

n/a

Use of AI

Claude Code traced the two CI failures to the shared fixture and made this change. It ran both changed test files and npm run lint locally.


Generated by Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded automated checks for CSS handling during configuration reloads in API plugin and event-source scenarios.
    • Added separate test configurations and CSS fixtures for these scenarios, helping verify that stylesheet imports are processed consistently.

`api-plugin`, `event-source` and `hot-and-live-reload` all rewrote
`test/fixtures/reload-config/main.css`, and `node --test` runs files in
parallel, so a test could see another file's colour or an extra rebuild.
Give `api-plugin` and `event-source` their own copies, as `progress`
already does with `reload-config-2`.

Claude-Session: https://claude.ai/code/session_013FhutSnStkMpV2mZSNb8M9
@changeset-bot

changeset-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 96b8c60

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a99cde0a-c4af-469f-8058-4f82242912ea
Commits

Reviewing files that changed from the base of the PR and between d78f183 and 96b8c60.

Files selected for processing: 7
  • .gitignore
  • test/e2e/api-plugin.test.js
  • test/e2e/event-source.test.js
  • test/fixtures/reload-config-3/foo.js
  • test/fixtures/reload-config-3/webpack.config.js
  • test/fixtures/reload-config-4/foo.js
  • test/fixtures/reload-config-4/webpack.config.js

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

Added separate webpack fixtures for the API plugin and event-source end-to-end tests. Each fixture imports CSS and defines a development configuration with CSS loaders. The tests now use their respective fixture configurations and CSS paths. The .gitignore file excludes both fixture CSS files.

Priority: Normal

Merge Risk: Minimal · up to 96b8c

The change isolates the reload tests’ CSS fixtures. No merge-blocking issue is identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test: give each reload test file its own CSS fixture" matches the main change. The PR gives api-plugin.test.js and event-source.test.js their own CSS fixture copies (reload-config-3 and rel…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test: give each reload test file its own CSS fixture" matches the main change. The PR gives api-plugin.test.js and event-source.test.js their own CSS fixture copies (reload-config-3 and reload-config-4) so parallel reload tests stop writing to the shared reload-config/main.css. The title is short, specific, and follows the conventional commit style. It does not name the Windows CI failure, but it does not need to cover every detail.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 6 files. (1 skipped: 1 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.80%. Comparing base (d78f183) to head (96b8c60).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5788   +/-   ##
=======================================
  Coverage   95.80%   95.80%           
=======================================
  Files           6        6           
  Lines        5551     5551           
=======================================
  Hits         5318     5318           
  Misses        233      233           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alexander-akait
alexander-akait merged commit 9a6472e into main Oct 30, 2026
17 checks passed
@alexander-akait
alexander-akait deleted the test/separate-reload-fixtures branch October 30, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant