# 未找到测试结果。检查您的测试报告配置。测试结果路径 'test-results/*.xml' 未匹配任何文件。

- **ID:** `cicd/circleci-no-test-results-found`
- **领域:** cicd
- **类别:** test_error
- **错误码:** `CIRCLECI_NO_TEST_RESULTS`
- **验证级别:** ai_generated
- **修复率:** 88%

## 根因

CircleCI 找不到测试结果文件，因为 `store_test_results` 步骤中的通配符模式与实际输出位置不匹配，或者测试运行器未生成预期的 XML 文件。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| CircleCI CLI 0.1.x | active | — | — |
| CircleCI Server 4.x | active | — | — |
| CircleCI hosted runners (medium, large) | active | — | — |

## 解决方案

1. ```
   Explicitly create the test results directory and run tests with output redirected: `mkdir -p test-results && npm test -- --reporter junit --reporter-options output=test-results/junit.xml` and then use `path: test-results/` in store_test_results.
   ```
2. ```
   Use CircleCI's `collect_test_results` orb: `- orb: circleci/node@5.0.0` and configure `run: command: npm test` then `store_test_results: path: test-results` after ensuring the test framework outputs to that path.
   ```

## 无效尝试

- **** — Changing the glob pattern to `**/*.xml` without verifying the actual output directory structure often still fails because the test runner outputs files to a different relative path than expected. (60% 失败率)
- **** — Adding `ls -la test-results` before the store step may show files but the store step still fails if the files are generated inside a Docker container and not mounted to the workspace. (75% 失败率)
