forked from cloud-bulldozer/orion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.bats
More file actions
917 lines (762 loc) · 39.3 KB
/
test.bats
File metadata and controls
917 lines (762 loc) · 39.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
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
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
#!/usr/bin/env bats
# vi: ft=bash
# shellcheck disable=SC2086,SC2030,SC2031,SC2164
run_cmd(){
echo "$@"
set +e
"${@}"
EXIT_CODE=$?
set -e
if [ $EXIT_CODE -eq 2 ]; then
echo "Exit code 2 encountered, regression detected, treating as success"
return 0
elif [ $EXIT_CODE -eq 3 ]; then
echo "Exit code 3 encountered, not enough data, treating as success"
return 0
else
return $EXIT_CODE
fi
}
setup() {
ES_SERVER="$QE_ES_SERVER"
METADATA_INDEX="perf_scale_ci*"
BENCHMARK_INDEX="ripsaw-kube-burner*"
KRKN_BENCHMARK_INDEX=krkn-metrics*
KRKEN_METADATA_INDEX=krkn-telemetry*
LATEST_VERSION=$(curl -s -X POST "$ES_SERVER/perf_scale_ci*/_search" \
-H "Content-Type: application/json" \
-d '{
"size": 0,
"query": {
"bool": {
"must": [
{
"range": {
"timestamp": {
"gte": "now-1M/M",
"lt": "now/M"
}
}
}
],
"must_not": [
{ "wildcard": { "releaseStream.keyword": "*nightly*" } },
{ "wildcard": { "releaseStream.keyword": "*rc*" } },
{ "wildcard": { "releaseStream.keyword": "*ci*" } },
{ "wildcard": { "releaseStream.keyword": "*ec*" } },
{ "wildcard": { "releaseStream.keyword": "*okd*" } }
]
}
},
"aggs": {
"distinct_versions": {
"terms": {
"field": "releaseStream.keyword",
"order": { "_key": "desc" }
}
}
}
}' | jq -r '.aggregations.distinct_versions.buckets[0].key')
export VERSION=$(echo "$LATEST_VERSION" | cut -d. -f1,2)
CHAOS_LATEST_VERSION=$(curl -s -X POST "$ES_SERVER/krkn-telemetry*/_search" \
-H "Content-Type: application/json" \
-d '{
"size": 0,
"query": {
"bool": {
"must": [
{
"range": {
"timestamp": {
"gte": "now-1M/M",
"lt": "now/M"
}
}
}
],
"filter": [
{
"match_phrase": {
"scenarios.scenario_type.keyword": "node_scenarios"
}
}
]
}
},
"aggs": {
"distinct_versions": {
"terms": {
"field": "cluster_version.keyword",
"order": { "_key": "desc" }
}
}
}
}' | jq -r '.aggregations.distinct_versions.buckets[0].key')
export chaos_version=$(echo "$CHAOS_LATEST_VERSION" | cut -d'.' -f1,2)
echo "chaos version $chaos_version"
OLS_LATEST_VERSION=$(curl -s -X POST "$ES_SERVER/perf_scale_ci*/_search" \
-H "Content-Type: application/json" \
-d '{
"size": 0,
"query": {
"bool": {
"must": [
{
"range": {
"timestamp": {
"gte": "now-1M/M",
"lt": "now/M"
}
}
},
{
"match_phrase": {
"benchmark.keyword": "ols-load-generator"
}
}
]
}
},
"aggs": {
"distinct_versions": {
"terms": {
"field": "ocpVersion.keyword",
"order": { "_key": "desc" }
}
}
}
}' | jq -r '.aggregations.distinct_versions.buckets[0].key')
export ols_version=$(echo "$OLS_LATEST_VERSION" | cut -d'.' -f1,2)
curl -fsSL https://raw.githubusercontent.com/openshift/ols-load-generator/main/ack/4.16_ols-load-generator-10w_ack.yaml -o /tmp/4.16_ols-load-generator-10w_ack.yaml
QUAY_LATEST_VERSION=$(curl -s -X POST "$QUAY_QE_ES_SERVER/perf_scale_ci*/_search" \
-H "Content-Type: application/json" \
-d '{
"size": 0,
"query": {
"range": {
"timestamp": {
"gte": "now-3M/M",
"lt": "now"
}
}
},
"aggs": {
"latest_version": {
"terms": {
"field": "quayVersion.keyword",
"size": 1,
"order": { "_key": "desc" },
"exclude": "quayio-stage.*"
}
}
}
}' | jq -r '.aggregations.latest_version.buckets[0].key')
export quay_version=$(echo "$QUAY_LATEST_VERSION" | cut -d'.' -f1,2)
}
@test "orion label small scale cluster density with hunter-analyze" {
run_cmd orion --config "examples/label-small-scale-cluster-density.yaml" --lookback 45d --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion label small scale cluster density with hunter-analyze and using env vars for ES" {
export ES_SERVER=${ES_SERVER} es_metadata_index=${METADATA_INDEX} es_benchmark_index=${BENCHMARK_INDEX}
run_cmd orion --config "examples/label-small-scale-cluster-density.yaml" --lookback 45d --hunter-analyze --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion payload scale" {
run_cmd orion --config "examples/payload-scale.yaml" --lookback 45d --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion payload scale without lookback period" {
run_cmd orion --config "examples/payload-scale.yaml" --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion readout control plane cdv2 with text output " {
run_cmd orion --config "examples/label-small-scale-cluster-density.yaml" --hunter-analyze --output-format text --save-output-path=./outputs/output.txt --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX}
}
@test "orion label small control plane cdv2 with json output " {
run_cmd orion --config "examples/label-small-scale-cluster-density.yaml" --hunter-analyze --output-format json --save-output-path=./outputs/output.json --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX}
}
@test "orion readout control plane node-density with json output and match all iterations " {
run_cmd orion --config "examples/small-rosa-control-plane-node-density.yaml" --hunter-analyze --output-format json --save-output-path=./outputs/output.json --node-count True --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX}
}
@test "orion readout netperf tcp with junit output" {
run_cmd orion --config "examples/readout-netperf-tcp.yaml" --output-format junit --hunter-analyze --save-output-path=./outputs/output.xml --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=k8s-netperf --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion virt-density" {
run_cmd orion --config examples/metal-perfscale-cpt-virt-density.yaml --lookback 45d --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion k8s-netperf virt-datapath" {
run_cmd orion --config examples/metal-perfscale-cpt-virt-datapath.yaml --lookback 45d --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion virt-density-nomount" {
run_cmd orion --config examples/metal-perfscale-cpt-virt-density-nomount.yaml --lookback 45d --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion small scale cluster density with anomaly detection" {
run_cmd orion --config "examples/small-scale-cluster-density.yaml" --lookback 45d --anomaly-detection --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion small scale node density cni anomaly detection with a window" {
run_cmd orion --config "examples/small-scale-node-density-cni.yaml" --anomaly-detection --anomaly-window 3 --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion trt external payload cluster density" {
run_cmd orion --config "examples/trt-external-payload-cluster-density.yaml" --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion trt external payload cluster density for pull" {
run_cmd orion --config "examples/trt-external-payload-cluster-density.yaml" --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'", "jobType": "pull", "pullNumber": "70897"}'
}
@test "orion trt external payload cluster density for periodic from a pull" {
run_cmd orion --config "examples/trt-external-payload-cluster-density.yaml" --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'", "jobType": "periodic", "pullNumber": "70897"}'
}
@test "orion trt external payload node density" {
run_cmd orion --config "examples/trt-external-payload-node-density.yaml" --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}'
}
@test "orion trt external payload node density json" {
run_cmd orion --config "examples/trt-external-payload-node-density.yaml" --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}' --output-format json
}
@test "orion trt external payload node density junit" {
run_cmd orion --config "examples/trt-external-payload-node-density.yaml" --hunter-analyze --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}' --output-format junit
}
@test "orion trt external payload node density json with lookback" {
run_cmd orion --config "examples/trt-external-payload-node-density.yaml" --hunter-analyze --lookback 15d --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}' --output-format json
}
@test "orion trt external payload node density junit with lookback" {
run_cmd orion --config "examples/trt-external-payload-node-density.yaml" --hunter-analyze --lookback 15d --es-server=${ES_SERVER} --metadata-index=${METADATA_INDEX} --benchmark-index=${BENCHMARK_INDEX} --input-vars='{"version": "'${VERSION}'"}' --output-format junit
}
@test "orion chaos tests " {
before_version=$version
run_tag="cr" fips_enabled="false" etcd_enabled="false" ipsec_enabled="false" scenario_type="pvc_scenarios" cloud_infrastructure="aws" cloud_type="self-managed" total_node_count="9" node_instance_type="m6a.xlarge" network_plugins="OVNKubernetes" scenario_file="*pvc_scenario.yaml" run_cmd orion --config "examples/chaos_tests.yaml" --lookback 45d --es-server=${ES_SERVER} --metadata-index=${KRKEN_METADATA_INDEX} --benchmark-index=${KRKN_BENCHMARK_INDEX} --input-vars='{"version": "'${chaos_version}'"}' --output-format text
VERSION=$before_version
}
@test "orion node scenarios " {
before_version=$version
VERSION=$chaos_version
run_tag="" fips_enabled="false" etcd_enabled="false" ipsec_enabled="false" label_selector="node-role.kubernetes.io/control-plane=" scenario_type="node_scenarios" cloud_infrastructure="AWS" cloud_type="self-managed" total_node_count="9" node_instance_type="*xlarge*" network_plugins="OVNKubernetes" scenario_file="*node_scenario.yaml" run_cmd orion --config "examples/node_scenarios.yaml" --lookback 45d --es-server=${ES_SERVER} --metadata-index=${KRKEN_METADATA_INDEX} --benchmark-index=${KRKN_BENCHMARK_INDEX}
VERSION=$before_version
}
@test "orion pod disruption scenarios " {
before_version=$version
VERSION=$chaos_version
run_tag="cr" fips_enabled="false" etcd_enabled="false" ipsec_enabled="false" pod_namespace="openshift-etcd" label_selector="k8s-app=etcd" scenario_type="pod_disruption_scenarios" cloud_infrastructure="AWS" cloud_type="self-managed" total_node_count="9" node_instance_type="*xlarge*" network_plugins="OVNKubernetes" scenario_file="*pod_scenario.yaml" run_cmd orion --config "examples/pod_disruption_scenarios.yaml" --lookback 45d --es-server=${ES_SERVER} --metadata-index=${KRKEN_METADATA_INDEX} --benchmark-index=${KRKN_BENCHMARK_INDEX} --hunter-analyze
VERSION=$before_version
}
@test "orion ols configuration test " {
before_version=$version
VERSION=$ols_version
export ols_test_workers=10
es_metadata_index="perf_scale_ci*" es_benchmark_index="ols-load-test-results*" run_cmd orion --config "examples/ols-load-generator.yaml" --hunter-analyze --ack /tmp/4.16_ols-load-generator-10w_ack.yaml --es-server=${ES_SERVER}
VERSION=$before_version
}
@test "orion with --no-default-ack disables default ACK loading" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' --no-default-ack 2>&1 | tee ./outputs/results-no-default-ack.txt
EXIT_CODE=$?
set -e
if ! grep -q "default ACK loading disabled" ./outputs/results-no-default-ack.txt; then
echo "Expected 'default ACK loading disabled' in output when using --no-default-ack"
exit 1
fi
}
@test "orion auto-loads ack/all_ack.yaml when present" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' 2>&1 | tee ./outputs/results-ack-auto.txt
EXIT_CODE=$?
set -e
if [ ! -f ack/all_ack.yaml ]; then
skip "ack/all_ack.yaml not present, skipping auto-load test"
fi
if ! grep -q "all_ack.yaml" ./outputs/results-ack-auto.txt; then
echo "Expected orion to mention all_ack.yaml when auto-loading ACK"
exit 1
fi
}
@test "orion with quay config " {
export quay_image_push_pull_index="quay-push-pull*"
export quay_load_test_index="quay-vegeta-results*"
export es_metadata_index=${METADATA_INDEX}
run_cmd orion --node-count false --config "examples/quay-load-test-stable.yaml" --hunter-analyze --es-server=${QUAY_QE_ES_SERVER} --output-format junit --save-output-path=./outputs/junit.xml --collapse --input-vars='{"quay_version": "'${quay_version}'", "ocp_version": "4.18"}'
}
@test "orion with quay stage config " {
export quay_image_push_pull_index="quay-push-pull*"
export es_metadata_index=${METADATA_INDEX}
run_cmd orion --node-count false --config "examples/quay-load-test-stable-stage.yaml" --hunter-analyze --es-server=${QUAY_QE_ES_SERVER} --output-format junit --save-output-path=./outputs/junit.xml --collapse --input-vars='{"quay_version": "quayio-stage", "ocp_version": "4.18"}'
}
@test "orion version check" {
set +e
version=$(orion --version)
echo $version
expected_tag=$(git tag -l | sort -V | tail -1)
expected_tag=${expected_tag#v}
if [[ -z $expected_tag ]]; then
expected_tag=0.0
fi
expected_version="orion ${expected_tag}"
last_commit=$(git rev-parse --short=7 HEAD)
describe=$(git describe --tags --dirty --always)
if [[ "$describe" == *"$last_commit"* ]]; then
echo "Is ahead of Tag adding '.post1.dev'"
expected_version+=".post1.dev"
fi
if [[ "$describe" == *"dirty"* ]]; then
if [[ ! "$version" == *"+dirty"* ]]; then
echo "Failed checking for dirty append"
exit 1
fi
fi
echo $expected_version
if [[ ! "$version" == *"$expected_version"* ]]; then
exit 1
fi
set -e
}
@test "orion with regression should contain inline changepoint" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' > ./outputs/results.txt
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
# Check if the percentage string exists in the output file
if ! grep -q "+404.5%" ./outputs/results.txt; then
echo "Expected string '+404.5%' not found in results.txt"
exit 1
fi
# Check if the Previous Version string exists in the output file
if ! grep -q "Previous version: 4.20.0-0.nightly-2026-01-14-195655" ./outputs/results.txt; then
echo "Expected string 'Previous version: 4.20.0-0.nightly-2026-01-14-195655' not found in results.txt"
exit 1
fi
# Check if the Changepoint at string exists in the output file
if ! grep -q "Changepoint at: 4.20.0-0.nightly-2026-01-15-195655" ./outputs/results.txt; then
echo "Expected string 'Changepoint at: 4.20.0-0.nightly-2026-01-15-195655' not found in results.txt"
exit 1
fi
set -e
}
@test "orion with regression should contain inline changepoint json" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' --output-format json --save-output-path=./outputs/results.json
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
bad_version=$(jq -r '.[] | select(.is_changepoint == true) | .ocpVersion' ./outputs/results_olm-integration-test.json)
if [ "$bad_version" != "4.20.0-0.nightly-2026-01-15-195655" ]; then
echo "Version did not match. Expected '4.20.0-0.nightly-2026-01-15-195655', got '$bad_version'"
exit 1
fi
set -e
}
@test "orion with regression should contain inline changepoint junit" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' --output-format junit --save-output-path=./outputs/results.xml
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
failure=$(echo 'failures="1"')
# Check if the failures string exists in the output file
if ! grep -q $failure ./outputs/results.xml; then
echo "Expected string '$failure' not found in results.xml"
cat ./outputs/results.xml
exit 1
fi
changepoint=$(echo '404.549 | https://prow.ci/2013174937652563968 | -- changepoint')
# Check if the changepoint string exists in the output file
if ! grep -q $changepoint ./outputs/results.xml; then
echo "Expected string '$changepoint' not found in results.xml"
cat ./outputs/results.xml
exit 1
fi
set -e
}
@test "orion with regression should contain inline changepoint with custom display" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' --display upstreamJob > ./outputs/results.txt
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
# Check if the percentage string exists in the output file
if ! grep -q "+404.5%" ./outputs/results.txt; then
echo "Expected string '+404.5%' not found in results.txt"
cat ./outputs/results.txt
exit 1
fi
# Check if the Previous Version string exists in the output file
if ! grep -q "Previous version: 4.20.0-0.nightly-2026-01-14-195655" ./outputs/results.txt; then
echo "Expected string 'Previous version: 4.20.0-0.nightly-2026-01-14-195655' not found in results.txt"
cat ./outputs/results.txt
exit 1
fi
# Check if the Changepoint at string exists in the output file
if ! grep -q "Changepoint at: 4.20.0-0.nightly-2026-01-15-195655" ./outputs/results.txt; then
echo "Expected string 'Changepoint at: 4.20.0-0.nightly-2026-01-15-195655' not found in results.txt"
cat ./outputs/results.txt
exit 1
fi
customDisplay="upstreamJob"
# Check if the customDisplay string exists in the output file
if ! grep -q $customDisplay ./outputs/results.txt; then
echo "Expected string '$customDisplay' not found in results.txt"
cat ./outputs/results.txt
exit 1
fi
set -e
}
@test "orion with regression should contain inline changepoint json with custom display" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' --output-format json --display upstreamJob --save-output-path=./outputs/results.json
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
bad_version=$(jq -r '.[] | select(.is_changepoint == true) | .ocpVersion' ./outputs/results_olm-integration-test.json)
if [ "$bad_version" != "4.20.0-0.nightly-2026-01-15-195655" ]; then
echo "Version did not match. Expected '4.20.0-0.nightly-2026-01-15-195655', got '$bad_version'"
exit 1
fi
upstreamJob=$(jq -r '.[] | select(.is_changepoint == true) | .upstreamJob' ./outputs/results_olm-integration-test.json)
if [ "$upstreamJob" != "periodic-ci-openshift-eng-ocp-qe-perfscale-ci-main-gcp-4.20-nightly-x86-olmv1-benchmark-test" ]; then
echo "upstreamJob did not match. Expected 'periodic-ci-openshift-eng-ocp-qe-perfscale-ci-main-gcp-4.20-nightly-x86-olmv1-benchmark-test', got '$upstreamJob'"
exit 1
fi
set -e
}
@test "orion with regression should contain inline changepoint junit with custom display" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' --output-format junit --display upstreamJob --save-output-path=./outputs/results.xml
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
failure=$(echo 'failures="1"')
# Check if the failures string exists in the output file
if ! grep -q $failure ./outputs/results.xml; then
echo "Expected string '$failure' not found in results.xml"
cat ./outputs/results.xml
exit 1
fi
changepoint=$(echo '404.549')
# Check if the changepoint string exists in the output file
if ! grep -q $changepoint ./outputs/results.xml; then
echo "Expected string '$changepoint' not found in results.xml"
cat ./outputs/results.xml
exit 1
fi
customDisplay="upstreamJob"
# Check if the customDisplay string exists in the output file
if ! grep -q $customDisplay ./outputs/results.xml; then
echo "Expected string '$customDisplay' not found in results.xml"
cat ./outputs/results.xml
exit 1
fi
set -e
}
@test "orion with regression should contain inline changepoint no metadata index" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests-metrics-only.yaml --metadata-index "orion-integration-test-metrics*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' > ./outputs/results.txt
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
# Check if the percentage string exists in the output file
if ! grep -q "+404.5%" ./outputs/results.txt; then
echo "Expected string '+404.5%' not found in results.txt"
exit 1
fi
# Check if the Previous Version string exists in the output file
if ! grep -q "Previous version: 4.20" ./outputs/results.txt; then
echo "Expected string 'Previous version: 4.20' not found in results.txt"
exit 1
fi
# Check if the Changepoint at string exists in the output file
if ! grep -q "Changepoint at: 4.20" ./outputs/results.txt; then
echo "Expected string 'Changepoint at: 4.20' not found in results.txt"
exit 1
fi
set -e
}
@test "orion early-changepoint metric - changepoint in first 5 is skipped when expansion finds no extra data" {
# Early-cp metric has changepoint at 5th point. Orion expands the window to re-validate;
# with only 10 runs there is no additional data, so it skips the early changepoint and does not report regression.
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests-early-cp.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' > ./outputs/results-early-cp.txt
EXIT_CODE=$?
if [ $EXIT_CODE -eq 2 ]; then
echo "Regression was reported but should be skipped (no extra data after expansion)"
cat ./outputs/results-early-cp.txt
exit 1
fi
# Output should not show Bad/Previous version (early changepoint was cleared)
if grep -q "Bad Version: 4.20.0-0.nightly-2026-01-14-195655" ./outputs/results-early-cp.txt; then
echo "Expected early changepoint to be skipped (no Bad Version in output)"
cat ./outputs/results-early-cp.txt
exit 1
fi
set -e
}
@test "orion --anomaly-detection with regression should contain inline changepoint" {
set +e
orion --lookback 15d --since 2026-01-20 --anomaly-detection --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' > ./outputs/results-anomaly.txt
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
# Check if the percentage #1 string exists in the output file
if ! grep -q "+155.6%" ./outputs/results-anomaly.txt; then
echo "Expected string '+155.6%' not found in results.txt"
exit 1
fi
# Check if the percentage #2 string exists in the output file
if ! grep -q "+56.7%" ./outputs/results-anomaly.txt; then
echo "Expected string '+56.7%' not found in results.txt"
exit 1
fi
# Check if the percentage #3 string exists in the output file
if ! grep -q "+38.9%" ./outputs/results-anomaly.txt; then
echo "Expected string '+38.9%' not found in results.txt"
exit 1
fi
# Check if the Changepoint at string exists in the output file
if ! grep -q "Changepoint at: 4.20.0-0.nightly-2026-01-15-195655" ./outputs/results-anomaly.txt; then
echo "Expected string 'Changepoint at: 4.20.0-0.nightly-2026-01-15-195655' not found in results.txt"
exit 1
fi
# Check if the Changepoint at string exists in the output file
if ! grep -q "Changepoint at: 4.20.0-0.nightly-2026-01-17-195655" ./outputs/results-anomaly.txt; then
echo "Expected string 'Changepoint at: 4.20.0-0.nightly-2026-01-17-195655' not found in results.txt"
exit 1
fi
set -e
}
@test "orion --anomaly-detection with regression should contain inline changepoint json" {
set +e
orion --lookback 15d --since 2026-01-20 --anomaly-detection --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' --output-format json --save-output-path=./outputs/results-anomaly.json
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
# Check if changepoints string exists in the output file
CHANGEPOINTS=$(grep -c '"is_changepoint": true' ./outputs/results-anomaly_olm-integration-test.json)
if [ "$CHANGEPOINTS" -ne 3 ]; then
echo "Expected 3 changepoints, found $CHANGEPOINTS in ./outputs/results-anomaly_olm-integration-test.json"
exit 1
fi
set -e
}
@test "orion --anomaly-detection with regression should contain inline changepoint junit" {
set +e
orion --lookback 15d --since 2026-01-20 --anomaly-detection --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' --output-format junit --save-output-path=./outputs/results-anomaly.xml
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
# Check if the percentage #1 string exists in the output file
if ! grep -q "155.648" ./outputs/results-anomaly.xml; then
echo "Expected string '155.648' not found in ./outputs/results-anomaly.xml"
exit 1
fi
# Check if the percentage #2 string exists in the output file
if ! grep -q "56.7208" ./outputs/results-anomaly.xml; then
echo "Expected string '56.7208' not found in ./outputs/results-anomaly.xml"
exit 1
fi
# Check if the percentage #3 string exists in the output file
if ! grep -q "38.8858" ./outputs/results-anomaly.xml; then
echo "Expected string '38.8858' not found in ./outputs/results-anomaly.xml"
exit 1
fi
set -e
}
@test "orion --cmr with regression should contain inline changepoint" {
set +e
orion --lookback 15d --since 2026-01-20 --cmr --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' > ./outputs/results-cmr.txt
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 0 ]; then
echo "no regression found"
exit 1
fi
# Check if the percentage #1 string exists in the output file
if ! grep -q "+160.9%" ./outputs/results-cmr.txt; then
echo "Expected string '+160.9%' not found in results-cmr.txt"
exit 1
fi
set -e
}
@test "orion --cmr with regression should contain inline changepoint json" {
set +e
orion --lookback 15d --since 2026-01-20 --cmr --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' --output-format json --save-output-path=./outputs/results-cmr.json
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 0 ]; then
echo "no regression found"
exit 1
fi
bad_version=$(jq -r '.[] | select(.is_changepoint == true) | .ocpVersion' ./outputs/results-cmr_olm-integration-test.json)
if [ "$bad_version" != "4.20.0-0.nightly-2026-01-18-195655" ]; then
echo "Version did not match. Expected '4.20.0-0.nightly-2026-01-18-195655', got '$bad_version'"
exit 1
fi
set -e
}
@test "orion --cmr with regression should contain inline changepoint junit" {
set +e
orion --lookback 15d --since 2026-01-20 --cmr --config hack/ci-tests/configurations/ci-tests.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' --output-format junit --save-output-path=./outputs/results-cmr.xml
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 0 ]; then
echo "no regression found"
exit 1
fi
# Check if the percentage string exists in the output file
if ! grep -q "True | 160.879" ./outputs/results-cmr.xml; then
echo "Expected string 'True | 160.879' not found in results-cmr.xml"
exit 1
fi
set -e
}
@test "orion inheriting config" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests-inherits.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' > ./outputs/results.txt
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
# Check for gloabl metric
if ! grep -q "OCP-84094_catalogdCPU_GCP_sum_sum" ./outputs/results.txt; then
echo "Expected string 'OCP-84094_catalogdCPU_GCP_sum_sum' not found in results.txt"
exit 1
fi
# Check if the percentage string exists in the output file
if ! grep -q "+404.5%" ./outputs/results.txt; then
echo "Expected string '+404.5%' not found in results.txt"
exit 1
fi
# Check if the Previous version string exists in the output file
if ! grep -q "Previous version: 4.20.0-0.nightly-2026-01-14-195655" ./outputs/results.txt; then
echo "Expected string 'Previous version: 4.20.0-0.nightly-2026-01-14-195655' not found in results.txt"
exit 1
fi
# Check if the Changepoint at string exists in the output file
if ! grep -q "Changepoint at: 4.20.0-0.nightly-2026-01-15-195655" ./outputs/results.txt; then
echo "Expected string 'Changepoint at: 4.20.0-0.nightly-2026-01-15-195655' not found in results.txt"
exit 1
fi
set -e
}
@test "orion inheriting config ignore global" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests-inherits-ignore-global.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' > ./outputs/results.txt
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
# Check for global metric
if grep -q "OCP-84094_catalogdCPU_GCP_sum_sum" ./outputs/results.txt; then
echo "Expected string 'OCP-84094_catalogdCPU_GCP_sum_sum' found in results.txt, should not be present"
exit 1
fi
# Check for metric
if ! grep -q "OCP-84094_catalogdCPU_GCP_avg" ./outputs/results.txt; then
echo "Expected string 'OCP-84094_catalogdCPU_GCP_avg' not found in results.txt"
exit 1
fi
set -e
}
@test "orion inheriting config local metadata" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests-inherits-local-metadata.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' > ./outputs/results.txt
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 3 ]; then
echo "no regression found"
exit 1
fi
}
@test "orion inheriting config local metrics with global ignore" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests-inherits-local-metrics-with-ignore.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' > ./outputs/results.txt
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
# Check for local metric
if ! grep -q "OCP-84094_catalogdCPU_GCP_max_max" ./outputs/results.txt; then
echo "Expected string 'OCP-84094_catalogdCPU_GCP_max_max' not found in results.txt"
exit 1
fi
# Check for global metric
if grep -q "OCP-84094_catalogdCPU_GCP_sum_sum" ./outputs/results.txt; then
echo "Expected string 'OCP-84094_catalogdCPU_GCP_sum_sum' found in results.txt, should not be present"
exit 1
fi
# Check for metric
if ! grep -q "OCP-84094_catalogdCPU_GCP_avg" ./outputs/results.txt; then
echo "Expected string 'OCP-84094_catalogdCPU_GCP_avg' not found in results.txt"
exit 1
fi
set -e
}
@test "orion inheriting config local metrics" {
set +e
orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/configurations/ci-tests-inherits-local-metrics.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' > ./outputs/results.txt
EXIT_CODE=$?
if [ ! $EXIT_CODE -eq 2 ]; then
echo "no regression found"
exit 1
fi
# Check for local metric
if ! grep -q "OCP-84094_catalogdCPU_GCP_max_max" ./outputs/results.txt; then
echo "Expected string 'OCP-84094_catalogdCPU_GCP_max_max' not found in results.txt"
exit 1
fi
# Check for global metric
if ! grep -q "OCP-84094_catalogdCPU_GCP_sum_sum" ./outputs/results.txt; then
echo "Expected string 'OCP-84094_catalogdCPU_GCP_sum_sum' not found in results.txt"
exit 1
fi
# Check for metric
if ! grep -q "OCP-84094_catalogdCPU_GCP_avg" ./outputs/results.txt; then
echo "Expected string 'OCP-84094_catalogdCPU_GCP_avg' not found in results.txt"
exit 1
fi
set -e
}
@test "orion browbeat config should contain keystone metrics text" {
set +e
orion --lookback 15d --hunter-analyze --config hack/ci-tests/configurations/ci-tests-browbeat.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --since 2026-02-23 --display='' --input-vars='{"version": "4.18"}' --es-server=${QE_ES_SERVER} > ./outputs/results-browbeat.txt
set -e
for metric in keystone_v3_list_users_avg_avg keystone_v3_list_users_count_count keystone_v3_list_users_P99_percentiles keystone_v3_list_users_P95_percentiles keystone_v3_list_users_P90_percentiles keystone_v3_list_users_max_max keystone_v3_list_users_min_min keystone_v3_list_users_sum_sum; do
if ! grep -q "$metric" ./outputs/results-browbeat.txt; then
echo "Expected metric '$metric' not found in results-browbeat.txt"
exit 1
fi
done
}
@test "orion browbeat config should contain keystone metrics json" {
set +e
orion --lookback 15d --hunter-analyze --config hack/ci-tests/configurations/ci-tests-browbeat.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --since 2026-02-23 --display='' --input-vars='{"version": "4.18"}' --es-server=${QE_ES_SERVER} --output-format json > ./outputs/results-browbeat.json
set -e
for metric in keystone_v3_list_users_avg_avg keystone_v3_list_users_count_count keystone_v3_list_users_P99_percentiles keystone_v3_list_users_P95_percentiles keystone_v3_list_users_P90_percentiles keystone_v3_list_users_max_max keystone_v3_list_users_min_min keystone_v3_list_users_sum_sum; do
if ! grep -q "$metric" ./outputs/results-browbeat.json; then
echo "Expected metric '$metric' not found in results-browbeat.json"
exit 1
fi
done
}
@test "orion browbeat config should contain keystone metrics junit" {
set +e
orion --lookback 15d --hunter-analyze --config hack/ci-tests/configurations/ci-tests-browbeat.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --since 2026-02-23 --display='' --input-vars='{"version": "4.18"}' --es-server=${QE_ES_SERVER} --output-format junit > ./outputs/results-browbeat.xml
set -e
for metric in keystone_v3_list_users_avg_avg keystone_v3_list_users_count_count keystone_v3_list_users_P99_percentiles keystone_v3_list_users_P95_percentiles keystone_v3_list_users_P90_percentiles keystone_v3_list_users_max_max keystone_v3_list_users_min_min keystone_v3_list_users_sum_sum; do
if ! grep -q "$metric" ./outputs/results-browbeat.xml; then
echo "Expected metric '$metric' not found in results-browbeat.xml"
exit 1
fi
done
}