-
Notifications
You must be signed in to change notification settings - Fork 20
654 lines (558 loc) · 25.6 KB
/
advanced.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
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
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
name: advanced testing
env:
AWS_EKS_NAME: tip-wlan-main
AWS_DEFAULT_OUTPUT: json
AWS_DEFAULT_REGION: ap-south-1
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }}
# Cloud SDK certs
CACERT: ${{ secrets.CACERT }}
CAKEY: ${{ secrets.CAKEY }}
ALLURE_CLI_VERSION: 2.14.0
on:
workflow_dispatch:
inputs:
openwifi_revision:
required: true
default: 'main'
description: 'revision of the Open Wifi Helm chart'
ap_models:
required: true
default: 'edgecore_eap104,edgecore_oap101-6e,edgecore_eap101,edgecore_eap102,cig_wf196'
description: 'the AP models to test'
ap_version:
required: true
default: 'next-latest'
description: 'revision of firmware to flash on AP, <branch>-<commit>'
marker_expression:
required: true
default: 'advance'
description: 'Marker expression to select tests to execute'
tests_release:
required: false
default: ""
description: "Tests release branch to use (i.e. 'release/v2.8.0' or 'master'). If left empty, latest release branch is used"
schedule:
- cron: '30 20 * * *'
defaults:
run:
shell: bash
jobs:
vars:
runs-on: ubuntu-latest
outputs:
openwifi_revision: ${{ steps.vars.outputs.openwifi }}
ap_models: ${{ steps.vars.outputs.ap_models }}
ap_version: ${{ steps.vars.outputs.ap_version }}
marker_expression: ${{ steps.vars.outputs.marker_expression }}
existing_controller: ${{ steps.vars.outputs.existing_controller }}
tests_release: ${{ steps.vars.outputs.tests_release }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: set variables
id: vars
run: |
echo "openwifi=$(echo ${{ github.event.inputs.openwifi_revision || 'main' }})" >> $GITHUB_OUTPUT
echo "ap_models=$(echo ${{ github.event.inputs.ap_models || 'edgecore_eap104,edgecore_eap101,cig_wf196' }})" >> $GITHUB_OUTPUT
echo "ap_version=$(echo ${{ github.event.inputs.ap_version || 'next-latest' }})" >> $GITHUB_OUTPUT
echo "marker_expression=$(echo ${{ github.event.inputs.marker_expression || 'advance' }})" >> $GITHUB_OUTPUT
echo "existing_controller=$(echo ${{ github.event.inputs.existing_controller || 'qa01' }})" >> $GITHUB_OUTPUT
DOW=$(date +%u)
SLOT=$(( 10#$DOW % 7 % 2 )) # 0 - slot 1, 1 - slot 2
echo "Current date is $(date --iso-8601=s)"
echo "Current date of week is $DOW which is $(( 10#$DOW % 7 )) in cron notation"
echo "Current slot is $SLOT"
if [[ "$SLOT" -eq "0" ]]; then
echo "Choosing first slot since $SLOT == 0"
AP_MODELS="${{ github.event.inputs.ap_models || 'edgecore_eap104,edgecore_eap101,cig_wf196' }}"
else
echo "Choosing second slot since $SLOT != 0"
AP_MODELS="${{ github.event.inputs.ap_models || 'edgecore_oap101-6e,edgecore_eap102,cig_wf196' }}"
fi
echo "List of AP models to test - $AP_MODELS"
AP_MODELS=$(echo $AP_MODELS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g')
cat >> $GITHUB_OUTPUT << EOF
ap_models=${AP_MODELS}
EOF
LATEST_TESTS_RELEASE=$(git branch -r | grep 'release/v' | sed 's!\s*origin/!!' | tail -1)
if [[ -z "${{ github.event.inputs.tests_release }}" ]]; then
echo "Tests release was not passed, using branch $LATEST_TESTS_RELEASE"
echo "tests_release=$LATEST_TESTS_RELEASE" >> $GITHUB_OUTPUT
else
echo "Tests release was passed - ${{ github.event.inputs.tests_release }}"
echo "tests_release=${{ github.event.inputs.tests_release }}" >> $GITHUB_OUTPUT
fi
cat $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: ["vars"]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ needs.vars.outputs.tests_release }}
- name: build and push Docker image
uses: ./.github/actions/build-and-push-docker
with:
registry: tip-tip-wlan-cloud-docker-repo.jfrog.io
registry_user: ${{ secrets.DOCKER_USER_NAME }}
registry_password: ${{ secrets.DOCKER_USER_PASSWORD }}
test-edgecore-eap104:
runs-on: [ self-hosted, small ]
needs: [ "vars", "build" ]
timeout-minutes: 1440
if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'edgecore_eap104')"
env:
AP_MODEL: edgecore_eap104
steps:
- name: Set AP model output
id: ap_model
run: |
echo "model=${AP_MODEL}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- uses: actions/checkout@v3
- name: install aws CLI tool
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- name: install kubectl
run: |
# TODO WIFI-7839 revert to using stable when issue is resolved on AWS CLI side
curl -s -LO "https://dl.k8s.io/release/v1.27.6/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
- name: get EKS access credentials
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
- name: prepare namespace name
id: namespace
run: |
NAMESPACE="testing-${{ github.run_number }}-${{ matrix.testbed }}"
echo "name=${NAMESPACE}" >> $GITHUB_OUTPUT
- name: prepare configuration
run: |
cat << EOF > lab_info.json
${{ secrets.LAB_INFO_JSON }}
EOF
- name: run tests
uses: ./.github/actions/run-tests
with:
namespace: ${{ steps.namespace.outputs.name }}
testbed: advanced-1
marker_expression: "${{ needs.vars.outputs.marker_expression }}"
configuration_file: "./lab_info.json"
testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }}
additional_args: '-o firmware="${{ needs.vars.outputs.ap_version }}"'
allure_results_artifact_name: "allure-results-${{ steps.ap_model.outputs.model }}"
dns_records_to_resolve: "sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build gw-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build fms-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build"
# necessary because if conditionals in composite actions are currently not respected
- name: get tests logs
if: always()
continue-on-error: true
run: |
podname=$(kubectl get pods -n ${{ steps.namespace.outputs.name }} --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///")
kubectl logs --timestamps -n ${{ steps.namespace.outputs.name }} $podname || true
- name: delete namespace
if: always()
continue-on-error: true
run: kubectl delete ns --ignore-not-found=true --wait ${{ steps.namespace.outputs.name }}
- name: show gw logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owgw
- name: show fms logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owfms
- name: show prov logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owprov
- name: show sec logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owsec
- name: show analytics logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/analytics
- name: show subscription (userportal) logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owsub
test-edgecore-oap101-6e:
runs-on: [ self-hosted, small ]
needs: [ "vars", "build" ]
timeout-minutes: 1440
if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'edgecore_oap101-6e')"
env:
AP_MODEL: edgecore_oap101-6e
steps:
- name: Set AP model output
id: ap_model
run: |
echo "model=${AP_MODEL}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- uses: actions/checkout@v3
- name: install aws CLI tool
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- name: install kubectl
run: |
# TODO WIFI-7839 revert to using stable when issue is resolved on AWS CLI side
curl -s -LO "https://dl.k8s.io/release/v1.27.6/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
- name: get EKS access credentials
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
- name: prepare namespace name
id: namespace
run: |
NAMESPACE="testing-${{ github.run_number }}-${{ matrix.testbed }}"
echo "name=${NAMESPACE}" >> $GITHUB_OUTPUT
- name: prepare configuration
run: |
cat << EOF > lab_info.json
${{ secrets.LAB_INFO_JSON }}
EOF
- name: run tests
uses: ./.github/actions/run-tests
with:
namespace: ${{ steps.namespace.outputs.name }}
testbed: advanced-1
marker_expression: "${{ needs.vars.outputs.marker_expression }}"
configuration_file: "./lab_info.json"
testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }}
additional_args: '-o firmware="${{ needs.vars.outputs.ap_version }}"'
allure_results_artifact_name: "allure-results-${{ steps.ap_model.outputs.model }}"
dns_records_to_resolve: "sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build gw-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build fms-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build"
# necessary because if conditionals in composite actions are currently not respected
- name: get tests logs
if: always()
continue-on-error: true
run: |
podname=$(kubectl get pods -n ${{ steps.namespace.outputs.name }} --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///")
kubectl logs --timestamps -n ${{ steps.namespace.outputs.name }} $podname || true
- name: delete namespace
if: always()
continue-on-error: true
run: kubectl delete ns --ignore-not-found=true --wait ${{ steps.namespace.outputs.name }}
- name: show gw logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owgw
- name: show fms logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owfms
- name: show prov logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owprov
- name: show sec logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owsec
- name: show analytics logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/analytics
- name: show subscription (userportal) logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owsub
test-edgecore-eap101:
runs-on: [ self-hosted, small ]
needs: [ "vars", "build" ]
timeout-minutes: 1440
if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'edgecore_eap101')"
env:
AP_MODEL: edgecore_eap101
steps:
- name: Set AP model output
id: ap_model
run: |
echo "model=${AP_MODEL}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- uses: actions/checkout@v3
- name: install aws CLI tool
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- name: install kubectl
run: |
# TODO WIFI-7839 revert to using stable when issue is resolved on AWS CLI side
curl -s -LO "https://dl.k8s.io/release/v1.27.6/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
- name: get EKS access credentials
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
- name: prepare namespace name
id: namespace
run: |
NAMESPACE="testing-${{ github.run_number }}-${{ matrix.testbed }}"
echo "name=${NAMESPACE}" >> $GITHUB_OUTPUT
- name: prepare configuration
run: |
cat << EOF > lab_info.json
${{ secrets.LAB_INFO_JSON }}
EOF
- name: run tests
uses: ./.github/actions/run-tests
with:
namespace: ${{ steps.namespace.outputs.name }}
testbed: advanced-1
marker_expression: "${{ needs.vars.outputs.marker_expression }}"
configuration_file: "./lab_info.json"
testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }}
additional_args: '-o firmware="${{ needs.vars.outputs.ap_version }}"'
allure_results_artifact_name: "allure-results-${{ steps.ap_model.outputs.model }}"
dns_records_to_resolve: "sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build gw-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build fms-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build"
# necessary because if conditionals in composite actions are currently not respected
- name: get tests logs
if: always()
continue-on-error: true
run: |
podname=$(kubectl get pods -n ${{ steps.namespace.outputs.name }} --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///")
kubectl logs --timestamps -n ${{ steps.namespace.outputs.name }} $podname || true
- name: delete namespace
if: always()
continue-on-error: true
run: kubectl delete ns --ignore-not-found=true --wait ${{ steps.namespace.outputs.name }}
- name: show gw logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owgw
- name: show fms logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owfms
- name: show prov logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owprov
- name: show sec logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owsec
- name: show analytics logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/analytics
- name: show subscription (userportal) logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owsub
test-edgecore-eap102:
runs-on: [ self-hosted, small ]
needs: [ "vars", "build" ]
timeout-minutes: 1440
if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'edgecore_eap102')"
env:
AP_MODEL: edgecore_eap102
steps:
- name: Set AP model output
id: ap_model
run: |
echo "model=${AP_MODEL}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- uses: actions/checkout@v3
- name: install aws CLI tool
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- name: install kubectl
run: |
# TODO WIFI-7839 revert to using stable when issue is resolved on AWS CLI side
curl -s -LO "https://dl.k8s.io/release/v1.27.6/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
- name: get EKS access credentials
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
- name: prepare namespace name
id: namespace
run: |
NAMESPACE="testing-${{ github.run_number }}-${{ matrix.testbed }}"
echo "name=${NAMESPACE}" >> $GITHUB_OUTPUT
- name: prepare configuration
run: |
cat << EOF > lab_info.json
${{ secrets.LAB_INFO_JSON }}
EOF
- name: run tests
uses: ./.github/actions/run-tests
with:
namespace: ${{ steps.namespace.outputs.name }}
testbed: advanced-1
marker_expression: "${{ needs.vars.outputs.marker_expression }}"
configuration_file: "./lab_info.json"
testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }}
additional_args: '-o firmware="${{ needs.vars.outputs.ap_version }}"'
allure_results_artifact_name: "allure-results-${{ steps.ap_model.outputs.model }}"
dns_records_to_resolve: "sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build gw-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build fms-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build"
# necessary because if conditionals in composite actions are currently not respected
- name: get tests logs
if: always()
continue-on-error: true
run: |
podname=$(kubectl get pods -n ${{ steps.namespace.outputs.name }} --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///")
kubectl logs --timestamps -n ${{ steps.namespace.outputs.name }} $podname || true
- name: delete namespace
if: always()
continue-on-error: true
run: kubectl delete ns --ignore-not-found=true --wait ${{ steps.namespace.outputs.name }}
- name: show gw logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owgw
- name: show fms logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owfms
- name: show prov logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owprov
- name: show sec logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owsec
- name: show analytics logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/analytics
- name: show subscription (userportal) logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owsub
test-cig-wf196:
runs-on: [ self-hosted, small ]
needs: [ "vars", "build" ]
timeout-minutes: 1440
if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'cig_wf196')"
env:
AP_MODEL: cig_wf196
steps:
- name: Set AP model output
id: ap_model
run: |
echo "model=${AP_MODEL}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- uses: actions/checkout@v3
- name: install aws CLI tool
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- name: install kubectl
run: |
# TODO WIFI-7839 revert to using stable when issue is resolved on AWS CLI side
curl -s -LO "https://dl.k8s.io/release/v1.27.6/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
- name: get EKS access credentials
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
- name: prepare namespace name
id: namespace
run: |
NAMESPACE="testing-${{ github.run_number }}-${{ matrix.testbed }}"
echo "name=${NAMESPACE}" >> $GITHUB_OUTPUT
- name: prepare configuration
run: |
cat << EOF > lab_info.json
${{ secrets.LAB_INFO_JSON }}
EOF
- name: run tests
uses: ./.github/actions/run-tests
with:
namespace: ${{ steps.namespace.outputs.name }}
testbed: advanced-1
marker_expression: "${{ needs.vars.outputs.marker_expression }}"
configuration_file: "./lab_info.json"
testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }}
additional_args: '-o firmware="${{ needs.vars.outputs.ap_version }}"'
allure_results_artifact_name: "allure-results-${{ steps.ap_model.outputs.model }}"
dns_records_to_resolve: "sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build gw-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build fms-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build"
# necessary because if conditionals in composite actions are currently not respected
- name: get tests logs
if: always()
continue-on-error: true
run: |
podname=$(kubectl get pods -n ${{ steps.namespace.outputs.name }} --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///")
kubectl logs --timestamps -n ${{ steps.namespace.outputs.name }} $podname || true
- name: delete namespace
if: always()
continue-on-error: true
run: kubectl delete ns --ignore-not-found=true --wait ${{ steps.namespace.outputs.name }}
- name: show gw logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owgw
- name: show fms logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owfms
- name: show prov logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owprov
- name: show sec logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owsec
- name: show analytics logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/analytics
- name: show subscription (userportal) logs
if: failure()
run: kubectl -n openwifi-${{ needs.vars.outputs.existing_controller }} logs deployment/owsub
# report
report:
if: "!cancelled()"
runs-on: ubuntu-latest
needs: [ vars, test-edgecore-eap104, test-edgecore-oap101-6e, test-edgecore-eap101, test-edgecore-eap102, test-cig-wf196 ]
strategy:
fail-fast: false
matrix:
model: ${{ fromJson( needs.vars.outputs.ap_models ) }}
steps:
- name: checkout testing repo
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: allure-results-${{ matrix.model }}
path: allure-results
- name: download history of previous run
continue-on-error: true
run: |
LAST_RUN_ID=$(aws s3api head-object --bucket openwifi-allure-reports --key advanced/${{ matrix.model }}/latest/index.html | jq -r .Metadata.latest)
aws s3 cp --recursive s3://openwifi-allure-reports/advanced/${{ matrix.model }}/$LAST_RUN_ID/history history
- name: generate Allure report
uses: ./.github/actions/generate-allure-report
with:
results_path: ./allure-results
history_path: ./history
additional_metadata: |
Ap.Model=${{ matrix.model }}
- name: upload Allure report as artifact
uses: actions/upload-artifact@v3
with:
name: allure-report-${{ matrix.model }}
path: allure-report
# doing this to be able to aggregate multiple reports together later on
- name: copy results into report
run: |
cp -r allure-results allure-report/results
- name: upload to S3
# if: github.ref == 'refs/heads/master' && needs.vars.outputs.marker_expression == 'advance'
uses: ./.github/actions/allure-report-to-s3
with:
test_type: advanced
testbed: ${{ matrix.model }}
report_path: allure-report
s3_access_key_id: ${{ secrets.ALLURE_S3_ACCESS_KEY_ID }}
s3_access_key_secret: ${{ secrets.ALLURE_S3_ACCESS_KEY_SECRET }}
cleanup:
needs: [ test-edgecore-eap104, test-edgecore-oap101-6e, test-edgecore-eap101, test-edgecore-eap102, test-cig-wf196 ]
runs-on: ubuntu-latest
if: always()
steps:
- uses: actions/checkout@v3
- name: cleanup Docker image
uses: ./.github/actions/cleanup-docker
with:
registry_user: ${{ secrets.DOCKER_USER_NAME }}
registry_password: ${{ secrets.DOCKER_USER_PASSWORD }}