### Download and Install allurectl Binaries Source: https://context7.com/allure-framework/allurectl/llms.txt Download the appropriate binary for your OS and architecture, then grant execution permissions. ```bash # Download latest release for Linux x64 wget https://github.com/allure-framework/allurectl/releases/latest/download/allurectl_linux_amd64 -O ./allurectl chmod +x ./allurectl # For MacOS Intel wget https://github.com/allure-framework/allurectl/releases/latest/download/allurectl_darwin_amd64 -O ./allurectl chmod +x ./allurectl # For MacOS M1/ARM wget https://github.com/allure-framework/allurectl/releases/latest/download/allurectl_darwin_arm64 -O ./allurectl chmod +x ./allurectl ``` -------------------------------- ### Upload command with command line parameters Source: https://github.com/allure-framework/allurectl/blob/main/cookbook.md Use the 'upload' command to send test results when the 'watch' command is not suitable. This example shows how to provide all necessary parameters directly on the command line. ```bash allurectl upload --endpoint https://allure.company.com \ --token 55555555-5555-5555-5555-555555555555 \ --project-id 100 \ --launch-name "Local PC manual launch 2200-12-31" \ path/to/allure-results ``` -------------------------------- ### Upload command using environment variables Source: https://github.com/allure-framework/allurectl/blob/main/cookbook.md This example demonstrates uploading test results using the 'upload' command, with connection details and launch name provided via environment variables. Ensure ALLURE_TESTPLAN_PATH is set if performing selective runs. ```bash # Define environment variables export ALLURE_ENDPOINT=https://demo.testops.cloud export ALLURE_TOKEN=55555555-5555-5555-5555-555555555555 export ALLURE_PROJECT_ID=100 # Run upload process somewhere allurectl upload --launch-name "Local PC manual launch 2200-12-31" path/to/allure-results ``` -------------------------------- ### Example output of environment variables Source: https://github.com/allure-framework/allurectl/blob/main/cookbook.md The output of the printenv command showing Allure-related configuration variables. ```shell ALLURE_ENDPOINT=https://demo.testops.cloud ALLURE_LAUNCH_ID=11111 ALLURE_RESULTS=./allure-results ALLURE_JOB_RUN_ID=12345 ALLURE_LAUNCH_TAGS=master, gitlab, demo, pytest, skip-live-doc, ignore ALLURE_TOKEN=[MASKED] ALLURE_TESTPLAN_PATH=./testplan.json ALLURE_LAUNCH_NAME=allure-pytest - 1ea04f48 ALLURE_JOB_RUN_URL=https://demo.testops.cloud/jobrun/14433 ALLURE_LAUNCH_URL=https://demo.testops.cloud/launch/31897 ALLURE_PROJECT_ID=433 ``` -------------------------------- ### Create and execute a launch from a test plan Source: https://github.com/allure-framework/allurectl/blob/main/cookbook.md Generate a test plan using AQL and execute the tests via allurectl. ```shell export ALLURE_TOKEN= export ALLURE_ENDPOINT=https://demo.testops.cloud export ALLURE_PROJECT_ID=111 export ALLURE_LAUNCH_NAME="$(date "+%Y-%m-%d %H%M%S") executing test plan" export ALLURE_LAUNCH_TAGS="watch, testplan" export ALLURE_RESULTS="allure-results" export ALLURE_TESTPLAN_PATH="./testplan.json" # create tetsplan.json based on AQL for test cases "testPlan=222" where 222 is the ID of a test plan ./allurectl test-case plan -q "testPlan=222" --output-file ${ALLURE_TESTPLAN_PATH} # execute test cases based on testplan.json ./allurectl watch -- [tests_execution_command] ``` -------------------------------- ### Download allurectl for Linux Source: https://github.com/allure-framework/allurectl/blob/main/cookbook.md Downloads the latest Linux x64 binary and sets execution permissions. ```bash wget https://github.com/allure-framework/allurectl/releases/latest/download/allurectl_linux_amd64 -O ./allurectl chmod +x ./allurectl ``` -------------------------------- ### Configure Environment and Create Test Plan Source: https://context7.com/allure-framework/allurectl/llms.txt Set up environment variables for Allure TestOps and create a test plan JSON file using an AQL query. This is useful for defining which tests to execute. ```bash export ALLURE_TOKEN=your-token-here export ALLURE_ENDPOINT=https://demo.testops.cloud export ALLURE_PROJECT_ID=111 export ALLURE_LAUNCH_NAME="$(date \"+%Y-%m-%d %H%M%S\") executing test plan" export ALLURE_LAUNCH_TAGS="watch, testplan" export ALLURE_RESULTS="allure-results" export ALLURE_TESTPLAN_PATH="./testplan.json" # Create testplan.json from test plan ID 222 using AQL query ./allurectl test-case plan -q "testPlan=222" --output-file ${ALLURE_TESTPLAN_PATH} # Execute test cases based on the generated testplan.json ./allurectl watch -- ./gradlew clean test ``` -------------------------------- ### Retrieve Allure TestOps launch information Source: https://github.com/allure-framework/allurectl/blob/main/cookbook.md Export environment variables and execute the watch command to capture launch details. ```shell #define env vars export ALLURE_ENDPOINT=https://demo.testops.cloud export ALLURE_TOKEN= export ALLURE_PROJECT_ID= export ALLURE_LAUNCH_NAME="Hello, world" export ALLURE_RESULTS=path/to/allure-results # exec the tests allurectl watch -- ./gradlew clean test export $(allurectl job-run env) # this will just show the list of all ENV vars related to allurectl execution printenv | grep ALLURE_ ``` -------------------------------- ### Upload Results with upload Command Source: https://context7.com/allure-framework/allurectl/llms.txt Upload existing test results directories after test completion. Use this when real-time streaming is not applicable. ```bash # Upload using command line parameters allurectl upload --endpoint https://allure.company.com \ --token 55555555-5555-5555-5555-555555555555 \ --project-id 100 \ --launch-name "Local PC manual launch 2200-12-31" \ path/to/allure-results # Upload using environment variables (recommended) export ALLURE_ENDPOINT=https://demo.testops.cloud export ALLURE_TOKEN=55555555-5555-5555-5555-555555555555 export ALLURE_PROJECT_ID=100 allurectl upload --launch-name "Local PC manual launch 2200-12-31" path/to/allure-results ``` -------------------------------- ### Authenticate with Allure TestOps Source: https://github.com/allure-framework/allurectl/blob/main/cookbook.md Sets the required environment variables and executes the login command to verify connection. ```bash export ALLURE_TOKEN= export ALLURE_ENDPOINT=https://demo.testops.cloud $ allurectl auth login ``` -------------------------------- ### Configure Selective Test Runs with Test Plans Source: https://context7.com/allure-framework/allurectl/llms.txt Define specific test cases to run using a JSON test plan file and execute them via the watch command. ```json { "version": "1.0", "tests": [ { "id": "10", "selector": "io.qameta.allure.examples.junit4.AllureSimpleTest.allureSimpleTest" }, { "id": "11", "selector": "io.qameta.allure.examples.junit4.AllureParameterizedTest.allureParameterizedTest[First Name]" } ] } ``` ```bash # Set the test plan path environment variable export ALLURE_TESTPLAN_PATH=./testplan.json # Generate test plan from CI job run allurectl job-run plan --output-file ${ALLURE_TESTPLAN_PATH} # Execute tests - framework will read testplan.json and run only specified tests allurectl watch -- ./gradlew clean test ``` -------------------------------- ### Retrieve Launch Information with job-run env Source: https://context7.com/allure-framework/allurectl/llms.txt After running tests, export launch information into environment variables. This is useful for accessing launch IDs, URLs, and tags for notifications or further processing. ```bash # Configure and run tests export ALLURE_ENDPOINT=https://demo.testops.cloud export ALLURE_TOKEN=your-token-here export ALLURE_PROJECT_ID=100 export ALLURE_LAUNCH_NAME="Hello, world" export ALLURE_RESULTS=path/to/allure-results # Execute tests allurectl watch -- ./gradlew clean test # Export launch information to environment variables export $(allurectl job-run env) # View all Allure-related environment variables printenv | grep ALLURE_ # Output includes: # ALLURE_ENDPOINT=https://demo.testops.cloud # ALLURE_LAUNCH_ID=11111 # ALLURE_JOB_RUN_ID=12345 # ALLURE_LAUNCH_TAGS=master, gitlab, demo, pytest, skip-live-doc, ignore # ALLURE_LAUNCH_NAME=allure-pytest - 1ea04f48 # ALLURE_JOB_RUN_URL=https://demo.testops.cloud/jobrun/14433 # ALLURE_LAUNCH_URL=https://demo.testops.cloud/launch/31897 # ALLURE_PROJECT_ID=433 # Use URLs in notifications (Slack, email, etc.) echo "Test results available at: ${ALLURE_LAUNCH_URL}" echo "Job run details: ${ALLURE_JOB_RUN_URL}" ``` -------------------------------- ### Configure CI job run commands Source: https://github.com/allure-framework/allurectl/blob/main/cookbook.md Commands used to generate a test plan and execute tests within a CI environment. ```shell allurectl job-run plan --output-file ${ALLURE_TESTPLAN_PATH} ``` ```shell allurectl watch -- ./gradlew clean test ``` -------------------------------- ### Authenticate with allurectl Source: https://context7.com/allure-framework/allurectl/llms.txt Verify connection to the Allure TestOps instance. This command is for manual verification and should not be used for pipeline authentication. ```bash # Set environment variables for authentication export ALLURE_TOKEN=your-api-token-here export ALLURE_ENDPOINT=https://demo.testops.cloud # Test the connection allurectl auth login # Get help on authentication commands allurectl --help auth ``` -------------------------------- ### Environment Variables Reference for Allurectl Source: https://context7.com/allure-framework/allurectl/llms.txt Configure allurectl using environment variables for connection settings, project identification, and result paths. Required variables include endpoint, token, and project ID. ```bash # Required variables for all operations export ALLURE_ENDPOINT=https://allure.company.com # Allure TestOps server URL export ALLURE_TOKEN=55555555-5555-5555-5555-555555555555 # Personal API token export ALLURE_PROJECT_ID=100 # Project ID from TestOps main screen # Optional variables for launch configuration export ALLURE_LAUNCH_NAME="CI Build #${BUILD_NUMBER}" # Launch display name export ALLURE_LAUNCH_TAGS="regression, nightly" # Tags for the launch export ALLURE_RESULTS=./allure-results # Path to results directory export ALLURE_TESTPLAN_PATH=./testplan.json # Path to test plan file # CI-specific variables (set automatically by Allure TestOps) # ALLURE_JOB_RUN_ID - Job run identifier (when set, other variables are ignored) ``` -------------------------------- ### Define testplan.json structure Source: https://github.com/allure-framework/allurectl/blob/main/cookbook.md The testplan.json file defines which tests to run using their IDs and selectors. ```json { "version":"1.0", "tests": [ { "id": "10", "selector": "io.qameta.allure.examples.junit4.AllureSimpleTest.allureSimpleTest" }, { "id": "11", "selector": "io.qameta.allure.examples.junit4.AllureParameterizedTest.allureParameterizedTest[First Name]" } ] } ``` -------------------------------- ### Stream Test Results with watch Source: https://context7.com/allure-framework/allurectl/llms.txt Use the watch command to stream results in real-time during test execution. This is the recommended workflow for CI pipelines. ```bash # Set required environment variables export ALLURE_ENDPOINT=https://allure.company.com export ALLURE_TOKEN=55555555-5555-5555-5555-555555555555 export ALLURE_PROJECT_ID=100 export ALLURE_LAUNCH_NAME="Hello, world" # Run tests with watch - results path specified via flag allurectl watch --results path/to/allure-results -- ./gradlew clean test # Alternative: set results path via environment variable for cleaner command export ALLURE_RESULTS=path/to/allure-results allurectl watch -- ./gradlew clean test # Example with Maven allurectl watch --results target/allure-results -- mvn clean test # Example with pytest allurectl watch --results allure-results -- pytest tests/ ``` -------------------------------- ### Watch command with environment variable for results path Source: https://github.com/allure-framework/allurectl/blob/main/cookbook.md A more concise 'watch' command usage when the allure results path is set as an environment variable. This simplifies the command line. ```bash export ALLURE_ENDPOINT=https://allure.company.com export ALLURE_TOKEN=542dcd56-b0e2-4fdd-8ecf-bacf0f33d505 export ALLURE_PROJECT_ID=12 export ALLURE_LAUNCH_NAME="Hello, world" export ALLURE_RESULTS=path/to/allure-results ... allurectl watch -- ./gradlew clean test ``` -------------------------------- ### Watch command with explicit results path Source: https://github.com/allure-framework/allurectl/blob/main/cookbook.md Use the 'watch' command to monitor test results and execute tests. Provide the path to allure results explicitly. Recommended for CI/CD pipelines. ```bash export ALLURE_ENDPOINT=https://allure.company.com export ALLURE_TOKEN=55555555-5555-5555-5555-555555555555 export ALLURE_PROJECT_ID=100 export ALLURE_LAUNCH_NAME="Hello, world" # you can use here the environment variables of your job/pipeline ... allurectl watch --results path/to/allure-results -- ./gradlew clean test ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.