Skip to content

Conversation

@Timeless0911
Copy link
Contributor

@Timeless0911 Timeless0911 commented Aug 7, 2025

Summary

replace npx with a faster helper

before

image

after

image

Related Links

web-infra-dev/rsbuild#5784

Checklist

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

Copy link
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 optimizes test execution by replacing slow npx commands with a faster direct Node.js helper for running the rslib CLI. Instead of using npx rslib which has overhead from package resolution, tests now use direct node execution with a pre-resolved path to the rslib binary.

Key changes:

  • Introduced helper functions runCli and runCliSync that execute rslib commands directly via Node.js
  • Replaced all npx rslib calls in test files with the new helper functions
  • Added direct binary path resolution for faster command execution

Reviewed Changes

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

Show a summary per file
File Description
tests/scripts/shared.ts Added helper functions and binary path resolution for direct rslib CLI execution
tests/integration/server/index.test.ts Replaced npx rslib with runCli helper for mf-dev command
tests/integration/plugins/index.test.ts Replaced npx rslib with runCli helper for mf-dev command
tests/integration/cli/mf/mf.test.ts Replaced npx rslib calls with runCli and runCliSync helpers
tests/integration/cli/inspect/inspect.test.ts Replaced npx rslib calls with runCliSync helper
tests/integration/cli/env/env.test.ts Replaced npx rslib calls with runCliSync helper
tests/integration/cli/build/build.test.ts Replaced npx rslib calls with runCliSync helper
tests/integration/cli/build-watch/build.test.ts Replaced npx rslib and spawn calls with new helpers and direct binary path

@Timeless0911 Timeless0911 enabled auto-merge (squash) August 7, 2025 08:12
Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

👍

@Timeless0911 Timeless0911 merged commit f727b18 into main Aug 7, 2025
16 checks passed
@Timeless0911 Timeless0911 deleted the rm/npx branch August 7, 2025 08:13
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.

3 participants