|
| 1 | +from pathlib import Path |
| 2 | + |
| 3 | +import yaml |
| 4 | + |
| 5 | + |
| 6 | +WORKFLOW_PATH = ( |
| 7 | + Path(__file__).parents[2] / "workflows" / "opentelemetry-conformance-tests.yml" |
| 8 | +) |
| 9 | +ORCHESTRATOR_REVISION = "4fd176f7ddf696fd57c31ca6a9b23d0ccbbbdc19" |
| 10 | + |
| 11 | + |
| 12 | +def test_opentelemetry_workflow_calls_python_orchestrator() -> None: |
| 13 | + workflow = yaml.safe_load(WORKFLOW_PATH.read_text()) |
| 14 | + job = workflow["jobs"]["opentelemetry"] |
| 15 | + |
| 16 | + assert job["uses"] == ( |
| 17 | + "aws/aws-durable-execution-conformance-tests/.github/workflows/" |
| 18 | + f"opentelemetry-orchestrator.yml@{ORCHESTRATOR_REVISION}" |
| 19 | + ) |
| 20 | + assert job["with"] == { |
| 21 | + "language": "python", |
| 22 | + "resource_prefix": "p", |
| 23 | + "sdk_repository": "aws/aws-durable-execution-sdk-python", |
| 24 | + "sdk_ref": "${{ github.event.pull_request.head.sha || github.sha }}", |
| 25 | + "conformance_test_ref": "${{ inputs.conformance_test_ref || 'main' }}", |
| 26 | + "checkout_sdk": False, |
| 27 | + "contract_test_command": ( |
| 28 | + "hatch run test:all " |
| 29 | + "packages/aws-durable-execution-conformance-tests-otel/" |
| 30 | + "tests/test_python_examples.py" |
| 31 | + ), |
| 32 | + "adot_release_repository": ( |
| 33 | + "aws-observability/aws-otel-python-instrumentation" |
| 34 | + ), |
| 35 | + "collector_compatible_runtime": "python3.13", |
| 36 | + "collector_otlp_endpoint": "http://localhost:4318", |
| 37 | + "suite_timeout_minutes": 30, |
| 38 | + "phase": "${{ inputs.phase || 'short' }}", |
| 39 | + "delay_seconds": "${{ inputs.delay_seconds || '82800' }}", |
| 40 | + "aws_region": "${{ inputs.aws_region || 'us-west-2' }}", |
| 41 | + "otlp_endpoint": "${{ inputs.otlp_endpoint || '' }}", |
| 42 | + } |
| 43 | + assert job["secrets"] == { |
| 44 | + "CONFORMANCE_TEST_ROLE_ARN": "${{ secrets.TEST_ROLE_ARN }}", |
| 45 | + "CONFORMANCE_TEST_ACCOUNT_ID": "${{ secrets.TEST_ACCOUNT_ID }}", |
| 46 | + "CONFORMANCE_TEST_LAMBDA_EXECUTION_ROLE_ARN": ( |
| 47 | + "${{ secrets.TEST_LAMBDA_EXECUTION_ROLE_ARN }}" |
| 48 | + ), |
| 49 | + "DASH0_AUTH_TOKEN": "${{ secrets.DASH0_AUTH_TOKEN }}", |
| 50 | + "DD_API_KEY": "${{ secrets.DD_API_KEY }}", |
| 51 | + "DD_APPLICATION_KEY": "${{ secrets.DD_APPLICATION_KEY }}", |
| 52 | + "DATADOG_OTLP_HEADERS": "${{ secrets.DATADOG_OTLP_HEADERS }}", |
| 53 | + } |
0 commit comments