-
Notifications
You must be signed in to change notification settings - Fork 42
CCOR-13193 - adding test run against oss server in ci #497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chrishagglund-ship-it
wants to merge
10
commits into
main
Choose a base branch
from
e2e-against-conductor-with-local-script
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e067c19
wip, adding test run against oss server in ci
chrishagglund-ship-it a5a3eb5
set up to test against oss in ci, fix for racey sub-wf start detection
chrishagglund-ship-it 458cd6b
oss stuff ran pretty quick, probably no need to do the 4 way split
chrishagglund-ship-it 9c81c8b
use is_oss flag to determine some behavior nuances instead of blanket…
chrishagglund-ship-it 7bf2eec
bring docs and script functionality into alignment re: up only
chrishagglund-ship-it ee60de1
have _wait_for_blocking_task reuse the workflow the finder already fe…
chrishagglund-ship-it a575459
pin httpbin version
chrishagglund-ship-it f2aca9d
stop clobbering task name and actually register task for our test
chrishagglund-ship-it 9acd313
hygeine and cleanup, docs improvements
chrishagglund-ship-it f9ef1c5
don't clean task def that has fixed name that could be in use in othe…
chrishagglund-ship-it File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Conductor OSS stack used to run the SDK integration tests against open-source | ||
| # Conductor. Shared by scripts/run-integration-oss.sh and the | ||
| # integration-tests-oss job in .github/workflows/pull_request.yml. | ||
| # | ||
| # The Conductor server reaches httpbin over the compose network at | ||
| # http://httpbin:8081 (see e.g. tests/integration/client/orkes/test_orkes_service_registry_client.py | ||
| # and the complex_wf_signal_test*.json fixtures). | ||
| # | ||
| # OSS_CONDUCTOR_VERSION defaults to `latest` for local runs; CI pins it via the | ||
| # E2E_TEST_OSS_CONDUCTOR_VERSION org variable (or a workflow_dispatch input). | ||
| services: | ||
| conductor-server: | ||
| image: conductoross/conductor:${OSS_CONDUCTOR_VERSION:-latest} | ||
| environment: | ||
| - CONFIG_PROP=config-postgres.properties | ||
| ports: | ||
| - "8080:8080" | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-I", "-XGET", "http://localhost:8080/health"] | ||
| interval: 10s | ||
| timeout: 10s | ||
| retries: 20 | ||
| links: | ||
| - conductor-postgres:postgresdb | ||
| depends_on: | ||
| conductor-postgres: | ||
| condition: service_healthy | ||
| conductor-postgres: | ||
| image: postgres:16 | ||
| environment: | ||
| - POSTGRES_USER=conductor | ||
| - POSTGRES_PASSWORD=conductor | ||
| healthcheck: | ||
| test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/5432' | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 12 | ||
| httpbin: | ||
| image: ghcr.io/conductor-oss/httpbin:v1.0.1 | ||
| expose: | ||
| - "8081" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Spin up a local Conductor OSS stack and run the SDK integration suite | ||
| # against it. To reproduce the `integration-tests-oss` job in | ||
| # .github/workflows/pull_request.yml you need `-- --bucket=all`: that job runs | ||
| # the full suite, whereas this script defaults to the faster `core` bucket, | ||
| # which excludes tests/integration/test_workflow_client_intg.py -- the only | ||
| # entry point to the workflow-execution and Signal API scenarios. | ||
| # | ||
| # Orkes-Enterprise-only tests, classes, and modules (Authorization, Secrets, | ||
| # Schema, Service Registry, metadata/scheduler tags) gate themselves on | ||
| # is_oss() in tests/integration/conftest.py, which reads the | ||
| # CONDUCTOR_SERVER_TYPE this script exports below; its docstring carries the | ||
| # authoritative list of gated surface (confirmed empirically not implemented by | ||
| # plain OSS Conductor -- see the individual test files for details on each | ||
| # gap). The Signal API tests run on OSS too, using a WAIT-task-based fixture | ||
| # variant instead of the YIELD-based one used against Orkes Enterprise -- see | ||
| # _signal_test_workflow_names() in | ||
| # tests/integration/workflow/test_workflow_execution.py. | ||
| # | ||
| # The stack (Conductor OSS + Postgres + httpbin) is defined in | ||
| # scripts/docker-compose-oss.yaml and is torn down automatically on exit. | ||
| # | ||
| # Usage: | ||
| # scripts/run-integration-oss.sh [--up-only] [--keep-up] [--version <tag>] [-- pytest args] | ||
| # Examples: | ||
| # scripts/run-integration-oss.sh -- --bucket=all # what CI runs: the full suite | ||
| # scripts/run-integration-oss.sh # faster: --bucket=core against `latest` | ||
| # scripts/run-integration-oss.sh --version 3.32.0-rc18 | ||
| # scripts/run-integration-oss.sh --keep-up # leave the stack up afterwards | ||
| # scripts/run-integration-oss.sh --up-only # start the stack, skip the suite | ||
| set -euo pipefail | ||
|
|
||
| KEEP_UP=0 | ||
| UP_ONLY=0 | ||
| extra=() | ||
|
|
||
| while [[ $# -gt 0 ]]; do | ||
| case "$1" in | ||
| --keep-up) KEEP_UP=1; shift ;; | ||
| # Bring the stack up and stop there, for pointing repeated test runs at it | ||
| # by hand. Implies --keep-up: tearing down the stack we just started would | ||
| # defeat the purpose. | ||
| --up-only) UP_ONLY=1; KEEP_UP=1; shift ;; | ||
| --version) OSS_CONDUCTOR_VERSION="${2:?--version needs a tag}"; shift 2 ;; | ||
| -h|--help) | ||
| echo "Usage: $0 [--up-only] [--keep-up] [--version <tag>] [-- pytest args]" | ||
| exit 0 | ||
| ;; | ||
| --) shift; extra=("$@"); break ;; | ||
| *) echo "Unknown argument: $1" >&2; exit 1 ;; | ||
| esac | ||
| done | ||
|
|
||
| export OSS_CONDUCTOR_VERSION="${OSS_CONDUCTOR_VERSION:-latest}" | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" | ||
| COMPOSE_FILE="${SCRIPT_DIR}/docker-compose-oss.yaml" | ||
| cd "${REPO_ROOT}" | ||
|
|
||
| compose() { docker compose -f "${COMPOSE_FILE}" "$@"; } | ||
|
|
||
| cleanup() { | ||
| if [[ "${KEEP_UP}" == "1" ]]; then | ||
| echo "--keep-up set: leaving the OSS stack running. Tear down with:" | ||
| echo " docker compose -f ${COMPOSE_FILE} down -v" | ||
| return | ||
| fi | ||
| echo "Tearing down Conductor OSS stack..." | ||
| compose down -v || true | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| echo "Using conductoross/conductor:${OSS_CONDUCTOR_VERSION}" | ||
|
|
||
| # `docker compose up` only pulls an image when it is missing locally, so a | ||
| # previously-cached `latest` (or any other mutable tag) would silently be | ||
| # reused instead of getting the current version. Pull unconditionally so the | ||
| # stack always reflects the tag we just printed. | ||
| echo "Pulling conductoross/conductor:${OSS_CONDUCTOR_VERSION} to ensure it's current..." | ||
| compose pull conductor-server | ||
|
|
||
| echo "Starting Conductor OSS stack..." | ||
| compose up -d | ||
|
|
||
| echo "Waiting for Conductor to be healthy..." | ||
| HEALTH_TIMEOUT="${HEALTH_TIMEOUT:-180}" | ||
| deadline=$(( SECONDS + HEALTH_TIMEOUT )) | ||
| until curl -sf http://localhost:8080/health >/dev/null 2>&1; do | ||
| if (( SECONDS >= deadline )); then | ||
| echo "Error: Conductor did not become healthy within ${HEALTH_TIMEOUT}s." >&2 | ||
| compose logs conductor-server || true | ||
| exit 1 | ||
| fi | ||
| sleep 5 | ||
| done | ||
| echo "Conductor is up." | ||
|
|
||
| export CONDUCTOR_SERVER_URL="http://localhost:8080/api" | ||
| export CONDUCTOR_SERVER_TYPE="oss" | ||
|
|
||
| if [[ "${UP_ONLY}" == "1" ]]; then | ||
| echo "--up-only set: stack is up, not running the suite. Point runs at it with:" | ||
| echo " export CONDUCTOR_SERVER_URL=\"${CONDUCTOR_SERVER_URL}\"" | ||
| echo " export CONDUCTOR_SERVER_TYPE=\"${CONDUCTOR_SERVER_TYPE}\"" | ||
| echo " bash scripts/run_integration_tests.sh --bucket=all" | ||
| exit 0 | ||
| fi | ||
|
|
||
| bash scripts/run_integration_tests.sh ${extra[@]+"${extra[@]}"} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be useful here to check if cleanup is happening due to a failure (check
$?) and if so dump the conductor-server logs. this would provide parity with what pull_request.yml does