[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6MG1P96TMBKDRPPNFA1GYRY":3,"skill-same:01M6MG1P96TMBKDRPPNFA1GYRY":55},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":26,"linkOnly":27,"markdownContent":28,"markdownBody":29,"frontMatter":30,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":36,"ownerHtmlUrl":37,"ownerBlogUrl":38,"ownerDescription":39,"updatedAt":40,"install":41,"resources":54},"01M6MG1P96TMBKDRPPNFA1GYRY","test-execution",null,"hashgraph-online\u002Fawesome-codex-plugins","hashgraph-online","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160371962?v=4","01M6CNB6NRJVNNGN14TR01Q6D3","HOL (Hashgraph Online)","01M6JT1HSKKG9V68KQAQGBA7XP",1575,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FechoVic\u002Fboss-skill\u002Fskill\u002Fskills\u002Fqa\u002Ftest-execution\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[23,24,25],"test","execution","test execution","2026-11-10 10:12:30",false,"---\n\nname: qa\u002Ftest-execution\ndescription: 测试执行方法，包含测试框架检测、覆盖率门禁、多框架结果解析、失败分级、增量测试选择、并行执行策略\nversion: 2.0.0\nagent: qa\ntype: methodology\nuser-invocable: false\nagent-invocable: true\ndependencies:\n- shared\u002Ftech-stack-detection\n  triggers:\n- 需要执行测试时\n- 需要验证测试覆盖率时\n- 需要解析测试结果时\n  metadata:\n  internal: true\n\n---\n\n# 测试执行方法\n\n## 强制要求：真实执行测试\n\n**你必须真正执行测试，禁止生成 Mock 数据！**\n\n## 测试执行流程\n\n1. **检测项目类型和测试框架**\n2. **执行单元测试**（含覆盖率）\n3. **执行集成测试**\n4. **执行接口测试**\n5. **执行 E2E 测试**\n6. **解析测试输出**（总数、通过数、失败数、覆盖率）\n7. **失败分级与处理**\n\n## 测试框架检测\n\n### JavaScript\u002FTypeScript\n\n| 框架       | 检测标志                                | 配置文件                            |\n| ---------- | --------------------------------------- | ----------------------------------- |\n| Jest       | `\"jest\"` in devDependencies             | `jest.config.js` \u002F `jest.config.ts` |\n| Vitest     | `\"vitest\"` in devDependencies           | `vitest.config.ts`                  |\n| Playwright | `\"@playwright\u002Ftest\"` in devDependencies | `playwright.config.ts`              |\n| Cypress    | `\"cypress\"` in devDependencies          | `cypress.config.ts`                 |\n\n### Python\n\n| 框架     | 检测标志                   | 配置文件                        |\n| -------- | -------------------------- | ------------------------------- |\n| pytest   | `\"pytest\"` in dependencies | `pytest.ini` \u002F `pyproject.toml` |\n| unittest | 内置                       | -                               |\n\n### Go\n\n- `*_test.go` 文件存在 → 使用 `go test`\n- 集成测试通常用 build tag 隔离：`\u002F\u002Fgo:build integration`\n\n### Java\n\n| 框架    | 检测标志                     |\n| ------- | ---------------------------- |\n| JUnit 5 | `pom.xml` 含 `junit-jupiter` |\n| TestNG  | `pom.xml` 含 `testng`        |\n\n## 测试命令矩阵\n\n| 语言    | 单元测试                      | 集成测试                           | 接口测试                   | E2E 测试              |\n| ------- | ----------------------------- | ---------------------------------- | -------------------------- | --------------------- |\n| Node.js | `npx vitest run` \u002F `npx jest` | `npx vitest run tests\u002Fintegration` | `npx vitest run tests\u002Fapi` | `npx playwright test` |\n| Python  | `pytest tests\u002Funit`           | `pytest tests\u002Fintegration`         | `pytest tests\u002Fapi`         | `pytest tests\u002Fe2e`    |\n| Go      | `go test .\u002Finternal\u002F...`      | `go test -tags=integration .\u002F...`  | `go test .\u002Ftests\u002Fapi\u002F...`  | -                     |\n| Java    | `mvn test`                    | `mvn verify`                       | `mvn verify -Papi-test`    | -                     |\n\n> 接口测试方法论见 `Skill(skill: \"qa\u002Fapi-testing\")`，集成测试方法论见 `Skill(skill: \"qa\u002Fintegration-testing\")`。\n\n## 覆盖率度量与门禁\n\n### 覆盖率采集\n\n```bash\n# Vitest\nnpx vitest run --coverage --reporter=json\n# 输出 coverage\u002Fcoverage-summary.json\n\n# Jest\nnpx jest --coverage --coverageReporters=json-summary\n# 输出 coverage\u002Fcoverage-summary.json\n\n# Python (pytest-cov)\npytest --cov=src --cov-report=json\n# 输出 coverage.json\n\n# Go\ngo test -coverprofile=coverage.out .\u002F...\ngo tool cover -func=coverage.out\n```\n\n### 覆盖率报告解析\n\n`coverage-summary.json` 结构：\n\n```json\n{\n  \"total\": {\n    \"lines\": { \"total\": 100, \"covered\": 85, \"pct\": 85 },\n    \"statements\": { \"total\": 120, \"covered\": 100, \"pct\": 83.3 },\n    \"functions\": { \"total\": 40, \"covered\": 36, \"pct\": 90 },\n    \"branches\": { \"total\": 30, \"covered\": 22, \"pct\": 73.3 }\n  }\n}\n```\n\n### 覆盖率门禁\n\n| 指标           | 门槛  | 未达标处理                         |\n| -------------- | ----- | ---------------------------------- |\n| 行覆盖率       | ≥ 80% | 列出未覆盖行，报 `REVISION_NEEDED` |\n| 语句覆盖率     | ≥ 80% | 同上                               |\n| 函数覆盖率     | ≥ 80% | 同上                               |\n| 分支覆盖率     | ≥ 75% | 列出未覆盖分支                     |\n| 变更文件覆盖率 | ≥ 80% | 重点检查本次变更文件               |\n\n**覆盖率检查脚本**（Node.js）：\n\n```bash\n# 检查覆盖率是否达标\nnode -e \"\nconst cov = require('.\u002Fcoverage\u002Fcoverage-summary.json').total;\nconst thresholds = { lines: 80, statements: 80, functions: 80, branches: 75 };\nlet failed = false;\nfor (const [key, min] of Object.entries(thresholds)) {\n  const pct = cov[key].pct;\n  if (pct \u003C min) {\n    console.log(\\`❌ \\${key}: \\${pct}% \u003C \\${min}%\\`);\n    failed = true;\n  } else {\n    console.log(\\`✅ \\${key}: \\${pct}%\\`);\n  }\n}\nprocess.exit(failed ? 1 : 0);\n\"\n```\n\n## 测试结果解析\n\n### Jest \u002F Vitest JSON 输出\n\n```bash\nnpx jest --json --outputFile=test-results.json\n# 或\nnpx vitest run --reporter=json --outputFile=test-results.json\n```\n\n解析关键字段：\n\n```json\n{\n  \"numTotalTests\": 50,\n  \"numPassedTests\": 48,\n  \"numFailedTests\": 2,\n  \"numPendingTests\": 0,\n  \"success\": false,\n  \"testResults\": [\n    {\n      \"name\": \"tests\u002Fapi\u002Fusers.test.ts\",\n      \"status\": \"failed\",\n      \"assertionResults\": [\n        {\n          \"title\": \"creates user with valid data\",\n          \"status\": \"passed\",\n          \"duration\": 15\n        },\n        {\n          \"title\": \"rejects empty name with 400\",\n          \"status\": \"failed\",\n          \"failureMessages\": [\"Expected 400, received 201\"]\n        }\n      ]\n    }\n  ]\n}\n```\n\n### pytest JSON 输出\n\n```bash\npytest tests\u002F -v --json-report --json-report-file=test-results.json\n```\n\n解析：\n```json\n{\n  \"summary\": {\n    \"total\": 30,\n    \"passed\": 28,\n    \"failed\": 2,\n    \"skipped\": 0,\n    \"duration\": 2.5\n  }\n}\n```\n\n### Go test 输出\n\n```bash\ngo test .\u002F... -json > test-results.json\n```\n\n解析（每行一个 JSON）：\n```bash\n# 统计通过\u002F失败\ngo test .\u002F... -v 2>&1 | grep -E \"^(=== RUN|--- (PASS|FAIL|SKIP))\" | \\\n  awk '\u002FPASS\u002F{p++} \u002FFAIL\u002F{f++} \u002FSKIP\u002F{s++} END{print \"passed:\"p\" failed:\"f\" skipped:\"s}'\n```\n\n### Playwright JSON 输出\n\n| 字段               | 说明               |\n| ------------------ | ------------------ |\n| `stats.expected`   | 通过的测试数       |\n| `stats.unexpected` | 失败的测试数       |\n| `stats.flaky`      | 重试后通过的测试数 |\n| `stats.skipped`    | 跳过的测试数       |\n\n## 失败分级与处理\n\n### 失败分级\n\n| 级别         | 判定标准                           | 处理方式           |\n| ------------ | ---------------------------------- | ------------------ |\n| **Blocker**  | 核心功能不可用、数据丢失、安全漏洞 | 立即修复，阻止发布 |\n| **Critical** | 主要功能异常、数据不一致           | 必须修复，阻塞发布 |\n| **Major**    | 次要功能异常、有 workaround        | 修复后发布         |\n| **Minor**    | UI 展示问题、文案错误              | 可带 issue 发布    |\n\n### 失败处理流程\n\n```\n测试失败\n  │\n  ├─ 是环境问题吗？（DB 连接、端口占用、依赖未启动）\n  │   └─ 是 → 修复环境，重跑\n  │\n  ├─ 是测试本身问题吗？（断言错误、测试数据过期、时序问题）\n  │   └─ 是 → 修复测试，重跑\n  │\n  ├─ 是产品代码 bug 吗？\n  │   └─ 是 → 报 REVISION_NEEDED，交给开发修复\n  │\n  └─ 是 flaky 吗？（间歇性失败）\n      └─ 是 → 重试 1 次，仍失败则标记 flaky 并排查根因\n```\n\n### 禁止行为\n\n- ❌ 禁止为通过测试而修改断言或删除用例\n- ❌ 禁止用 `.skip` \u002F `xit` 跳过失败测试\n- ❌ 禁止将失败测试标记为\"预期失败\"而不修复\n- ❌ 禁止在报告中隐瞒失败\n\n## 增量测试选择\n\n为了加速反馈，只运行受变更影响的测试：\n\n### 基于变更文件的测试选择\n\n```bash\n# 获取变更的源文件\ngit diff --name-only main...HEAD -- 'src\u002F**\u002F*.ts'\n\n# Vitest: 只运行受影响的测试（需配置 coverage analysis）\nnpx vitest run --changed\n\n# Jest: 只运行变更相关测试\nnpx jest --changedSince=main\n```\n\n### 测试目录约定\n\n```\ntests\u002F\n├── unit\u002F           # 单元测试，快速，CI 必跑\n├── integration\u002F    # 集成测试，较慢，CI 必跑\n├── api\u002F            # 接口测试，CI 必跑\n└── e2e\u002F            # E2E 测试，最慢，PR 必跑\n```\n\n### 按标签选择性执行\n\n```typescript\n\u002F\u002F Vitest\nimport { describe, it } from 'vitest';\n\ndescribe('@critical 用户认证', () => {\n  it('@smoke 登录成功', async () => {\n    \u002F* ... *\u002F\n  });\n  it('登录失败', async () => {\n    \u002F* ... *\u002F\n  });\n});\n```\n\n```bash\n# 只跑 critical 标签\nnpx vitest run -t @critical\n\n# Playwright\nnpx playwright test --grep @critical\n```\n\n## 并行执行策略\n\n### Jest \u002F Vitest 并行\n\n```typescript\n\u002F\u002F vitest.config.ts\nexport default defineConfig({\n  test: {\n    \u002F\u002F 文件间并行（默认）\n    \u002F\u002F 文件内串行（避免共享状态冲突）\n    pool: 'forks',\n    poolOptions: {\n      forks: {\n        singleFork: false, \u002F\u002F 每个文件一个 fork\n      },\n    },\n  },\n});\n```\n\n### 集成测试串行执行\n\n集成测试通常操作数据库，需要串行避免冲突：\n\n```bash\n# Jest: 串行执行集成测试\nnpx jest tests\u002Fintegration --runInBand\n\n# Vitest: 串行\nnpx vitest run tests\u002Fintegration --pool=forks --poolOptions.forks.singleFork=true\n```\n\n### Go 并行控制\n\n```bash\n# 默认并行（CPU 核数）\ngo test .\u002F...\n\n# 限制并行数\ngo test -p 2 .\u002F...\n\n# 串行\ngo test -p 1 .\u002F...\n```\n\n### pytest 并行\n\n```bash\n# 使用 pytest-xdist 并行\npytest -n auto          # 自动检测 CPU 核数\npytest -n 4             # 4 个 worker\npytest tests\u002Fintegration -n 0  # 串行\n```\n\n## 接口测试执行\n\n接口测试通常使用 Supertest（Node.js）或 requests（Python）直接调用应用，无需启动独立服务器。\n\n```bash\n# Node.js (Jest + Supertest)\nnpx jest tests\u002Fapi --runInBand\n\n# Python (pytest + requests)\npytest tests\u002Fapi -v\n\n# 输出覆盖率\nnpx jest tests\u002Fapi --coverage\n```\n\n## 集成测试执行\n\n集成测试需要数据库等依赖，使用 Testcontainers 或测试数据库：\n\n```bash\n# Node.js (需要 Docker 运行 Testcontainers)\nnpx jest tests\u002Fintegration --runInBand\n\n# Python\npytest tests\u002Fintegration -v\n\n# Go\ngo test .\u002Ftests\u002Fintegration\u002F... -v\n```\n\n> 集成测试通常 `--runInBand` 串行执行，避免数据库并发冲突。\n\n## Playwright E2E 执行细节\n\n> **完整方法论**：详见 `Skill(skill: \"qa\u002Fe2e-playwright\")`\n\n### 执行命令\n\n```bash\n# 安装浏览器（首次或 CI 环境）\nnpx playwright install --with-deps\n\n# 运行全部 E2E 测试\nnpx playwright test\n\n# 仅 critical 标签（门禁加速）\nnpx playwright test --grep @critical\n\n# 指定浏览器\nnpx playwright test --project=chromium\n\n# JSON 报告（门禁解析用）\nnpx playwright test --reporter=json\n```\n\n### 失败排查\n\n```bash\n# 查看 trace（失败时自动生成）\nnpx playwright show-trace \u003Ctrace.zip路径>\n\n# 打开 HTML 报告\nnpx playwright show-report\n```\n\n## 测试执行检查清单\n\n- [ ] 已检测项目使用的测试框架\n- [ ] 单元测试已执行并通过\n- [ ] 集成测试已执行并通过\n- [ ] 接口测试已执行并通过\n- [ ] E2E 测试已执行并通过\n- [ ] 覆盖率已采集并达标（≥ 80%）\n- [ ] 所有失败用例已分类和处理\n- [ ] 测试结果有完整记录（命令、退出码、通过\u002F失败数、失败详情）\n- [ ] 无 flaky 测试未处理\n","# 测试执行方法\n\n## 强制要求：真实执行测试\n\n**你必须真正执行测试，禁止生成 Mock 数据！**\n\n## 测试执行流程\n\n1. **检测项目类型和测试框架**\n2. **执行单元测试**（含覆盖率）\n3. **执行集成测试**\n4. **执行接口测试**\n5. **执行 E2E 测试**\n6. **解析测试输出**（总数、通过数、失败数、覆盖率）\n7. **失败分级与处理**\n\n## 测试框架检测\n\n### JavaScript\u002FTypeScript\n\n| 框架       | 检测标志                                | 配置文件                            |\n| ---------- | --------------------------------------- | ----------------------------------- |\n| Jest       | `\"jest\"` in devDependencies             | `jest.config.js` \u002F `jest.config.ts` |\n| Vitest     | `\"vitest\"` in devDependencies           | `vitest.config.ts`                  |\n| Playwright | `\"@playwright\u002Ftest\"` in devDependencies | `playwright.config.ts`              |\n| Cypress    | `\"cypress\"` in devDependencies          | `cypress.config.ts`                 |\n\n### Python\n\n| 框架     | 检测标志                   | 配置文件                        |\n| -------- | -------------------------- | ------------------------------- |\n| pytest   | `\"pytest\"` in dependencies | `pytest.ini` \u002F `pyproject.toml` |\n| unittest | 内置                       | -                               |\n\n### Go\n\n- `*_test.go` 文件存在 → 使用 `go test`\n- 集成测试通常用 build tag 隔离：`\u002F\u002Fgo:build integration`\n\n### Java\n\n| 框架    | 检测标志                     |\n| ------- | ---------------------------- |\n| JUnit 5 | `pom.xml` 含 `junit-jupiter` |\n| TestNG  | `pom.xml` 含 `testng`        |\n\n## 测试命令矩阵\n\n| 语言    | 单元测试                      | 集成测试                           | 接口测试                   | E2E 测试              |\n| ------- | ----------------------------- | ---------------------------------- | -------------------------- | --------------------- |\n| Node.js | `npx vitest run` \u002F `npx jest` | `npx vitest run tests\u002Fintegration` | `npx vitest run tests\u002Fapi` | `npx playwright test` |\n| Python  | `pytest tests\u002Funit`           | `pytest tests\u002Fintegration`         | `pytest tests\u002Fapi`         | `pytest tests\u002Fe2e`    |\n| Go      | `go test .\u002Finternal\u002F...`      | `go test -tags=integration .\u002F...`  | `go test .\u002Ftests\u002Fapi\u002F...`  | -                     |\n| Java    | `mvn test`                    | `mvn verify`                       | `mvn verify -Papi-test`    | -                     |\n\n> 接口测试方法论见 `Skill(skill: \"qa\u002Fapi-testing\")`，集成测试方法论见 `Skill(skill: \"qa\u002Fintegration-testing\")`。\n\n## 覆盖率度量与门禁\n\n### 覆盖率采集\n\n```bash\n# Vitest\nnpx vitest run --coverage --reporter=json\n# 输出 coverage\u002Fcoverage-summary.json\n\n# Jest\nnpx jest --coverage --coverageReporters=json-summary\n# 输出 coverage\u002Fcoverage-summary.json\n\n# Python (pytest-cov)\npytest --cov=src --cov-report=json\n# 输出 coverage.json\n\n# Go\ngo test -coverprofile=coverage.out .\u002F...\ngo tool cover -func=coverage.out\n```\n\n### 覆盖率报告解析\n\n`coverage-summary.json` 结构：\n\n```json\n{\n  \"total\": {\n    \"lines\": { \"total\": 100, \"covered\": 85, \"pct\": 85 },\n    \"statements\": { \"total\": 120, \"covered\": 100, \"pct\": 83.3 },\n    \"functions\": { \"total\": 40, \"covered\": 36, \"pct\": 90 },\n    \"branches\": { \"total\": 30, \"covered\": 22, \"pct\": 73.3 }\n  }\n}\n```\n\n### 覆盖率门禁\n\n| 指标           | 门槛  | 未达标处理                         |\n| -------------- | ----- | ---------------------------------- |\n| 行覆盖率       | ≥ 80% | 列出未覆盖行，报 `REVISION_NEEDED` |\n| 语句覆盖率     | ≥ 80% | 同上                               |\n| 函数覆盖率     | ≥ 80% | 同上                               |\n| 分支覆盖率     | ≥ 75% | 列出未覆盖分支                     |\n| 变更文件覆盖率 | ≥ 80% | 重点检查本次变更文件               |\n\n**覆盖率检查脚本**（Node.js）：\n\n```bash\n# 检查覆盖率是否达标\nnode -e \"\nconst cov = require('.\u002Fcoverage\u002Fcoverage-summary.json').total;\nconst thresholds = { lines: 80, statements: 80, functions: 80, branches: 75 };\nlet failed = false;\nfor (const [key, min] of Object.entries(thresholds)) {\n  const pct = cov[key].pct;\n  if (pct \u003C min) {\n    console.log(\\`❌ \\${key}: \\${pct}% \u003C \\${min}%\\`);\n    failed = true;\n  } else {\n    console.log(\\`✅ \\${key}: \\${pct}%\\`);\n  }\n}\nprocess.exit(failed ? 1 : 0);\n\"\n```\n\n## 测试结果解析\n\n### Jest \u002F Vitest JSON 输出\n\n```bash\nnpx jest --json --outputFile=test-results.json\n# 或\nnpx vitest run --reporter=json --outputFile=test-results.json\n```\n\n解析关键字段：\n\n```json\n{\n  \"numTotalTests\": 50,\n  \"numPassedTests\": 48,\n  \"numFailedTests\": 2,\n  \"numPendingTests\": 0,\n  \"success\": false,\n  \"testResults\": [\n    {\n      \"name\": \"tests\u002Fapi\u002Fusers.test.ts\",\n      \"status\": \"failed\",\n      \"assertionResults\": [\n        {\n          \"title\": \"creates user with valid data\",\n          \"status\": \"passed\",\n          \"duration\": 15\n        },\n        {\n          \"title\": \"rejects empty name with 400\",\n          \"status\": \"failed\",\n          \"failureMessages\": [\"Expected 400, received 201\"]\n        }\n      ]\n    }\n  ]\n}\n```\n\n### pytest JSON 输出\n\n```bash\npytest tests\u002F -v --json-report --json-report-file=test-results.json\n```\n\n解析：\n```json\n{\n  \"summary\": {\n    \"total\": 30,\n    \"passed\": 28,\n    \"failed\": 2,\n    \"skipped\": 0,\n    \"duration\": 2.5\n  }\n}\n```\n\n### Go test 输出\n\n```bash\ngo test .\u002F... -json > test-results.json\n```\n\n解析（每行一个 JSON）：\n```bash\n# 统计通过\u002F失败\ngo test .\u002F... -v 2>&1 | grep -E \"^(=== RUN|--- (PASS|FAIL|SKIP))\" | \\\n  awk '\u002FPASS\u002F{p++} \u002FFAIL\u002F{f++} \u002FSKIP\u002F{s++} END{print \"passed:\"p\" failed:\"f\" skipped:\"s}'\n```\n\n### Playwright JSON 输出\n\n| 字段               | 说明               |\n| ------------------ | ------------------ |\n| `stats.expected`   | 通过的测试数       |\n| `stats.unexpected` | 失败的测试数       |\n| `stats.flaky`      | 重试后通过的测试数 |\n| `stats.skipped`    | 跳过的测试数       |\n\n## 失败分级与处理\n\n### 失败分级\n\n| 级别         | 判定标准                           | 处理方式           |\n| ------------ | ---------------------------------- | ------------------ |\n| **Blocker**  | 核心功能不可用、数据丢失、安全漏洞 | 立即修复，阻止发布 |\n| **Critical** | 主要功能异常、数据不一致           | 必须修复，阻塞发布 |\n| **Major**    | 次要功能异常、有 workaround        | 修复后发布         |\n| **Minor**    | UI 展示问题、文案错误              | 可带 issue 发布    |\n\n### 失败处理流程\n\n```\n测试失败\n  │\n  ├─ 是环境问题吗？（DB 连接、端口占用、依赖未启动）\n  │   └─ 是 → 修复环境，重跑\n  │\n  ├─ 是测试本身问题吗？（断言错误、测试数据过期、时序问题）\n  │   └─ 是 → 修复测试，重跑\n  │\n  ├─ 是产品代码 bug 吗？\n  │   └─ 是 → 报 REVISION_NEEDED，交给开发修复\n  │\n  └─ 是 flaky 吗？（间歇性失败）\n      └─ 是 → 重试 1 次，仍失败则标记 flaky 并排查根因\n```\n\n### 禁止行为\n\n- ❌ 禁止为通过测试而修改断言或删除用例\n- ❌ 禁止用 `.skip` \u002F `xit` 跳过失败测试\n- ❌ 禁止将失败测试标记为\"预期失败\"而不修复\n- ❌ 禁止在报告中隐瞒失败\n\n## 增量测试选择\n\n为了加速反馈，只运行受变更影响的测试：\n\n### 基于变更文件的测试选择\n\n```bash\n# 获取变更的源文件\ngit diff --name-only main...HEAD -- 'src\u002F**\u002F*.ts'\n\n# Vitest: 只运行受影响的测试（需配置 coverage analysis）\nnpx vitest run --changed\n\n# Jest: 只运行变更相关测试\nnpx jest --changedSince=main\n```\n\n### 测试目录约定\n\n```\ntests\u002F\n├── unit\u002F           # 单元测试，快速，CI 必跑\n├── integration\u002F    # 集成测试，较慢，CI 必跑\n├── api\u002F            # 接口测试，CI 必跑\n└── e2e\u002F            # E2E 测试，最慢，PR 必跑\n```\n\n### 按标签选择性执行\n\n```typescript\n\u002F\u002F Vitest\nimport { describe, it } from 'vitest';\n\ndescribe('@critical 用户认证', () => {\n  it('@smoke 登录成功', async () => {\n    \u002F* ... *\u002F\n  });\n  it('登录失败', async () => {\n    \u002F* ... *\u002F\n  });\n});\n```\n\n```bash\n# 只跑 critical 标签\nnpx vitest run -t @critical\n\n# Playwright\nnpx playwright test --grep @critical\n```\n\n## 并行执行策略\n\n### Jest \u002F Vitest 并行\n\n```typescript\n\u002F\u002F vitest.config.ts\nexport default defineConfig({\n  test: {\n    \u002F\u002F 文件间并行（默认）\n    \u002F\u002F 文件内串行（避免共享状态冲突）\n    pool: 'forks',\n    poolOptions: {\n      forks: {\n        singleFork: false, \u002F\u002F 每个文件一个 fork\n      },\n    },\n  },\n});\n```\n\n### 集成测试串行执行\n\n集成测试通常操作数据库，需要串行避免冲突：\n\n```bash\n# Jest: 串行执行集成测试\nnpx jest tests\u002Fintegration --runInBand\n\n# Vitest: 串行\nnpx vitest run tests\u002Fintegration --pool=forks --poolOptions.forks.singleFork=true\n```\n\n### Go 并行控制\n\n```bash\n# 默认并行（CPU 核数）\ngo test .\u002F...\n\n# 限制并行数\ngo test -p 2 .\u002F...\n\n# 串行\ngo test -p 1 .\u002F...\n```\n\n### pytest 并行\n\n```bash\n# 使用 pytest-xdist 并行\npytest -n auto          # 自动检测 CPU 核数\npytest -n 4             # 4 个 worker\npytest tests\u002Fintegration -n 0  # 串行\n```\n\n## 接口测试执行\n\n接口测试通常使用 Supertest（Node.js）或 requests（Python）直接调用应用，无需启动独立服务器。\n\n```bash\n# Node.js (Jest + Supertest)\nnpx jest tests\u002Fapi --runInBand\n\n# Python (pytest + requests)\npytest tests\u002Fapi -v\n\n# 输出覆盖率\nnpx jest tests\u002Fapi --coverage\n```\n\n## 集成测试执行\n\n集成测试需要数据库等依赖，使用 Testcontainers 或测试数据库：\n\n```bash\n# Node.js (需要 Docker 运行 Testcontainers)\nnpx jest tests\u002Fintegration --runInBand\n\n# Python\npytest tests\u002Fintegration -v\n\n# Go\ngo test .\u002Ftests\u002Fintegration\u002F... -v\n```\n\n> 集成测试通常 `--runInBand` 串行执行，避免数据库并发冲突。\n\n## Playwright E2E 执行细节\n\n> **完整方法论**：详见 `Skill(skill: \"qa\u002Fe2e-playwright\")`\n\n### 执行命令\n\n```bash\n# 安装浏览器（首次或 CI 环境）\nnpx playwright install --with-deps\n\n# 运行全部 E2E 测试\nnpx playwright test\n\n# 仅 critical 标签（门禁加速）\nnpx playwright test --grep @critical\n\n# 指定浏览器\nnpx playwright test --project=chromium\n\n# JSON 报告（门禁解析用）\nnpx playwright test --reporter=json\n```\n\n### 失败排查\n\n```bash\n# 查看 trace（失败时自动生成）\nnpx playwright show-trace \u003Ctrace.zip路径>\n\n# 打开 HTML 报告\nnpx playwright show-report\n```\n\n## 测试执行检查清单\n\n- [ ] 已检测项目使用的测试框架\n- [ ] 单元测试已执行并通过\n- [ ] 集成测试已执行并通过\n- [ ] 接口测试已执行并通过\n- [ ] E2E 测试已执行并通过\n- [ ] 覆盖率已采集并达标（≥ 80%）\n- [ ] 所有失败用例已分类和处理\n- [ ] 测试结果有完整记录（命令、退出码、通过\u002F失败数、失败详情）\n- [ ] 无 flaky 测试未处理\n",{},"main","2b63f856ce19c2a797929cacabd9e0fc936812fa","plugins\u002FechoVic\u002Fboss-skill\u002Fskill\u002Fskills\u002Fqa\u002Ftest-execution",491,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins","https:\u002F\u002Fhol.org\u002Fplugins\u002Fbest-codex-plugins","https:\u002F\u002Fgithub.com\u002Fhashgraph-online","https:\u002F\u002Fhol.org","Open-source standards and developer tools for interoperable AI agents: discovery, identity, communication, payments, privacy and security.","2026-11-14 14:06:13",{"source":7,"skillName":5,"commands":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add hashgraph-online\u002Fawesome-codex-plugins --skill test-execution",{"tool":47,"command":48},"bunx","bunx skills add hashgraph-online\u002Fawesome-codex-plugins --skill test-execution",{"tool":50,"command":51},"pnpm","pnpm dlx skills add hashgraph-online\u002Fawesome-codex-plugins --skill test-execution","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FechoVic\u002Fboss-skill\u002Fskill\u002Fskills\u002Fqa\u002Ftest-execution\u002FSKILL.md",true,[],[56,66,74,82,90,98],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":61,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":65},"01M7DV332YQMGD8WTRJ9DZQXTB","worktable-review-with-annotations","Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.","MIT","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":70,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":65},"01M7DV2YGHCZVBEB1AHYB6CGHE","worktable-find-and-synthesize-context","Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":78,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":65},"01M7DV2TQN1H11ME2SAF9MXN7V","worktable-create-or-update-docs","Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":86,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":65},"01M7DV2NE452NEA8TXATKSNAJH","worktable-create-or-manage-records","Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":94,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":65},"01M7DV2HENRBR2KSCVM064WH0Y","worktable-create-or-manage-interactive-html","Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":102,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":65},"01M7DV2CADR5R7RQFFYPNAGR9Y","worktable-collaborate-threads","Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FSKILL.md",[],[]]