Skip to content

E2e cli for cross-SDK tests #2

E2e cli for cross-SDK tests

E2e cli for cross-SDK tests #2

Workflow file for this run

# E2E Tests for analytics-java
# Copy this file to: analytics-java/.github/workflows/e2e-tests.yml
#
# This workflow:
# 1. Checks out the SDK and sdk-e2e-tests repos
# 2. Builds the SDK and e2e-cli
# 3. Runs the e2e test suite
name: E2E Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch: # Allow manual trigger
jobs:
e2e-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout SDK
uses: actions/checkout@v4
with:
path: sdk
- name: Checkout sdk-e2e-tests
uses: actions/checkout@v4
with:
repository: segmentio/sdk-e2e-tests
path: sdk-e2e-tests
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build Java SDK and e2e-cli
working-directory: sdk
run: mvn package -pl e2e-cli -am -DskipTests
- name: Find e2e-cli jar
id: find-jar
working-directory: sdk
run: |
JAR_PATH=$(find e2e-cli/target -name "e2e-cli-*-jar-with-dependencies.jar" | head -1)
echo "jar_path=$JAR_PATH" >> $GITHUB_OUTPUT
- name: Install sdk-e2e-tests dependencies
working-directory: sdk-e2e-tests
run: npm ci
- name: Build sdk-e2e-tests
working-directory: sdk-e2e-tests
run: npm run build
- name: Run E2E tests
working-directory: sdk-e2e-tests
env:
CLI_COMMAND: java -jar ${{ github.workspace }}/sdk/${{ steps.find-jar.outputs.jar_path }}
E2E_TEST_SUITES: basic,retry
# E2E_TEST_SKIP: exponential-backoff # skip specific test files if needed
run: npm test
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-test-results
path: sdk-e2e-tests/test-results/
if-no-files-found: ignore