Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ test-threads = 4
failure-output = "final"
status-level = "fail"

[profile.ci.junit]
# JUnit XML 輸出設定 - CI 環境專用
path = "junit.xml"
store-success-output = true
store-failure-output = true

[profile.quick]
# 快速測試設定
retries = 0
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/build-test-audit-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ jobs:
env:
RUST_LOG: debug

# Upload test results to Codecov
- name: Upload test results to Codecov
if: ${{ always() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/nextest/ci/junit.xml
flags: ${{ matrix.os }}

security:
name: Security Audit
runs-on: ubuntu-latest
Expand Down Expand Up @@ -116,3 +125,12 @@ jobs:
with:
files: lcov.info
fail_ci_if_error: false

# Upload test results to Codecov
- name: Upload test results to Codecov
if: ${{ always() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/nextest/ci/junit.xml
flags: coverage
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ Thumbs.db
# Environment variables
.env
*.log

# JUnit XML test results
junit.xml
target/nextest/*/junit.xml
20 changes: 20 additions & 0 deletions docs/testing-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,26 @@ fn test_with_performance_monitoring() {
}
```

## JUnit XML Test Results

### Configuration
The project uses nextest to generate JUnit XML format test results, primarily for CI environments:

```bash
# CI profile automatically generates JUnit XML
cargo nextest run --profile ci
```

### Output Location
- JUnit XML file: `target/nextest/ci/junit.xml`
- Contains detailed output and stack traces for all tests (successful and failed)

### Codecov Test Analysis
Test results are automatically uploaded to Codecov, providing:
- Test execution time analysis
- Failure rate statistics
- Flaky test identification

## Conclusion

Following these guidelines ensures that SubX maintains high code quality, safety, and testability. The dependency injection architecture enables comprehensive testing without sacrificing safety or performance.
Expand Down