-
Notifications
You must be signed in to change notification settings - Fork 2.6k
119 lines (100 loc) · 3.72 KB
/
Copy pathtest-e2e.yml
File metadata and controls
119 lines (100 loc) · 3.72 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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: E2E Tests
on:
push:
branches: [master, v9, 'v9.*']
pull_request:
branches: [master, v9, v9.7, v9.8, 'ndyakov/**', 'ofekshenawa/**', 'ce/**', 'feature/**']
permissions:
contents: read
jobs:
test-e2e-mock:
name: E2E Tests (Mock Proxy)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version:
- stable
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v7
with:
go-version: ${{ matrix.go-version }}
- name: Start Docker services for E2E tests
run: make docker.e2e.start
- name: Wait for services to be ready
run: |
echo "Waiting for Redis to be ready..."
timeout 30 bash -c 'until docker exec redis-standalone redis-cli ping 2>/dev/null; do sleep 1; done'
echo "Waiting for cae-resp-proxy to be ready..."
timeout 30 bash -c 'until curl -s http://localhost:18100/stats > /dev/null; do sleep 1; done'
echo "All services are ready!"
- name: Run E2E tests with mock proxy
env:
E2E_SCENARIO_TESTS: "true"
run: |
go test -v ./maintnotifications/e2e/ -timeout 30m -race
continue-on-error: false
- name: Stop Docker services
if: always()
run: make docker.e2e.stop
- name: Show Docker logs on failure
if: failure()
run: |
echo "=== Redis logs ==="
docker logs redis-standalone 2>&1 | tail -100
echo "=== cae-resp-proxy logs ==="
docker logs cae-resp-proxy 2>&1 | tail -100
echo "=== proxy-fault-injector logs ==="
docker logs proxy-fault-injector 2>&1 | tail -100
test-multidb-e2e:
name: MultiDB E2E Tests (Per-Member Proxies)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version:
- stable
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v7
with:
go-version: ${{ matrix.go-version }}
- name: Start Docker services for MultiDB E2E tests
run: docker compose --profile multidb up -d
- name: Wait for services to be ready
run: |
echo "Waiting for Redis to be ready..."
timeout 30 bash -c 'until docker exec redis-standalone redis-cli ping 2>/dev/null; do sleep 1; done'
echo "Waiting for the per-member proxies to be ready..."
# 127.0.0.1, not localhost: the e2e harness dials 127.0.0.1 because
# IPv6-first hosts resolve localhost to ::1 and can miss Docker's
# IPv4-published ports — the readiness probe must match.
for port in 18120 18121 18122; do
timeout 30 bash -c "until curl -s http://127.0.0.1:$port/stats > /dev/null; do sleep 1; done"
done
echo "All services are ready!"
- name: Run MultiDB E2E tests
env:
E2E_MULTIDB_TESTS: "true"
run: |
go test -v -race -count=1 -timeout 15m ./multidb/e2e/...
continue-on-error: false
# Logs BEFORE the compose down below: `down` removes the containers,
# which would leave the diagnostics step with nothing to read.
- name: Show Docker logs on failure
if: failure()
run: |
echo "=== Redis logs ==="
docker logs redis-standalone 2>&1 | tail -100
for c in cae-proxy-db0 cae-proxy-db1 cae-proxy-db2; do
echo "=== $c logs ==="
docker logs "$c" 2>&1 | tail -100
done
- name: Stop Docker services
if: always()
run: docker compose --profile multidb down