Skip to main content

Upload Test Results

Uploading test results to Harness enables flaky test detection, test history tracking, and visibility in the Tests tab. This is the foundation for all test management features.

Supported Formats

FormatLanguages
JUnit XMLJava, Python, Go, Node.js, and most languages

Pipeline Examples

- run:
script: |-
# Install dependencies
pip install pytest

# Run tests with JUnit output
pytest tests/ --junitxml=test-results.xml -v

# Upload to Harness
hcli test-reports upload test-results.xml
env:
CI_ENABLE_QUARANTINED_TEST_SKIP: "true"

View Results

After the stage uploading tests completes:

  1. Open the pipeline execution
  2. Click the Tests tab

You'll see:

ColumnDescription
Test NameFully qualified test name
StatusPass, Fail, or Skip
DurationHow long the test took
FLAKY badgeAppears if the test has inconsistent results

Use Filter → Flaky to show only flaky tests.

Command Reference

hcli test-reports upload <file-or-glob>
ParameterExampleDescription
File pathtest-results.xmlSingle file
Glob pattern"**/test-results/*.xml"Multiple files (use quotes)

Troubleshooting

IssueSolution
Tests not appearingVerify the file path is correct and the XML format is valid
Glob not matchingUse quotes around patterns: "build/**/*.xml"
Upload fails silentlyAdd --verbose flag to see detailed output

Next Steps

Once test results are uploading: