This guide helps Launchable CLI users to migrate from CLI (v1) to CloudBees Smart Tests CLI (v2). The migration is generally straightforward, but there are several breaking changes to be aware of.
Overview of changes
| Area | CLI v1 | CLI v2 |
|---|---|---|
Command name |
|
|
Package name |
|
|
Installation |
|
|
Python requirement |
Python 3.6+ |
Python 3.13+ |
Environment variables |
|
|
Session state |
File-based ( |
Explicit |
Step 1: Update the installation
Replace the CLI installation command in your CI pipeline:
pip install launchable
curl -LsSf https://astral.sh/uv/install.sh | sh export PATH="$HOME/.local/bin:$PATH" uv tool install smart-tests-cli~=2.0
pip3 install --user --upgrade smart-tests-cli
|
CLI v2 requires Python 3.13 or later. Ensure your CI environment meets this requirement. |
Step 2: Rename environment variables
All LAUNCHABLE_* environment variables have been renamed to SMART_TESTS_*.
| v1 | v2 | Notes |
|---|---|---|
|
|
v2 still falls back to |
|
|
No backward compatibility |
|
|
No backward compatibility |
|
|
No backward compatibility |
|
|
No backward compatibility |
|
While |
Step 3: Replace the command name
Replace all occurrences of launchable with smart-tests in your CI scripts.
launchable verify launchable record build --name mychange1 launchable record session --build mychange1 --test-suite e2e > session.txt launchable subset ... launchable record tests ...
smart-tests verify smart-tests record build --build mychange1 smart-tests record session --build mychange1 --test-suite e2e > session.txt smart-tests subset ... smart-tests record tests ...
Step 4: Update command options
Several options are renamed or removed in CLI (v2).
record build
| v1 | v2 |
|---|---|
|
|
|
|
|
Removed |
launchable record build --name mychange1 --branch myrepo=feature-x
smart-tests record build --build mychange1 --repo-branch-map myrepo=feature-x
record session
| v1 | v2 |
|---|---|
|
|
|
Removed (no file-based state) |
|
Removed |
|
Both v1 and v2 print the session ID to stdout. The difference is that v1 also persisted it as local state, so subsequent commands could pick it up automatically. v2 has no such state, so you must capture the session ID yourself and pass it to subsequent commands via |
launchable record session --build mychange1 --test-suite e2e > session.txt
smart-tests record session --build mychange1 --test-suite e2e > session.txt # pass session explicitly to subsequent commands
subset
| v1 | v2 |
|---|---|
|
|
|
Removed (derived from session) |
|
Removed |
|
Removed (set flavors via |
|
Removed |
|
Removed |
cat test_list.txt | launchable subset --confidence 90% --flavor os=linux file > subset.txt
cat test_list.txt | smart-tests subset file --confidence 90% --session @session.txt > subset.txt
|
In v2, the test runner profile (e.g., |
record tests
| v1 | v2 |
|---|---|
|
|
|
Removed (derived from session) |
|
Removed |
|
Removed (set flavors via |
|
Removed (use |
launchable record tests file test-results/*.xml
smart-tests record tests file --session @session.txt test-results/*.xml
Step 5: Update session handling
A test session groups the test results and subset requests that belong to a single build.
In v1, running record session was optional. If you didn’t run it, the CLI created a session implicitly when you executed subset or record tests. In v2, record session is a required, explicit step.
|
Most v1 users never ran |
Aside from that, session handling works almost the same way: subsequent commands consume the output of record session. The recommended pattern is to write the session ID to a file (for example, session.txt) and reference it with the @ syntax.
Recommended pattern
# Record the build smart-tests record build --build $BUILD_NAME # Start a session and capture its ID smart-tests record session --build $BUILD_NAME --test-suite $TEST_SUITE > session.txt # Request a subset (pass session explicitly) cat test_list.txt | smart-tests subset file --confidence 90% --session @session.txt > subset.txt # Run tests run_your_tests $(cat subset.txt) # Record results (pass session explicitly) smart-tests record tests file --session @session.txt test-results/*.xml
The @session.txt syntax tells the CLI to read the session value from a file. Alternatively, you can capture the value in a shell variable:
SESSION=$(smart-tests record session --build $BUILD_NAME --test-suite $TEST_SUITE) cat test_list.txt | smart-tests subset file --confidence 90% --session "$SESSION" > subset.txt smart-tests record tests file --session "$SESSION" test-results/*.xml
Step 6: Handle flavors differently
In v1, --flavor could be passed to subset and record tests. In v2, flavors are set only when creating the session:
launchable record session --build mychange1 --test-suite e2e > session.txt cat tests.txt | launchable subset --flavor os=linux file --session $(cat session.txt) launchable record tests --flavor os=linux --session $(cat session.txt) file results/*.xml
smart-tests record session --build mychange1 --test-suite e2e --flavor os=linux > session.txt cat tests.txt | smart-tests subset file --session @session.txt > subset.txt smart-tests record tests file --session @session.txt results/*.xml
Removed commands
The following commands are no longer available in v2:
| Removed command | Alternative |
|---|---|
|
Generate an input snapshot ID when requesting the subset ( |
|
Use the CloudBees Smart Tests webapp to inspect test data |
Stricter error handling
In v2, some incorrect usages that were silently tolerated in v1 now produce explicit errors. If you encounter new errors after migration, check:
-
All required options are provided (especially
--sessionand--test-suite) -
Option names match the v2 syntax (e.g.,
--buildnot--name) -
No removed options are still being passed == Complete migration example
Below is a complete before-and-after comparison of a typical CI pipeline:
pip install launchable export LAUNCHABLE_TOKEN=$SECRET_TOKEN launchable verify || true launchable record build --name $CI_COMMIT_SHA launchable record session --build $CI_COMMIT_SHA --test-suite unit > session.txt find tests/ -name 'test_*.py' | launchable subset --confidence 90% --session $(cat session.txt) file > subset.txt pytest $(cat subset.txt) --junitxml=results.xml launchable record tests --session $(cat session.txt) file results.xml
uv tool install smart-tests-cli~=2.0 export SMART_TESTS_TOKEN=$SECRET_TOKEN smart-tests verify || true smart-tests record build --build $CI_COMMIT_SHA smart-tests record session --build $CI_COMMIT_SHA --test-suite unit > session.txt find tests/ -name 'test_*.py' | smart-tests subset file --confidence 90% --session @session.txt > subset.txt pytest $(cat subset.txt) --junitxml=results.xml smart-tests record tests file --session @session.txt results.xml
Getting help
If you encounter issues during migration:
-
Refer to Troubleshooting page.
-
Refer to the CLI reference for the full list of v2 commands and options.
-
Contact CloudBees Support for assistance.