-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe2e-test.sh
More file actions
executable file
·51 lines (38 loc) · 1.35 KB
/
e2e-test.sh
File metadata and controls
executable file
·51 lines (38 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Download artifacts from latest successful CI run and run E2E tests
set -e
echo "Fetching latest successful PR Check run..."
RUN_ID=$(gh run list --branch bank-parser-demo --limit 10 --json databaseId,name,conclusion,workflowName | jq -r '.[] | select(.name == "PR Check" and .conclusion == "success") | .databaseId' | head -1)
if [ -z "$RUN_ID" ]; then
echo "No successful PR Check run found. Exiting."
exit 1
fi
echo "Downloading artifacts from run $RUN_ID..."
gh run download $RUN_ID --dir ./artifacts
# Check if artifacts exist
if [ ! -f "./artifacts/sensible-folio-server/sensible-folio-server" ]; then
echo "Server binary not found in artifacts."
exit 1
fi
if [ ! -d "./artifacts/frontend-build" ]; then
echo "Frontend build not found in artifacts."
exit 1
fi
# Make server binary executable
chmod +x ./artifacts/sensible-folio-server/sensible-folio-server
# Set environment variables for server
export WF_SECRET_KEY="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
export WF_DB_PATH="/tmp/test.db"
export WF_STATIC_DIR="./artifacts/frontend-build"
# Start server in background
echo "Starting server..."
./artifacts/sensible-folio-server/sensible-folio-server &
SERVER_PID=$!
# Wait for server to start
sleep 5
# Run E2E tests using existing script
echo "Running E2E tests..."
pnpm test:e2e
# Kill server
kill $SERVER_PID
echo "E2E tests completed."