Skip to content

Commit ed90939

Browse files
author
OpenShift Bot
authored
Merge pull request #9742 from stevekuznetsov/skuznets/debug-output
Merged by openshift-bot
2 parents 4d8db28 + 69a4085 commit ed90939

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

hack/lib/cmd.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,16 @@ function os::cmd::internal::expect_exit_code_run_grep() {
198198
fi
199199
local test_succeeded=$( ${test_eval_func} "${test_result}"; echo $? )
200200

201-
local end_time=$(os::cmd::internal::seconds_since_epoch)
202-
local time_elapsed=$(echo "scale=3; ${end_time} - ${start_time}" | bc | xargs printf '%5.3f') # in decimal seconds, we need leading zeroes for parsing later
201+
if (( ! test_succeeded )); then
202+
os::text::print_blue "[DEBUG] Output content test failed. Debugging information follows:"
203+
os::text::print_blue "[DEBUG] \${grep_args}=${grep_args}"
204+
os::text::print_blue "[DEBUG] \${test_result}=${test_result}"
205+
os::text::print_blue "[DEBUG] \${test_eval_func}=${test_eval_func}"
206+
os::text::print_blue "[DEBUG] \${test_succeeded}=${test_succeeded}"
207+
fi
208+
209+
local end_time=$(os::cmd::internal::seconds_since_epoch)
210+
local time_elapsed=$(echo "scale=3; ${end_time} - ${start_time}" | bc | xargs printf '%5.3f') # in decimal seconds, we need leading zeroes for parsing later
203211

204212
# clear the preamble so we can print out the success or error message
205213
os::text::clear_string "${preamble}"

0 commit comments

Comments
 (0)