chore(tests): Added test variant flag#18458
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a --variant flag to the E2E test runner, enabling developers to run specific test variants (e.g., different Next.js versions) against individual test applications.
- Adds
--variantflag parsing to support both--variant=<name>and--variant <name>formats - Implements variant matching logic that reads variant configurations from test application
package.jsonfiles - Updates documentation with usage examples and explanation of variant matching behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
dev-packages/e2e-tests/run.ts |
Adds interfaces for variant configuration, implements variant flag parsing and matching logic, integrates variant build commands into test execution flow |
dev-packages/e2e-tests/README.md |
Documents the new --variant flag usage with examples and explains the case-insensitive partial matching behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
size-limit report 📦
|
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
0366df2 to
11ce429
Compare
11ce429 to
86126e5
Compare
| yarn test:run <app-name> --variant <variant-name> | ||
| ``` | ||
|
|
||
| Variant name matching is case-insensitive and partial. For example, `--variant 13` will match `nextjs-pages-dir (next@13)` if a matching variant is present in the test app's `package.json`. |
There was a problem hiding this comment.
l: can we show an example of the package.json entry? I'm aware this existed before but I think it's worth mentioning it more explicitly in the readme
There was a problem hiding this comment.
Makes sense, I added an example
I have been running a lot of Next.js tests and needed to run specific variants against my changes, so I made these changes to our test runner script and thought to share it with everyone.
Closes #18459 (added automatically)