This page outlines how the Launchable CLI interfaces with Behave.
After running tests, point the CLI to your test report files to collect test results and train the model:
# run the tests however you normally do
launchable record tests --build <BUILD NAME> behave ./reports/*.xml
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
find ./features/ | launchable subset \
--build <BUILD NAME> \
--confidence <TARGET> \
behave > 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:
behave -i "$(cat launchable-subset.txt)"