Skip to content

Commit 7c9c1ba

Browse files
MichaelGHSegclaude
andcommitted
Add e2e-config.json and run-e2e.sh for local E2E testing
Per-SDK config and convenience script for the generic test runner in sdk-e2e-tests. Run ./e2e-cli/run-e2e.sh to build and test locally. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c3e8930 commit 7c9c1ba

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

e2e-cli/e2e-config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"sdk": "java",
3+
"test_suites": "basic",
4+
"auto_settings": false,
5+
"patch": null,
6+
"env": {}
7+
}

e2e-cli/run-e2e.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
#
3+
# Run E2E tests for analytics-java
4+
#
5+
# Prerequisites: Java 11+, Maven, Node.js 18+
6+
#
7+
# Usage:
8+
# ./run-e2e.sh [extra args passed to run-tests.sh]
9+
#
10+
# Override sdk-e2e-tests location:
11+
# E2E_TESTS_DIR=../my-e2e-tests ./run-e2e.sh
12+
#
13+
14+
set -e
15+
16+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17+
SDK_ROOT="$SCRIPT_DIR/.."
18+
E2E_DIR="${E2E_TESTS_DIR:-$SDK_ROOT/../sdk-e2e-tests}"
19+
20+
echo "=== Building analytics-java e2e-cli ==="
21+
22+
# Build SDK and e2e-cli
23+
cd "$SDK_ROOT"
24+
mvn package -pl e2e-cli -am -DskipTests
25+
26+
# Find the built jar
27+
CLI_JAR=$(find "$SDK_ROOT/e2e-cli/target" -name "e2e-cli-*-jar-with-dependencies.jar" | head -1)
28+
if [[ -z "$CLI_JAR" ]]; then
29+
echo "Error: Could not find e2e-cli jar"
30+
exit 1
31+
fi
32+
echo "Found jar: $CLI_JAR"
33+
34+
echo ""
35+
36+
# Run tests
37+
cd "$E2E_DIR"
38+
./scripts/run-tests.sh \
39+
--sdk-dir "$SCRIPT_DIR" \
40+
--cli "java -jar $CLI_JAR" \
41+
"$@"

0 commit comments

Comments
 (0)