-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (114 loc) · 3.72 KB
/
Copy pathtest-provisioning.yaml
File metadata and controls
138 lines (114 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: CI Test Provisioning
on:
pull_request:
branches:
- main
- develop
- release/*
paths:
- "packages/provisioning-handlers/**"
- "job/compute-worker/**"
- "tests/integration/provisioning-*"
- "tests/e2e/provisioning-*"
- ".github/workflows/test-provisioning.yaml"
push:
branches:
- main
- develop
- release/*
paths:
- "packages/provisioning-handlers/**"
- "job/compute-worker/**"
- "tests/integration/provisioning-*"
- "tests/e2e/provisioning-*"
- ".github/workflows/test-provisioning.yaml"
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# =========================================================================
# UNIT / INTEGRATION (no K8s needed)
# =========================================================================
unit-integration:
name: Provisioning unit & integration
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup pnpm
uses: pnpm/action-setup@v6
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "22"
cache: "pnpm"
- name: Generate function packages
run: node --experimental-strip-types scripts/generate.ts
- name: Install dependencies
run: pnpm install
- name: Build workspace
run: pnpm build
- name: Run provisioning tests
run: |
pnpm jest \
tests/integration/provisioning-registry.test.ts \
tests/integration/provisioning-knative.test.ts \
tests/integration/provisioning-devmode.test.ts \
--no-coverage
# =========================================================================
# E2E with kind cluster (real K8s)
# =========================================================================
e2e-k8s:
name: Provisioning E2E (kind)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup pnpm
uses: pnpm/action-setup@v6
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "22"
cache: "pnpm"
- name: Generate function packages
run: node --experimental-strip-types scripts/generate.ts
- name: Install dependencies
run: pnpm install
- name: Build workspace
run: pnpm build
- name: Setup kind cluster
uses: helm/kind-action@v1
with:
cluster_name: provisioning-test
wait: 120s
- name: Verify cluster
run: |
kubectl version
kubectl get nodes -o wide
- name: Run provisioning E2E tests
env:
K8S_API_URL: http://localhost:8001
run: |
# Start kubectl proxy in background for K8s API access
kubectl proxy --port=8001 &
sleep 2
pnpm jest \
tests/e2e/__tests__/provisioning-seed.e2e.test.ts \
--no-coverage
- name: Dump diagnostics on failure
if: failure()
run: |
echo "=== Namespaces ==="
kubectl get ns || true
echo "=== All resources in test namespaces ==="
for ns in $(kubectl get ns -o jsonpath='{range .items[?(@.metadata.labels.provisioning-test)]}{.metadata.name}{"\n"}{end}' 2>/dev/null); do
echo "--- Namespace: $ns ---"
kubectl get all -n "$ns" || true
kubectl get secrets -n "$ns" || true
done
echo "=== Events ==="
kubectl get events -A --sort-by='.lastTimestamp' | tail -50 || true