-
Notifications
You must be signed in to change notification settings - Fork 1
161 lines (137 loc) · 4.09 KB
/
test-e2e-client.yml
File metadata and controls
161 lines (137 loc) · 4.09 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Test Client E2E (Per Operator)
on:
push:
branches: [main]
paths:
- "packages/client/**"
- "packages/ops/**"
- "packages/manifests/**"
- ".github/workflows/test-e2e-client.yml"
pull_request:
branches: [main]
paths:
- "packages/client/**"
- "packages/ops/**"
- "packages/manifests/**"
- ".github/workflows/test-e2e-client.yml"
workflow_dispatch:
jobs:
e2e-operators:
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
operator:
- ingress-nginx
- cert-manager
- knative-serving
- cloudnative-pg
- kube-prometheus-stack
- minio-operator
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup kubectl
uses: azure/setup-kubectl@v3
with:
version: v1.31.3
- name: Setup Kind cluster
uses: helm/kind-action@v1.12.0
with:
cluster_name: kind
kubectl_version: v1.31.3
wait: 300s
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.12.2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build packages (excluding ops dashboard)
run: pnpm --filter='!@kubernetesjs/ops-dashboard' build
- name: Verify cluster connection
run: |
kubectl cluster-info
kubectl get nodes -o wide
kubectl get namespaces
- name: Start kubectl proxy
run: |
kubectl proxy --port=8001 --accept-hosts='^.*$' --address='0.0.0.0' &
echo "PROXY_PID=$!" >> $GITHUB_ENV
sleep 5
curl -f http://127.0.0.1:8001/api || (echo 'proxy failed' && exit 1)
- name: Run e2e per-operator test
run: |
cd packages/client
pnpm run tests:e2e -- --runInBand --testPathPattern e2e.setup.operator.test.ts
env:
K8S_API: http://127.0.0.1:8001
OPERATOR: ${{ matrix.operator }}
NODE_ENV: test
- name: Cluster state after job
if: always()
run: |
echo '=== Namespaces ==='
kubectl get namespaces
echo '=== Pods ==='
kubectl get pods -A -o wide
e2e-postgres:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup kubectl
uses: azure/setup-kubectl@v3
with:
version: v1.31.3
- name: Setup Kind cluster
uses: helm/kind-action@v1.12.0
with:
cluster_name: kind
kubectl_version: v1.31.3
wait: 300s
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.12.2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build packages (excluding ops dashboard)
run: pnpm --filter='!@kubernetesjs/ops-dashboard' build
- name: Verify cluster connection
run: |
kubectl cluster-info
kubectl get nodes -o wide
kubectl get namespaces
- name: Start kubectl proxy
run: |
kubectl proxy --port=8001 --accept-hosts='^.*$' --address='0.0.0.0' &
echo "PROXY_PID=$!" >> $GITHUB_ENV
sleep 5
curl -f http://127.0.0.1:8001/api || (echo 'proxy failed' && exit 1)
- name: Run Postgres E2E
run: |
cd packages/client
pnpm run tests:e2e -- --runInBand --testPathPattern e2e.postgres.test.ts
env:
K8S_API: http://127.0.0.1:8001
NODE_ENV: test
- name: Cluster state after job
if: always()
run: |
echo '=== Namespaces ==='
kubectl get namespaces
echo '=== Pods ==='
kubectl get pods -A -o wide