@@ -21,14 +21,16 @@ OPTIONS
2121 --help -h prints the command usage
2222 --github-token <token> GitHub token to use when making API requests
2323 --platform <cf|docker> Switchblade platform to execute the tests against
24+ --keep-failed-containers Preserve failed test containers for debugging (default: false)
2425USAGE
2526}
2627
2728function main() {
28- local src stack platform token cached parallel
29+ local src stack platform token cached parallel keep_failed
2930 src=" $( find " ${ROOTDIR} /src" -mindepth 1 -maxdepth 1 -type d ) "
3031 stack=" ${CF_STACK:- $(jq -r -S .stack " ${ROOTDIR} /config.json" )} "
3132 platform=" cf"
33+ keep_failed=" false"
3234
3335 while [[ " ${# } " != 0 ]]; do
3436 case " ${1} " in
@@ -52,6 +54,11 @@ function main() {
5254 shift 2
5355 ;;
5456
57+ --keep-failed-containers)
58+ keep_failed=" true"
59+ shift 1
60+ ;;
61+
5562 --help|-h)
5663 shift 1
5764 usage
@@ -99,24 +106,26 @@ function main() {
99106
100107 echo " Running integration suite (cached: ${cached} , parallel: ${parallel} )"
101108
102- specs::run " ${cached} " " ${parallel} " " ${stack} " " ${platform} " " ${token:- } "
109+ specs::run " ${cached} " " ${parallel} " " ${stack} " " ${platform} " " ${token:- } " " ${keep_failed} "
103110 done
104111}
105112
106113function specs::run() {
107- local cached parallel stack platform token
114+ local cached parallel stack platform token keep_failed
108115 cached=" ${1} "
109116 parallel=" ${2} "
110117 stack=" ${3} "
111118 platform=" ${4} "
112119 token=" ${5} "
120+ keep_failed=" ${6} "
113121
114- local nodes cached_flag serial_flag platform_flag stack_flag token_flag
122+ local nodes cached_flag serial_flag platform_flag stack_flag token_flag keep_failed_flag
115123 cached_flag=" --cached=${cached} "
116124 serial_flag=" --serial=true"
117125 platform_flag=" --platform=${platform} "
118126 stack_flag=" --stack=${stack} "
119127 token_flag=" --github-token=${token} "
128+ keep_failed_flag=" --keep-failed-containers=${keep_failed} "
120129 nodes=1
121130
122131 if [[ " ${parallel} " == " true" ]]; then
@@ -142,7 +151,8 @@ function specs::run() {
142151 " ${platform_flag} " \
143152 " ${token_flag} " \
144153 " ${stack_flag} " \
145- " ${serial_flag} "
154+ " ${serial_flag} " \
155+ " ${keep_failed_flag} "
146156}
147157
148158function buildpack::package() {
0 commit comments