This page outlines how the Launchable CLI interfaces with Bazel.
After running tests, point the CLI to your test report files to collect test results and train the model:
launchable record tests --build <BUILD NAME> bazel .
The high level flow for subsetting is:
- 1.Get the full list of tests/test paths and pass that to
launchable subsetwith an optimization target for the subset
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
To retrieve a subset of tests, first list all the tests you would normally run and pass that to
bazel query 'tests(//...)' | launchable subset \
--build <BUILD NAME> \
--target <PERCENTAGE DURATION> \
bazel > launchable-subset.txt
--buildshould use the same
<BUILD NAME>value that you used before in
launchable record build.
This creates a file called
launchable-subset.txtthat you can pass into your command to run tests:
bazel test $(cat launchable-subset.txt)