Skip to content

feat(otel): Add X-Ray e2e integration tests for span validation #903

feat(otel): Add X-Ray e2e integration tests for span validation

feat(otel): Add X-Ray e2e integration tests for span validation #903

Workflow file for this run

name: E2E Tests
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- '.github/**' # for testing Github Actions
- 'sdk/**'
- 'sdk-testing/**'
- 'sdk-integration-tests/**'
- 'examples/**'
- 'pom.xml'
push:
branches:
- main
paths:
- '.github/**'
- 'sdk/**'
- 'sdk-testing/**'
- 'sdk-integration-tests/**'
- 'examples/**'
- 'pom.xml'
concurrency:
group: e2e-tests
cancel-in-progress: false
# permission can be added at job level or workflow level
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
e2e-tests:
env:
AWS_REGION: us-west-2
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java:
- 17
- 21
- 25
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup AWS SAM CLI
uses: aws-actions/setup-sam@v3
with:
use-installer: true
# token: ${{ secrets.GITHUB_TOKEN }} # only enable if we run into throughput issues
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6.2.0
with:
role-to-assume: "${{ secrets.ACTIONS_INTEGRATION_ROLE_NAME }}"
role-session-name: java-language-sdk-test
aws-region: ${{ env.AWS_REGION }}
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v5
with:
distribution: corretto
java-version: ${{ matrix.java }}
cache: maven
- name: Build locally
run: mvn -B -q -Dmaven.test.skip=true install --file pom.xml
- name: Mask sensitive values
run: |
echo "::add-mask::${{ secrets.DURABLE_INTEGRATION_TEST_ROLE_ARN }}"
echo "::add-mask::${{ secrets.ACTIONS_INTEGRATION_ROLE_NAME }}"
# Mask the AWS account ID extracted from the role ARN
ACCOUNT_ID=$(echo "${{ secrets.DURABLE_INTEGRATION_TEST_ROLE_ARN }}" | grep -oE '[0-9]{12}' | head -1)
if [ -n "$ACCOUNT_ID" ]; then
echo "::add-mask::$ACCOUNT_ID"
fi
- name: sam build
run: | # add --no-cached if debugging sam build
sam build --parameter-overrides \
'ParameterKey=Architecture,ParameterValue=x86_64 ParameterKey=JavaVersion,ParameterValue=java${{ matrix.java }} ParameterKey=RoleArn,ParameterValue=${{ secrets.DURABLE_INTEGRATION_TEST_ROLE_ARN }}'
working-directory: ./examples
- name: sam deploy
run: |
STACK_NAME="JavaSDKCloudBasedIntegrationTestStack-Java${{ matrix.java }}Runtime"
sam deploy --no-progressbar --disable-rollback \
--stack-name "$STACK_NAME" \
--resolve-image-repos --resolve-s3 --parameter-overrides \
'ParameterKey=Architecture,ParameterValue=x86_64 ParameterKey=JavaVersion,ParameterValue=java${{ matrix.java }} ParameterKey=RoleArn,ParameterValue=${{ secrets.DURABLE_INTEGRATION_TEST_ROLE_ARN }}' \
> /dev/null 2>&1 || true
# Check stack status and surface a safe error summary
STACK_STATUS=$(aws cloudformation describe-stacks \
--stack-name "$STACK_NAME" \
--query 'Stacks[0].StackStatus' --output text 2>/dev/null || echo "UNKNOWN")
echo "Stack status: $STACK_STATUS"
if [[ "$STACK_STATUS" != *"COMPLETE"* ]] || [[ "$STACK_STATUS" == *"ROLLBACK"* ]]; then
echo "::error::Deployment failed with stack status: $STACK_STATUS"
# Show failed resources without exposing full error messages
aws cloudformation describe-stack-events \
--stack-name "$STACK_NAME" \
--query 'StackEvents[?ResourceStatus==`CREATE_FAILED` || ResourceStatus==`UPDATE_FAILED`].[LogicalResourceId, ResourceStatus, ResourceType]' \
--output table 2>/dev/null || true
exit 1
fi
working-directory: ./examples
- name: Cloud Based Integration Tests
run: mvn clean test -B -Dtest.cloud.enabled=true -Dtest=CloudBasedIntegrationTest -Dtest.function.name.suffix='-java${{ matrix.java }}-runtime'
working-directory: ./examples