Requesting and running a subset of tests
We strongly suggest that you request and run a 100% subset of tests (i.e. run all the tests you normally would) before you actually run partial subsets in your pipeline. That way you can identify and fix any integration issues.
The high level flow for subsetting is:
- 1.Get the full list of tests (or test files, targets, etc.) and pass that to
launchable subsetalong with:
- 1.an optimization target for the subset
- 2.a build name, so Launchable can choose the best tests for the changes in the build being tested
launchable subsetwill get a subset from the Launchable platform and output that list to a text file
- 3.Pass the text file into your test runner to run only those tests
The diagram below illustrates the interactions between your tools, the Launchable CLI, and the Launchable platform:
launchable subsetto request a subset of tests. You'll run this command before your normal test runner command.
Here's an example using Ruby/minitest. For integration, we're using an optimization target of 100% so that all tests are still run:
launchable subset \
--build <BUILD NAME> \
--target 100% \
minitest test/**/*.rb > launchable-subset.txt
--buildoption should use the same
<BUILD NAME>value that you used in
launchable record build.
This creates a file called
launchable-subset.txtthat you can pass into your test runner.
Again, with Ruby/minitest:
bundle exec rails test $(cat launchable-subset.txt)
Subsetting instructions depend on the test runner or build tool you use to run tests. Click the appropriate link below to get started: