🔧 限制本地测试为单 worker,CI 保留并行分片 - #1767
Open
cyfung1031 wants to merge 1 commit into
Open
cyfung1031 wants to merge 1 commit into
cyfung1031 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist / 检查清单
背景
本地执行完整测试时,Vitest 的多个项目会按 worker 配额并行运行,Playwright 默认也会启动 4 个 worker,容易占用本机资源。CI 的并行分片用于缩短远程反馈时间,应继续保留。
本次改动
fast、scripts、ui、isolated项目均限制为 1 个 worker,并按groupOrder0/1/2/3 顺序执行。CI=true时保留现有 Vitest worker 配额和项目分组:75%/75%/50%/50%,分组顺序 0/0/1/1。实现考虑
Vitest 文档实现确认同一
groupOrder的项目会同时运行,不同顺序会串行运行。因此仅将maxWorkers改为 1 仍会让同组项目同时打开 worker;本地同时使用唯一的 group order 才能满足单 worker 资源约束。已知限制
本地未运行完整 Vitest、覆盖率或 E2E 套件,以避免按请求进行高资源消耗的本地并发/性能验证;完整远程验证由现有 CI workflow 执行。
建议审查重点
CI环境时四个 Vitest 项目的最终配置是否为单 worker 且 group order 唯一。CI=true时原有 worker 配额、项目分组及.github/workflows/test.yaml的 Vitest/E2E 分片均保持不变。验证
基于
d6cc48ba99f8a8ac7d4ad236f2d294fad99e0c79,当前 head 为faba7d843f5a067c7f1a2d34194a90ee8c787ff7;最终 diff 仅包含vitest.config.ts与playwright.config.ts。pnpm exec tsc --noEmit --pretty false— 通过。pnpm exec prettier --check vitest.config.ts playwright.config.ts— 通过。pnpm exec eslint vitest.config.ts playwright.config.ts— 通过。1/1/1/1worker、group order0/1/2/3;Playwright1worker。75%/75%/50%/50%、group order0/0/1/1;Playwright2workers。