-
-
Notifications
You must be signed in to change notification settings - Fork 781
test: remove runner factory #11741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: remove runner factory #11741
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this 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 refactors the test runner infrastructure in rspack-test-tools
to remove legacy runner factory classes and replace them with a more flexible runner creator interface. The main goal is to modernize and simplify test runner instantiation and management.
- Replaces multiple runner factory classes with a unified
TTestRunnerCreator
interface - Consolidates runner creation logic directly into test case files
- Introduces new web runner types and utilities for enhanced test scenarios
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
packages/rspack-test-tools/src/type.ts | Removes legacy runner factory imports, adds TTestRunnerCreator interface and moves runner-related types from deleted files |
packages/rspack-test-tools/src/test/creator.ts | Updates runner configuration to use new TTestRunnerCreator type instead of factory classes |
packages/rspack-test-tools/src/test/context.ts | Replaces getRunnerFactory /setRunner methods with unified getRunner method that creates runners directly |
packages/rspack-test-tools/src/runner/ | Removes multiple factory files and consolidates exports to just node and web runners |
packages/rspack-test-tools/src/case/ | Migrates all test case files to use new runner creator pattern with inline runner creation functions |
packages/rspack-test-tools/etc/test-tools.api.md | Updates public API to reflect removal of factory classes and addition of new runner types |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 Binary Size-limit
🙈 Size remains the same at 47.43MB |
CodSpeed Performance ReportMerging #11741 will not alter performanceComparing Summary
|
Summary
Remove runner factories and move logic to the test cases
This pull request refactors the test runner infrastructure in
rspack-test-tools
to simplify and modernize how test runners are created and managed. The main change is the removal of multiple runner factory classes in favor of a more flexible runner creator interface, which streamlines runner instantiation and improves maintainability. Several related APIs and type definitions are updated to support this new approach. Additionally, new runner types and utilities are introduced to support web-based and multi-compiler test scenarios.Test Runner Infrastructure Refactor
Removed legacy runner factory classes (
BasicRunnerFactory
,CacheRunnerFactory
,HotRunnerFactory
,MultipleRunnerFactory
,WatchRunnerFactory
) from the public API and replaced them with theTTestRunnerCreator
interface for a more flexible runner creation mechanism. [1] [2] [3]Updated the test context API: replaced
getRunnerFactory
andsetRunner
methods with a singlegetRunner
method that directly creates and returns a runner instance, simplifying runner management. [1] [2] [3] [4]Changed configuration options (
runner
,runnerFactory
) inIBasicCaseCreatorOptions
andITesterConfig
to use the newTTestRunnerCreator
type, ensuring consistent runner creation throughout the codebase. [1] [2]New Runner Types and Utilities
Added the
WebRunner
class andIWebRunnerOptions
interface to support running tests in a web (DOM) environment, and integrated these into cache test scenarios. [1] [2] [3] [4]Added utilities for multi-compiler runner management (
createMultiCompilerRunner
,getMultiCompilerRunnerKey
) and updated config test cases to use these new utilities. [1] [2]Test Case Migration
cache.ts
,config.ts
,hot-step.ts
,hook.ts
) to use the new runner creator interface, replacing direct references to runner factory classes with the new pattern. [1] [2] [3] [4]Type and API Cleanup
THotStepRuntimeData
,THotStepRuntimeLangData
) and updated imports accordingly. [1] [2] [3][1] [2] [3] [4] [5]
Related links
Checklist