| description | Reference for the qlt test run validate-unit-tests command |
|---|
Use this prompt to guide the execution of qlt test run validate-unit-tests to validate unit test results in a CI/CD-suitable format.
qlt test run validate-unit-tests [options]Validates unit test run results in a fashion suitable for use in CI/CD systems. Processes intermediate execution output files and provides formatted results with appropriate exit codes for automation workflows.
--results-directory <results-directory>- Required Directory containing intermediate execution output files
--pretty-print- Required Pretty print test output in compact format (default: False)- Note: When enabled, does not exit with failure code if tests fail
--base <base>- Base path to find the query repository (default: current directory)--automation-type <actions>- Automation type configuration (required, default: actions)
--development- Enable development mode with special QLT features (required, default: False)--use-bundle- Use custom CodeQL bundle instead of distribution versions (required, default: False)
- Reads intermediate execution files from results directory
- Parses test outcomes and execution metadata
- Aggregates results across all executed tests
- Formats output for consumption by CI/CD systems
- Standard mode: Exit code 1 if any tests failed, 0 if all passed
- Pretty-print mode: Always exit code 0 (for display purposes only)
qlt test run validate-unit-tests \
--results-directory=/tmp/test-results \
--pretty-print=false \
--automation-type=actions \
--development=false \
--use-bundle=falseqlt test run validate-unit-tests \
--results-directory=/tmp/test-results \
--pretty-print=true \
--automation-type=actions \
--development=false \
--use-bundle=falseqlt test run validate-unit-tests \
--results-directory=/path/to/custom/results \
--pretty-print=false \
--automation-type=actions \
--development=false \
--use-bundle=falseqlt test run validate-unit-tests \
--results-directory=/tmp/test-results \
--pretty-print=false \
--automation-type=actions \
--development=true \
--use-bundle=falseresults-directory/
├── test-results/
│ ├── <language>/
│ │ ├── execution-log.txt
│ │ ├── test-summary.json
│ │ └── individual-results/
│ │ ├── query1-results.json
│ │ ├── query2-results.json
│ │ └── ...
│ └── metadata/
│ ├── execution-metadata.json
│ └── timing-information.json
└── other-output-files...
Test Validation Summary:
========================
Total Tests: 25
Passed: 23
Failed: 2
Execution Time: 45.2 seconds
Failed Tests:
- languages/java/custom/security/sql-injection: Expected 3 results, got 2
- languages/python/custom/quality/unused-import: Compilation failed
Exit Code: 1
╔══════════════════════════════════════════════════════════════╗
║ Test Validation Results ║
╠══════════════════════════════════════════════════════════════╣
║ Total Tests: 25 ║
║ ✅ Passed: 23 ║
║ ❌ Failed: 2 ║
║ ⏱️ Execution Time: 45.2 seconds ║
╠══════════════════════════════════════════════════════════════╣
║ Failed Test Details: ║
║ • sql-injection: Result count mismatch ║
║ • unused-import: Compilation error ║
╚══════════════════════════════════════════════════════════════╝
Exit Code: 0 (pretty-print mode)
- CI/CD pipeline final validation step
- Automated test result processing
- Quality gate enforcement in development workflows
- Test result aggregation and reporting
- Debugging test execution issues
- name: Execute Tests
run: |
qlt test run execute-unit-tests \
--num-threads=4 \
--work-dir=/tmp/test-results \
--language=java \
--runner-os=ubuntu-latest
- name: Validate Results
run: |
qlt test run validate-unit-tests \
--results-directory=/tmp/test-results \
--pretty-print=falsestage('Validate Tests') {
steps {
sh '''
qlt test run validate-unit-tests \
--results-directory=${WORKSPACE}/test-results \
--pretty-print=false
'''
}
}- Exit code 0
- Summary of all passed tests
- Execution timing information
- Clean validation output
- Exit code 1 (standard mode only)
- List of failed tests with reasons
- Detailed error information
- Suggestions for resolution
qlt test run execute-unit-tests- Generate test results for validationcodeql test run- Individual test execution for debuggingqlt query generate new-query- Generate queries with proper test structure