Repository navigation
449 lines (405 loc) · 12.3 KB
/
Copy pathci.yml
File metadata and controls
449 lines (405 loc) · 12.3 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
name: CI
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- '**.yaml'
- '**.yml'
- '**.sh'
- '.github/**'
- '**.html'
- '**.css'
- 'docs/**'
- '**/Makefile'
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- '**.yaml'
- '**.yml'
- '**.sh'
- '.github/**'
- 'docs/**'
- '**.html'
- '**.css'
- '**/Makefile'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- name: Setup environment
uses: ./.github/actions/setup-env
with:
cache-precommit: "true"
- name: Run linters
env:
SKIP: no-commit-to-branch
run: |
source .venv/bin/activate
make lint
unit-tests:
name: "Unit tests: ${{ matrix.component }}"
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
strategy:
fail-fast: false
matrix:
component:
- asya-crew
- asya-gateway
- asya-lab
- asya-runtime
- asya-sidecar
- asya-state-proxy
- asya-testing
- asya-ui
steps:
- uses: actions/checkout@v6
- name: Setup environment
uses: ./.github/actions/setup-env
- name: Run unit tests
run: |
source .venv/bin/activate
make -C src/${{ matrix.component }} test-unit
- name: Upload unit test coverage
uses: actions/upload-artifact@v7
if: always()
with:
name: coverage-unit-${{ matrix.component }}
path: .coverage/
retention-days: 1
include-hidden-files: true
if-no-files-found: ignore
compression-level: 0
component-tests:
name: "Component tests: ${{ matrix.name }}"
runs-on: ubuntu-latest
timeout-minutes: 15
# needs: [lint, unit-tests]
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
# Flow compiler component tests (pure Python, no Docker)
- name: flow-compiler
component: flow-compiler
config_var: _UNUSED
config_value: default
# Mesh-API component tests
- name: mesh-api (sqs)
component: mesh-api
config_var: ASYA_TRANSPORT
config_value: sqs
# Runtime component tests
- name: runtime
component: runtime
config_var: ASYA_TRANSPORT
config_value: sqs
# Sidecar component tests - test both transports
- name: sidecar (sqs)
component: sidecar
config_var: ASYA_TRANSPORT
config_value: sqs
- name: sidecar (rabbitmq)
component: sidecar
config_var: ASYA_TRANSPORT
config_value: rabbitmq
# State proxy component tests - test all connector profiles
- name: state-proxy (s3-lww)
component: state-proxy
config_var: CONNECTOR_PROFILE
config_value: s3-lww
- name: state-proxy (s3-passthrough)
component: state-proxy
config_var: CONNECTOR_PROFILE
config_value: s3-passthrough
- name: state-proxy (s3-cas)
component: state-proxy
config_var: CONNECTOR_PROFILE
config_value: s3-cas
- name: state-proxy (redis-cas)
component: state-proxy
config_var: CONNECTOR_PROFILE
config_value: redis-cas
steps:
- uses: actions/checkout@v6
- name: Setup environment
uses: ./.github/actions/setup-env
with:
install-docker: "true"
- name: Build Docker images
run: make build-images
- name: Run component tests
run: |
source .venv/bin/activate
make -C testing/component/${{ matrix.component }} test-one ${{ matrix.config_var }}=${{ matrix.config_value }}
- name: Upload component test coverage
uses: actions/upload-artifact@v7
if: always()
with:
name: coverage-component-${{ matrix.component }}-${{ matrix.config_value }}
path: .coverage/
retention-days: 1
include-hidden-files: true
if-no-files-found: ignore
compression-level: 0
integration-tests:
name: "Integration tests: ${{ matrix.name }}"
runs-on: ubuntu-latest
timeout-minutes: 30
# needs: [component-tests]
permissions:
contents: read
env:
ASYA_TRANSPORT: ${{ matrix.transport }}
ASYA_STORAGE: ${{ matrix.storage }}
strategy:
fail-fast: false
matrix:
include:
# Simple integration tests (no parametrization)
- name: sidecar
target: sidecar
transport: ""
storage: ""
- name: stateful-actors
target: stateful-actors
transport: ""
storage: ""
# Sidecar-runtime tests (2 transports)
##rabbitmq - disabled for now to save resources
# - name: sidecar-runtime (rabbitmq)
# target: sidecar-runtime
# transport: rabbitmq
- name: sidecar-runtime (sqs)
target: sidecar-runtime
transport: sqs
storage: ""
- name: sidecar-runtime (pubsub)
target: sidecar-runtime
transport: pubsub
storage: ""
# Gateway-actors tests — disabled pending rewrite for mesh-api routes
# (old tests use /tools/call and /mesh/{id} which don't exist in new arch)
# - name: gateway-actors (sqs-s3)
# target: gateway-actors
# transport: sqs
# storage: s3
# - name: gateway-actors (pubsub-gcs)
# target: gateway-actors
# transport: pubsub
# storage: gcs
steps:
- uses: actions/checkout@v6
- name: Setup environment
uses: ./.github/actions/setup-env
with:
install-docker: "true"
- name: Build Docker images
run: make build-images
- name: Run simple integration tests
if: matrix.target == 'sidecar'
run: |
source .venv/bin/activate
make -C testing/integration/${{ matrix.target }} test
- name: Run 2-parametrized integration tests (sidecar-runtime)
if: matrix.target == 'sidecar-runtime'
run: |
source .venv/bin/activate
make -C testing/integration/${{ matrix.target }} test-one
- name: Run 3-parametrized integration tests (gateway-actors)
if: matrix.target == 'gateway-actors'
run: |
source .venv/bin/activate
make -C testing/integration/${{ matrix.target }} test-one
- name: Upload integration test coverage
uses: actions/upload-artifact@v7
if: always()
with:
name: coverage-integration-${{ matrix.target }}-${{ matrix.transport || 'default' }}-${{ matrix.storage || 'none'
}}
path: .coverage/
retention-days: 1
include-hidden-files: true
if-no-files-found: ignore
compression-level: 0
e2e-tests:
name: "E2E tests: ${{ matrix.name }}"
runs-on: ubuntu-latest
timeout-minutes: 90
# needs: [integration-tests]
permissions:
contents: read
env:
PROFILE: ${{ matrix.profile }}
strategy:
fail-fast: false
matrix:
include:
- name: sqs-s3-pvc
profile: sqs-s3-pvc
run_pipeline: true
run_crossplane: true
- name: pubsub-gcs-pg
profile: pubsub-gcs-pg
run_pipeline: true
run_crossplane: true
## For now, focusing on SQS+S3 only
# - name: rabbitmq-minio-pg
# profile: rabbitmq-minio-pg
# run_pipeline: true
# run_crossplane: true
steps:
- uses: actions/checkout@v6
- name: Setup environment
uses: ./.github/actions/setup-env
with:
install-kind: "true"
install-helm: "true"
- name: Clean up any existing Kind clusters
run: |
kind delete cluster --name chart-testing || true
kind delete cluster --name asya-e2e-${{ matrix.profile }} || true
- name: Deploy E2E cluster
env:
CLUSTER_NAME: asya-e2e-${{ matrix.profile }}
PROFILE: ${{ matrix.profile }}
run: |
./testing/e2e/scripts/deploy.sh
- name: "Run E2E tests: crossplane"
if: matrix.run_crossplane
continue-on-error: true
id: e2e-crossplane
env:
ASYA_LOG_LEVEL: INFO
run: |
source .venv/bin/activate
cd testing/e2e
make test-crossplane
- name: "Run E2E tests: regular"
if: matrix.run_pipeline
continue-on-error: true
id: e2e-regular
env:
ASYA_LOG_LEVEL: INFO
run: |
source .venv/bin/activate
cd testing/e2e
make trigger-tests PYTEST_OPTS="-v --log-cli-level=INFO -m 'not chaos' --ignore=tests/test_crossplane_e2e.py"
- name: "Run E2E tests: chaos"
if: matrix.run_pipeline
continue-on-error: true
id: e2e-chaos
env:
ASYA_LOG_LEVEL: INFO
run: |
source .venv/bin/activate
cd testing/e2e
make trigger-tests PYTEST_OPTS="-v --log-cli-level=INFO -m chaos --ignore=tests/test_crossplane_e2e.py"
- name: Check if e2e tests succeeded
if: always()
run: |
FAILED=0
if [[ "${{ steps.e2e-crossplane.outcome }}" == "failure" ]]; then
echo "[-] E2E test suite failed: crossplane"
FAILED=1
fi
if [[ "${{ steps.e2e-regular.outcome }}" == "failure" ]]; then
echo "[-] E2E test suite failed: regular"
FAILED=1
fi
if [[ "${{ steps.e2e-chaos.outcome }}" == "failure" ]]; then
echo "[-] E2E test suite failed: chaos"
FAILED=1
fi
if [[ $FAILED -eq 1 ]]; then
exit 1
fi
echo "[+] All E2E test suites passed"
- name: Cleanup E2E cluster
if: always()
run: |
kind delete cluster --name asya-e2e-${{ matrix.profile }} || true
- name: Upload E2E test coverage
uses: actions/upload-artifact@v7
if: always()
with:
name: coverage-e2e-${{ matrix.profile }}
path: .coverage/
retention-days: 1
include-hidden-files: true
if-no-files-found: ignore
compression-level: 0
coverage-report:
name: Generate coverage report
runs-on: ubuntu-latest
needs: [unit-tests, component-tests, integration-tests, e2e-tests]
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v6
- name: Download all unit test coverage
uses: actions/download-artifact@v8
with:
pattern: coverage-unit-*
path: .coverage
merge-multiple: true
- name: Download all component test coverage
uses: actions/download-artifact@v8
with:
pattern: coverage-component-*
path: .coverage
merge-multiple: true
- name: Download all integration test coverage
uses: actions/download-artifact@v8
with:
pattern: coverage-integration-*
path: .coverage
merge-multiple: true
- name: Download all E2E test coverage
uses: actions/download-artifact@v8
with:
pattern: coverage-e2e-*
path: .coverage
merge-multiple: true
- name: Debug coverage files
run: |
echo "[.] Checking downloaded coverage files:"
if [ -d .coverage ]; then
COVERAGE_FILES=$(find .coverage -type f \( -name "*.out" -o -name "*.json" \) | wc -l)
if [ "$COVERAGE_FILES" -gt 0 ]; then
echo "[+] Found $COVERAGE_FILES coverage files"
find .coverage -type f \( -name "*.out" -o -name "*.json" \)
else
echo "[!] No coverage files found in .coverage directory"
fi
echo ""
echo "[.] .coverage directory structure:"
find .coverage -type d | head -50
echo ""
echo "[.] All files in .coverage:"
find .coverage -type f | head -100
else
echo "[!] .coverage directory not found"
fi
- name: Generate coverage report and comment on PR
uses: k1LoW/octocov-action@v1
with:
github-token: ${{ github.token }}
config: .octocov.yml
env:
DEBUG: "1"