-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (83 loc) · 2.47 KB
/
e2e-tests.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: End-to-end tests
on:
push:
branches:
- development
pull_request:
branches:
- development
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: dbpwd
POSTGRES_USER: dbuser
POSTGRES_DB: pearl
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/[email protected]
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Build applications
run: |
./scripts/run_dockerized.sh participant
./scripts/run_dockerized.sh admin
- name: Wait for applications to start
run: |
for i in {1..30}; do
participant_status=$(curl -s http://localhost:8080/status | jq -r '.ok')
admin_status=$(curl -s http://localhost:8081/status | jq -r '.ok')
if [ "$participant_status" == "true" ] && [ "$admin_status" == "true" ]; then
echo "Applications are ready"
break
fi
echo "Waiting for applications to start..."
sleep 10
done
if [ "$participant_status" != "true" ] || [ "$admin_status" != "true" ]; then
echo "Application start timed out after 5 minutes"
exit 1
fi
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm -w e2e-tests test
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
e2e-tests/playwright-report/**
e2e-tests/test-results/**
- name: Notify slack on failure
uses: broadinstitute/[email protected]
if: failure() && github.ref == 'refs/heads/development'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
channel: '#juniper-dev-notifications'
status: failure
author_name: End-to-end failed on merge to development
fields: job
text: "End-to-end tests failed :sadpanda:"
username: 'Juniper Build Notifications'