File tree 4 files changed +52
-0
lines changed
4 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -290,6 +290,7 @@ def run(self, test_output_dirs=None):
290
290
self .fixup_artifacts_content_type ()
291
291
self .make_artifacts_help ()
292
292
self .handle_run_failure ()
293
+ self .handle_e2e_progress_failures ()
293
294
294
295
def fixup_artifacts_content_type (self ):
295
296
self .run_with_best_effort (
@@ -302,3 +303,12 @@ def make_artifacts_help(self):
302
303
["scripts/ci/store-artifacts.sh" , "make_artifacts_help" ],
303
304
timeout = PostTestsConstants .FIXUP_TIMEOUT ,
304
305
)
306
+
307
+ def handle_e2e_progress_failures (self ):
308
+ self .run_with_best_effort (
309
+ [
310
+ "tests/e2e/lib.sh" ,
311
+ "handle_e2e_progress_failures" ,
312
+ ],
313
+ timeout = PostTestsConstants .CHECK_TIMEOUT ,
314
+ )
Original file line number Diff line number Diff line change 4
4
5
5
ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " /../.. && pwd) "
6
6
source " $ROOT /scripts/ci/lib.sh"
7
+ source " $ROOT /tests/e2e/lib.sh"
7
8
8
9
set -euo pipefail
9
10
10
11
run_tests_part_2 () {
11
12
info " QA Automation Platform Part 2"
12
13
14
+ if [[ ! -f " ${STATE_DEPLOYED} " ]]; then
15
+ info " Skipping part 2 tests due to earlier failure"
16
+ exit 0
17
+ fi
18
+
13
19
export CLUSTER=" ${ORCHESTRATOR_FLAVOR^^} "
14
20
15
21
rm -f FAIL
Original file line number Diff line number Diff line change @@ -1219,6 +1219,29 @@ send_slack_notice_for_failures_on_merge() {
1219
1219
curl -XPOST -d @- -H ' Content-Type: application/json' " $webhook_url "
1220
1220
}
1221
1221
1222
+ save_junit_failure () {
1223
+ if [[ " $# " -ne 3 ]]; then
1224
+ die " missing args. usage: save_junit_failure <class> <description> <details>"
1225
+ fi
1226
+
1227
+ if [[ -z " ${ARTIFACT_DIR} " ]]; then
1228
+ info " Warning: save_junit_failure() requires an ARTIFACT_DIR"
1229
+ return
1230
+ fi
1231
+
1232
+ local class=" $1 "
1233
+ local description=" $2 "
1234
+ local details=" $3 "
1235
+
1236
+ cat << EOF > "${ARTIFACT_DIR} /junit-${class} .xml"
1237
+ <testsuite name="${class} " tests="1" skipped="0" failures="1" errors="0">
1238
+ <testcase name="${description} " classname="${class} ">
1239
+ <failure>${details} </failure>
1240
+ </testcase>
1241
+ </testsuite>
1242
+ EOF
1243
+ }
1244
+
1222
1245
if [[ " ${BASH_SOURCE[0]} " == " $0 " ]]; then
1223
1246
if [[ " $# " -lt 1 ]]; then
1224
1247
die " When invoked at the command line a method is required."
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ set -euo pipefail
7
7
8
8
TEST_ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " /../.. && pwd) "
9
9
10
+ # State
11
+ STATE_DEPLOYED=" /tmp/state_deployed"
12
+
10
13
source " $TEST_ROOT /scripts/lib.sh"
11
14
source " $TEST_ROOT /scripts/ci/lib.sh"
12
15
@@ -24,6 +27,8 @@ deploy_stackrox() {
24
27
kubectl -n stackrox delete pod -l app=collector --grace-period=0
25
28
26
29
sensor_wait
30
+
31
+ touch " ${STATE_DEPLOYED} "
27
32
}
28
33
29
34
# export_test_environment() - Persist environment variables for the remainder of
@@ -400,6 +405,14 @@ db_backup_and_restore_test() {
400
405
[[ ! -f DB_TEST_FAIL ]] || die " The DB test failed"
401
406
}
402
407
408
+ handle_e2e_progress_failures () {
409
+ info " Checking for deployment failure"
410
+
411
+ if [[ ! -f " ${STATE_DEPLOYED} " ]]; then
412
+ save_junit_failure " Stackrox_Deployment" " Could not deploy StackRox" " Check the build log" || true
413
+ fi
414
+ }
415
+
403
416
if [[ " ${BASH_SOURCE[0]} " == " $0 " ]]; then
404
417
if [[ " $# " -lt 1 ]]; then
405
418
usage
You can’t perform that action at this time.
0 commit comments