Launchable CLI

1.122.0 · active · verified Thu Apr 16

Launchable CLI is a Python3 package that serves as the command-line interface to the Launchable test failure intelligence platform. It enables users to integrate their build tools and test runners with Launchable for features like predictive test selection, test suite parallelization, intelligent test failure diagnostics, and test trend analysis. The library is actively maintained, adhering to semantic versioning, with frequent updates to its '1.x' major release line.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to verify your Launchable CLI installation and authentication using Python's `subprocess` module, which is the recommended way for programmatic interaction with the CLI. It assumes the `LAUNCHABLE_TOKEN` environment variable is set for authentication.

import os
import subprocess

# Replace with your actual Launchable API key or retrieve from environment
# For CI/CD, this is typically set as an environment variable (e.g., LAUNCHABLE_TOKEN)
api_key = os.environ.get('LAUNCHABLE_TOKEN', 'YOUR_LAUNCHABLE_API_KEY')

if not api_key or api_key == 'YOUR_LAUNCHABLE_API_KEY':
    print("Warning: LAUNCHABLE_TOKEN environment variable not set. Using placeholder.")
    print("Please set LAUNCHABLE_TOKEN for actual usage.")
    # For demonstration, we'll proceed, but real usage requires a valid token

os.environ['LAUNCHABLE_TOKEN'] = api_key

try:
    print("Verifying Launchable CLI configuration...")
    result = subprocess.run(['launchable', 'verify'], capture_output=True, text=True, check=True)
    print("Launchable CLI verification successful:")
    print(result.stdout)
except subprocess.CalledProcessError as e:
    print(f"Error verifying Launchable CLI: {e.stderr}")
    print("Please ensure LAUNCHABLE_TOKEN is set correctly and Java 8+ is installed.")
except FileNotFoundError:
    print("Error: 'launchable' command not found.")
    print("Please ensure the Launchable CLI is installed and in your system's PATH.")

view raw JSON →