@@ -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
@@ -94,24 +101,26 @@ function main() {
94101
95102 echo " Running integration suite (cached: ${cached} , parallel: ${parallel} )"
96103
97- specs::run " ${cached} " " ${parallel} " " ${stack} " " ${platform} " " ${token:- } "
104+ specs::run " ${cached} " " ${parallel} " " ${stack} " " ${platform} " " ${token:- } " " ${keep_failed} "
98105 done
99106}
100107
101108function specs::run() {
102- local cached parallel stack platform token
109+ local cached parallel stack platform token keep_failed
103110 cached=" ${1} "
104111 parallel=" ${2} "
105112 stack=" ${3} "
106113 platform=" ${4} "
107114 token=" ${5} "
115+ keep_failed=" ${6} "
108116
109- local nodes cached_flag serial_flag platform_flag stack_flag token_flag
117+ local nodes cached_flag serial_flag platform_flag stack_flag token_flag keep_failed_flag
110118 cached_flag=" --cached=${cached} "
111119 serial_flag=" --serial=true"
112120 platform_flag=" --platform=${platform} "
113121 stack_flag=" --stack=${stack} "
114122 token_flag=" --github-token=${token} "
123+ keep_failed_flag=" --keep-failed-containers=${keep_failed} "
115124 nodes=1
116125
117126 if [[ " ${parallel} " == " true" ]]; then
@@ -135,7 +144,8 @@ function specs::run() {
135144 " ${platform_flag} " \
136145 " ${token_flag} " \
137146 " ${stack_flag} " \
138- " ${serial_flag} "
147+ " ${serial_flag} " \
148+ " ${keep_failed_flag} "
139149}
140150
141151function buildpack::package() {
0 commit comments