Skip to content

fix: test rstest examples when run rslib / rsbuild eco-ci#24

Merged
9aoy merged 1 commit intomainfrom
rstest-examples
Mar 27, 2026
Merged

fix: test rstest examples when run rslib / rsbuild eco-ci#24
9aoy merged 1 commit intomainfrom
rstest-examples

Conversation

@9aoy
Copy link
Copy Markdown
Contributor

@9aoy 9aoy commented Mar 27, 2026

test rstest examples when run rslib / rsbuild eco-ci.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds the test:examples script to the test suites for both rsbuild and rslib. The review feedback identifies an improvement opportunity to update the beforeTest hooks in both files to include the installation of the webkit browser, ensuring that the newly added example tests have the necessary Playwright dependencies to run successfully.

branch: process.env.RSTEST ?? 'main',
// ignore snapshot changes
test: ['test -u'],
test: ['test -u', 'test:examples'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Adding the test:examples script likely requires webkit to be installed for Playwright, as is done in tests/rspack/rstest.ts. The beforeTest hook on line 12 only installs chromium, which may cause test:examples to fail.

To ensure consistency and prevent potential failures, please consider updating the beforeTest hook to also install webkit:

// tests/rsbuild/rstest.ts:11-13
beforeTest: async () => {
  await $`pnpm exec playwright install chromium webkit --with-deps`;
},

repo: 'web-infra-dev/rstest',
branch: process.env.RSTEST ?? 'main',
test: ['test'],
test: ['test', 'test:examples'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Adding the test:examples script likely requires webkit to be installed for Playwright, as is done in tests/rspack/rstest.ts. The beforeTest hook on line 11 only installs chromium, which may cause test:examples to fail.

To ensure consistency and prevent potential failures, please consider updating the beforeTest hook to also install webkit:

// tests/rslib/rstest.ts:10-12
beforeTest: async () => {
  await $`pnpm exec playwright install chromium webkit --with-deps`;
},

@9aoy 9aoy merged commit 0f14668 into main Mar 27, 2026
17 of 21 checks passed
@9aoy 9aoy deleted the rstest-examples branch March 27, 2026 06:27
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