Skip to content

Commit 68bb74a

Browse files
MichaelGHSegclaude
andcommitted
Add E2E test workflow
Runs sdk-e2e-tests suite against the e2e-cli to verify SDK behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c75e594 commit 68bb74a

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

.github/workflows/e2e-tests.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# E2E Tests for analytics-java
2+
# Copy this file to: analytics-java/.github/workflows/e2e-tests.yml
3+
#
4+
# This workflow:
5+
# 1. Checks out the SDK and sdk-e2e-tests repos
6+
# 2. Builds the SDK and e2e-cli
7+
# 3. Runs the e2e test suite
8+
9+
name: E2E Tests
10+
11+
on:
12+
push:
13+
branches: [main, master]
14+
pull_request:
15+
branches: [main, master]
16+
workflow_dispatch: # Allow manual trigger
17+
18+
jobs:
19+
e2e-tests:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout SDK
24+
uses: actions/checkout@v4
25+
with:
26+
path: sdk
27+
28+
- name: Checkout sdk-e2e-tests
29+
uses: actions/checkout@v4
30+
with:
31+
repository: segmentio/sdk-e2e-tests
32+
path: sdk-e2e-tests
33+
34+
- name: Setup Java
35+
uses: actions/setup-java@v4
36+
with:
37+
distribution: 'temurin'
38+
java-version: '11'
39+
40+
- name: Setup Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: '20'
44+
45+
- name: Build Java SDK and e2e-cli
46+
working-directory: sdk
47+
run: mvn package -pl e2e-cli -am -DskipTests
48+
49+
- name: Find e2e-cli jar
50+
id: find-jar
51+
working-directory: sdk
52+
run: |
53+
JAR_PATH=$(find e2e-cli/target -name "e2e-cli-*-jar-with-dependencies.jar" | head -1)
54+
echo "jar_path=$JAR_PATH" >> $GITHUB_OUTPUT
55+
56+
- name: Install sdk-e2e-tests dependencies
57+
working-directory: sdk-e2e-tests
58+
run: npm ci
59+
60+
- name: Build sdk-e2e-tests
61+
working-directory: sdk-e2e-tests
62+
run: npm run build
63+
64+
- name: Run E2E tests
65+
working-directory: sdk-e2e-tests
66+
env:
67+
CLI_COMMAND: java -jar ${{ github.workspace }}/sdk/${{ steps.find-jar.outputs.jar_path }}
68+
run: npm test
69+
70+
- name: Upload test results
71+
if: always()
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: e2e-test-results
75+
path: sdk-e2e-tests/test-results/
76+
if-no-files-found: ignore

0 commit comments

Comments
 (0)