Skip to content

Commit 63d3676

Browse files
committed
Let's switch back again to set -e.
Signed-off-by: Petr "Stone" Hracek <[email protected]>
1 parent 8d78110 commit 63d3676

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ failed_version() {
2626

2727
analyze_logs_by_logdetective() {
2828
# logdetective should not break the test functionality
29+
# Therefore `set +e` is setup
2930
set +e
3031
local log_file_name="$1"
3132
echo "Sending failed log by fpaste command to paste bin."
@@ -46,21 +47,25 @@ analyze_logs_by_logdetective() {
4647
echo "ERROR: Failed to analyze log file by logdetective server."
4748
cat "${logdetective_test_file}"
4849
echo "-------- LOGDETECTIVE TEST LOG ANALYSIS FAILED --------"
50+
# Let's switch it back
4951
set -e
5052
return
5153
fi
52-
set -e
5354
jq -rC '.explanation.text' < "${logdetective_test_file}"
5455
# This part of code is from https://github.com/teemtee/tmt/blob/main/tmt/steps/scripts/tmt-file-submit
5556
if [ -z "$TMT_TEST_PIDFILE" ]; then
5657
echo "File submit to data dir can be used only in the context of a running test."
58+
# Let's switch it back
59+
set -e
5760
return
5861
fi
5962
# This variable is set by tmt
6063
[ -d "$TMT_TEST_DATA" ] || mkdir -p "$TMT_TEST_DATA"
6164
cp -f "${logdetective_test_file}" "$TMT_TEST_DATA"
6265
echo "File '${logdetective_test_file}' stored to '$TMT_TEST_DATA'."
6366
echo "-------- LOGDETECTIVE TEST LOG ANALYSIS FINISHED --------"
67+
# Let's switch it back
68+
set -e
6469
}
6570

6671
# This adds backwards compatibility if only single version needs to be testing

0 commit comments

Comments
 (0)