Skip to content

test(e2e): fix unstable rspack profile cases#5507

Merged
chenjiahan merged 2 commits intomainfrom
logger_case_0630
Jun 30, 2025
Merged

test(e2e): fix unstable rspack profile cases#5507
chenjiahan merged 2 commits intomainfrom
logger_case_0630

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

Fix the unstable rspack profile E2E cases, see:

Screenshot 2025-06-28 at 09 51 48

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings June 30, 2025 08:17
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 30, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit f29b215
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68624a7b03ae740008921cc0
😎 Deploy Preview https://deploy-preview-5507--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 79 (🟢 up 4 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR stabilizes the rspack profile end-to-end tests by extracting shared logic into a helper, switching from exec to spawn, and ensuring the dev server process exits when compilation finishes.

  • Extracted an expectProfileFile helper to reduce duplication
  • Updated both dev and build tests to use spawn and the shared helper
  • Added a onDevCompileDone exit hook in dev.mjs to prevent hanging

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
e2e/cases/rspack-profile/index.test.ts Refactored tests to use expectProfileFile, replaced exec with spawn
e2e/cases/rspack-profile/dev.mjs Added rsbuild.onDevCompileDone callback to gracefully exit process
Comments suppressed due to low confidence (3)

e2e/cases/rspack-profile/index.test.ts:42

  • [nitpick] For consistency and readability in test titles, consider capitalizing “RSPack” (e.g. 'should generate RSPack profile as expected in dev').
  'should generate rspack profile as expected in dev',

e2e/cases/rspack-profile/index.test.ts:18

  • Consider also listening to childProcess.stderr alongside stdout, since some tools emit logs or errors on stderr which your test might miss.
const expectProfileFile = async (

e2e/cases/rspack-profile/dev.mjs:25

  • Immediately calling process.exit(0) may terminate the process before the profile file is fully flushed; consider waiting for the profile save log event or ensuring the file write completes before exiting.
  rsbuild.onDevCompileDone(() => {

Comment thread e2e/cases/rspack-profile/index.test.ts
@chenjiahan chenjiahan merged commit cba3a9b into main Jun 30, 2025
11 checks passed
@chenjiahan chenjiahan deleted the logger_case_0630 branch June 30, 2025 08:34
@chenjiahan chenjiahan mentioned this pull request Jul 1, 2025
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.

2 participants