|
| 1 | +#!/usr/bin/env bash |
| 2 | +# |
| 3 | +# Run the SDK integration test suite locally, mirroring the `integration-test` |
| 4 | +# job in .github/workflows/pull_request.yml. |
| 5 | +# |
| 6 | +# The AI/agentic integration tests are excluded on purpose: they target a |
| 7 | +# dedicated AI-enabled server (test_ai_task_types.py and test_ai_examples.py |
| 8 | +# hardcode http://localhost:7001/api, and test_agentic_workflows.py needs an |
| 9 | +# `openai` LLM provider configured on the server), so they don't run against |
| 10 | +# the standard test server this suite targets. |
| 11 | +# |
| 12 | +# The performance test (test_update_task_v2_perf.py) is also excluded by |
| 13 | +# default: it submits ~1000 workflows and takes several minutes. Pass |
| 14 | +# --with-perf to include it. |
| 15 | +# |
| 16 | +# Server connection is read from the environment (see |
| 17 | +# src/conductor/client/configuration/configuration.py): |
| 18 | +# CONDUCTOR_SERVER_URL (required; defaults to http://localhost:8080/api) |
| 19 | +# CONDUCTOR_AUTH_KEY (optional; needed for Orkes/authenticated servers) |
| 20 | +# CONDUCTOR_AUTH_SECRET (optional; needed for Orkes/authenticated servers) |
| 21 | +# |
| 22 | +# Usage: |
| 23 | +# export CONDUCTOR_SERVER_URL="http://localhost:8080/api" |
| 24 | +# ./scripts/run_integration_tests.sh |
| 25 | +# ./scripts/run_integration_tests.sh --with-perf # also run the perf test |
| 26 | +# |
| 27 | +# Any other arguments are passed straight through to pytest, which is handy for |
| 28 | +# targeting a subset of tests or getting more detail on failures: |
| 29 | +# |
| 30 | +# # run a subset (by keyword or path) with live output |
| 31 | +# ./scripts/run_integration_tests.sh -s -k lease |
| 32 | +# ./scripts/run_integration_tests.sh tests/integration/test_lease_extension.py |
| 33 | +# |
| 34 | +# # short tracebacks + a one-line reason for every failure/skip, with live logs |
| 35 | +# ./scripts/run_integration_tests.sh -ra --tb=short --log-cli-level=INFO |
| 36 | +# |
| 37 | +# # stop at the first failure instead of waiting for the whole suite |
| 38 | +# ./scripts/run_integration_tests.sh -x --tb=long |
| 39 | +# |
| 40 | +# # re-run just specific tests, e.g. the ones that failed |
| 41 | +# ./scripts/run_integration_tests.sh -s -k "upsert_group or create_role" |
| 42 | +# |
| 43 | +# # show the 15 slowest tests (setup/call/teardown timings) after the run |
| 44 | +# ./scripts/run_integration_tests.sh --durations=15 |
| 45 | + |
| 46 | +set -euo pipefail |
| 47 | + |
| 48 | +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" |
| 49 | +cd "$REPO_ROOT" |
| 50 | + |
| 51 | +# The perf test is skipped by default; --with-perf opts back in. |
| 52 | +perf_ignore=(--ignore=tests/integration/test_update_task_v2_perf.py) |
| 53 | +pytest_args=() |
| 54 | +for arg in "$@"; do |
| 55 | + if [[ "$arg" == "--with-perf" ]]; then |
| 56 | + perf_ignore=() |
| 57 | + else |
| 58 | + pytest_args+=("$arg") |
| 59 | + fi |
| 60 | +done |
| 61 | + |
| 62 | +# Note: the "${arr[@]+"${arr[@]}"}" form is required so empty arrays don't trip |
| 63 | +# "unbound variable" under `set -u` on bash 3.2 (the default macOS bash). |
| 64 | +exec python3 -m pytest tests/integration -v \ |
| 65 | + --ignore=tests/integration/test_ai_task_types.py \ |
| 66 | + --ignore=tests/integration/test_ai_examples.py \ |
| 67 | + --ignore=tests/integration/test_agentic_workflows.py \ |
| 68 | + ${perf_ignore[@]+"${perf_ignore[@]}"} \ |
| 69 | + ${pytest_args[@]+"${pytest_args[@]}"} |
0 commit comments