Launchable supports JSON and JUnit XML reports generated by cucumber (using -f junit or -f json. Follow the instructions for whichever one you use. JUnit XML is the default.
JUnit XML
JSON
If you run cucumber with the -f junit option, like this:
bundle exec cucumber -f junit -o reports
After running tests, point the CLI to your test report files to record test results:
launchable record tests --no-build cucumber ./reports/**/*.xml
Note: If you receive a warning message such as Cannot find test file Test-feature-example.xml, set the project's root directory path with the --base option:
launchable record tests --no-build --base /example/project cucumber /example/project/reports/**/*.xml
Cypress
After running tests, point the CLI to your test report files to record test results:
launchable record tests --no-build cypress ./report/*.xml
First, configure GoogleTest to produce JUnit-compatible report files. See their documentation for how to do this. You'll end up with a command something like this:
# run the tests however you normally do
./my-test --gtest_output=xml:./report/my-test.xml
Then, after running tests, point the CLI to your test report files to record test results:
launchable record tests --no-build googletest ./report
By default, Gradle's report files are saved to build/test-results/test/, but that might be different depending on how your Gradle project is configured.
You can specify multiple directories if you do multi-project build.
For a large project, a dedicated Gradle task to list up all report directories might be convenient. See the upstream documentation for more details and insights.
Alternatively, you can specify a glob pattern for directories or individual test report files (this pattern might already be specified in your pipeline script for easy copy-pasting), e.g. gradle **/build/**/TEST-*.xml.
Jest
First, in order to generate reports that Launchable can consume, use jest-junit to generate a JUnit XML file after you run tests.
# install jest-junit reporter
npm install jest-junit --save-dev
# or
yarn add --dev jest-junit
You'll need to configure jest-junit to include file paths in reports.
You can do this using environment variables:
Using environment variables
Using package.json
Recommended config:
export JEST_JUNIT_CLASSNAME="{classname}"
export JEST_JUNIT_TITLE="{title}"
export JEST_JUNIT_SUITE_NAME="{filepath}"
Minimum config:
export JEST_JUNIT_SUITE_NAME="{filepath}"
Then, run jest using jest-junit:
# run tests with jest-junit
jest --ci --reporters=default --reporters=jest-junit
Then, after running tests, point the CLI to your test report files to record test results:
# send test results to Launchable
launchable record tests --no-build jest your-junit.xml
Launchable supports JSON and JUnit XML reports generated by pytest (using --junit-xml or --report-log). Follow the instructions for whichever one you use. JUnit XML is the default.
JUnit XML
JSON
First, run tests with the --junit-xml option:
pytest --junit-xml=test-results/results.xml
pytest changed its default test report format from xunit1 to xunit2 in version 6. Unfortunately, the new xunit2 format does not include file paths, which Launchable needs.
First, use rspec_junit_formatter to output test results to a file in RSpec. If you already have a CI server storing your test results it may already be installed: