Support `concurrency` when `--experimental-test-isolation` is set to `'none'`
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 2 小时
- 30 天内合并 PR
- 283
描述
What is the problem this feature will solve?
It would be nice to be able to run multiple "workers" when using the none test isolation mode.
Today, according to the docs, when --experimental-test-isolation is set to 'none', it implies 1 concurrency: https://github.com/nodejs/node/blob/f270462c09ddfd770291a7c8a2cd204b2c63d730/doc/api/cli.md#L2252-L2264
However, mocha another test runner that does not isolate tests, does accept a concurrency flag: https://mochajs.org/#parallel-tests
What is the feature you are proposing to solve the problem?
We're looking to move off of jest because its test module isolation is extremely slow. We love the idea of using the node-native test runner with isolation disabled, instead of adopting another third-party framework like mocha.
However, we'd need to write some custom code (e.g., using parallel) to spin up n concurrent, isolation-disabled tests to effectively utilize all the cores available on our CI machine.
The docs and other recent comments all indicate that when --experimental-test-isolation is set to 'none', concurrency must be 1. However, I couldn't find the reasoning in the original PR or issue.
There's probably a good reason for this but, as someone not intimately familiar with the implementation, it's not obvious to me why we wouldn't be able to run non-isolated tests concurrently, like in mocha.
What alternatives have you considered?
I could probably use a tool like parallel to spin up multiple calls to node --test. However, this would require me to also write code to split up all the test files between the parallel runs, etc.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先从 doc/api/cli.md 中关于 --experimental-test-isolation 的文档开始,然后阅读原始 PR #53927 和 issue #51548,了解现有的并发限制。跟踪 node --test 的入口点,并确定并发的非隔离 worker 应如何运行;完成标准包括支持所请求的 flag 组合并记录其语义。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, nodejs
- 领域
- cli, testing-qa
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100