fix: test rstest examples when run rslib / rsbuild eco-ci#24
Conversation
There was a problem hiding this comment.
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'], |
There was a problem hiding this comment.
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'], |
There was a problem hiding this comment.
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`;
},
test rstest examples when run rslib / rsbuild eco-ci.