Launchable Docs
launchableinc.com
Log in
Sign up
Search…
public
Product overview
Getting started
Sending data to Launchable
Choosing a value for <BUILD NAME>
Converting test reports to JUnit format
Ensuring `record tests` always runs
Managing complex test session layouts
Recording builds from multiple repositories
Use 'flavors' to run the best tests for an environment
Using the generic file-based runner integration
Features
Test results and reports
Insights
Predictive Test Selection
Concepts
Organization
Workspace
Build
Test session
Subset
Insight
Resources
CLI reference
Integrations
Supported languages
Supported test frameworks
Troubleshooting
Launchable product rollout
Policies
Data privacy and protection
Security policies
Powered By
GitBook
Ensuring `record tests` always runs
The
launchable record tests
command must be executed after you run tests.
However, some tools exit the build process as soon as the test process finishes, preventing this from happening.
The way to fix this depends on your CI tool:
Jenkins
Jenkins has
post { always { ... } }
option:
1
pipeline {
2
...
3
sh 'bundle exec rails test -v $(cat launchable-subset.txt)'
4
...
5
post {
6
always {
7
sh 'launchable record tests <BUILD NAME> [OPTIONS]'
8
}
9
}
10
}
Copied!
CircleCI
CircleCI has
when: always
option:
1
-
jobs
:
2
-
test
:
3
...
4
-
run
:
5
name
:
Run tests
6
command
:
bundle exec rails test
-
v $(cat launchable
-
subset.txt)
7
-
run
:
8
name
:
Record test results
9
command
:
launchable record tests <BUILD NAME
>
[
OPTIONS
]
10
when
:
always
Copied!
Github Actions
GitHub Action has
if: ${{ always() }}
option:
1
jobs
:
2
test
:
3
steps
:
4
...
5
-
name
:
Run tests
6
run
:
bundle exec rails test
-
v $(cat launchable
-
subset.txt)
7
-
name
:
Record test result
8
run
:
launchable record tests <BUILD NAME
>
[
OPTIONS
]
9
if
:
always()
Copied!
Bash
If you run tests on your local or other CI, you can use
trap
:
1
function
record
()
{
2
launchable record tests
<
BUILD NAME
>
[
OPTIONS
]
3
}
4
# set a trap to send test results to Launchable for this build either tests succeed/fail
5
trap
record EXIT SIGHUP
6
​
7
bundle
exec
rails tes
Copied!
Previous
Converting test reports to JUnit format
Next
Managing complex test session layouts
Last modified
2d ago
Copy link
Contents
Jenkins
CircleCI
Github Actions
Bash