Skip to content

Commit e5d8a3d

Browse files
authored
Disallow non fatal tests (#5369)
We do not have any tests currently using this, we do not want to start having them.
1 parent ebea3e0 commit e5d8a3d

File tree

5 files changed

+7
-39
lines changed

5 files changed

+7
-39
lines changed

.cmake-format.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
}
8787
},
8888
"o2_add_test_wrapper": {
89-
"flags": ["DONT_FAIL_ON_TIMEOUT", "NON_FATAL"],
89+
"flags": ["DONT_FAIL_ON_TIMEOUT"],
9090
"kwargs": {
9191
"COMMAND": '*',
9292
"NO_BOOST_TEST": '*',
@@ -104,7 +104,6 @@
104104
"kwargs": {
105105
"INSTALL": '*',
106106
"NO_BOOST_TEST": '*',
107-
"NON_FATAL": '*',
108107
"COMPONENT_NAME": '*',
109108
"MAX_ATTEMPTS": '*',
110109
"TIMEOUT": '*',
@@ -117,7 +116,7 @@
117116
}
118117
},
119118
"o2_add_test_root_macro": {
120-
"flags": ["NON_FATAL", "LOAD_ONLY"],
119+
"flags": ["LOAD_ONLY"],
121120
"kwargs": {
122121
"ENVIRONMENT": '*',
123122
"PUBLIC_LINK_LIBRARIES": '*',

cmake/O2AddTest.cmake

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ include(O2AddTestWrapper)
4343
# before it is actually considered as failed
4444
# * TIMEOUT : the number of seconds allowed for the test to run. Past this time
4545
# failure is assumed.
46-
# * NON_FATAL : true if the failing of this test is not causing the CI to fail
4746
# * ENVIRONMENT: extra environment needed by the test to run properly
4847
#
4948
function(o2_add_test)
@@ -56,7 +55,7 @@ function(o2_add_test)
5655
PARSE_ARGV
5756
1
5857
A
59-
"INSTALL;NO_BOOST_TEST;NON_FATAL"
58+
"INSTALL;NO_BOOST_TEST"
6059
"COMPONENT_NAME;MAX_ATTEMPTS;TIMEOUT;WORKING_DIRECTORY;NAME"
6160
"SOURCES;PUBLIC_LINK_LIBRARIES;COMMAND_LINE_ARGS;LABELS;CONFIGURATIONS;ENVIRONMENT"
6261
)
@@ -95,11 +94,6 @@ function(o2_add_test)
9594
COMPONENT_NAME ${A_COMPONENT_NAME}
9695
IS_TEST ${noInstall} TARGETVARNAME targetName)
9796

98-
set(nonFatal "")
99-
if(NON_FATAL)
100-
set(nonFatal NON_FATAL)
101-
endif()
102-
10397
# create a test with a script wrapping the executable above
10498
set(name "")
10599
if(A_NAME)
@@ -114,7 +108,7 @@ function(o2_add_test)
114108
NAME ${name}
115109
DONT_FAIL_ON_TIMEOUT
116110
MAX_ATTEMPTS ${A_MAX_ATTEMPTS}
117-
TIMEOUT ${A_TIMEOUT} ${nonFatal}
111+
TIMEOUT ${A_TIMEOUT}
118112
WORKING_DIRECTORY ${A_WORKING_DIRECTORY}
119113
COMMAND_LINE_ARGS ${A_COMMAND_LINE_ARGS}
120114
LABELS ${A_LABELS}

cmake/O2AddTestRootMacro.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ include_guard()
2020
# the macro test", a test to compile the library, i.e. using ".L macro.C++
2121
# * arg COMPILE_ONLY: if present we discard the "load the macro" test and
2222
# only attempt the compilation test. It implies COMPILE
23-
# * arg NON_FATAL: if present mark the test as non_fatal, i.e. it won't
24-
# invalidate the build
2523
# * arg ENVIRONMENT: sets the running environment for the generated test(s).
2624
# * arg PUBLIC_LINK_LIBRARIES: the list of targets this macro is depending on.
2725
# Required to be able to specify correctly the include and library paths to
@@ -44,7 +42,7 @@ function(o2_add_test_root_macro macro)
4442
PARSE_ARGV
4543
1
4644
A
47-
"NON_FATAL;COMPILE;COMPILE_ONLY"
45+
"COMPILE;COMPILE_ONLY"
4846
""
4947
"ENVIRONMENT;PUBLIC_LINK_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;LABELS")
5048

@@ -64,10 +62,6 @@ function(o2_add_test_root_macro macro)
6462

6563
file(RELATIVE_PATH testName ${CMAKE_SOURCE_DIR} ${macroFileName})
6664

67-
if(${A_IS_NON_FATAL})
68-
set(nonFatal "NON_FATAL")
69-
endif()
70-
7165
list(APPEND incdir $ENV{ROOT_INCLUDE_PATH})
7266
list(APPEND incdir ${A_PUBLIC_INCLUDE_DIRECTORIES})
7367

cmake/O2AddTestWrapper.cmake

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ include_guard()
3030
# * TIMEOUT (optional) the test timeout (for each attempt)
3131
# * COMMAND_LINE_ARGS (optional) extra arguments to the test executable, if
3232
# needed
33-
# * NON_FATAL (optional) mark the test as non criticial for the CI
3433
# * ENVIRONMENT: extra environment needed by the test to run properly
3534
#
3635
function(o2_add_test_wrapper)
@@ -43,7 +42,7 @@ function(o2_add_test_wrapper)
4342
PARSE_ARGV
4443
0
4544
"A"
46-
"DONT_FAIL_ON_TIMEOUT;NON_FATAL"
45+
"DONT_FAIL_ON_TIMEOUT"
4746
"TARGET;COMMAND;WORKING_DIRECTORY;MAX_ATTEMPTS;TIMEOUT;NAME"
4847
"COMMAND_LINE_ARGS;LABELS;CONFIGURATIONS;ENVIRONMENT")
4948

@@ -86,9 +85,6 @@ function(o2_add_test_wrapper)
8685
# message(
8786
# WARNING "Test ${testName} will be retried max ${A_MAX_ATTEMPTS} times")
8887
# endif()
89-
if(A_NON_FATAL)
90-
message(WARNING "Failure of test ${testName} will not be fatal")
91-
endif()
9288

9389
if(NOT A_TIMEOUT)
9490
set(A_TIMEOUT 100) # default timeout (seconds)
@@ -101,11 +97,6 @@ function(o2_add_test_wrapper)
10197
else()
10298
set(A_DONT_FAIL_ON_TIMEOUT "")
10399
endif()
104-
if(A_NON_FATAL)
105-
set(A_NON_FATAL "--non-fatal")
106-
else()
107-
set(A_NON_FATAL "")
108-
endif()
109100

110101
# For now, we enforce 3 max attempts for all tests.
111102
# No need to ignore time out, since we have 3 attempts
@@ -136,7 +127,6 @@ function(o2_add_test_wrapper)
136127
"--timeout"
137128
"${A_TIMEOUT}"
138129
${A_DONT_FAIA_ON_TIMEOUT}
139-
${A_NON_FATAL}
140130
"--"
141131
${testExe}
142132
${A_COMMAND_LINE_ARGS}

tests/tests-wrapper.sh.in

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
MAX_ATTEMPTS=1
1111
TIMEOUT= # default: no timeout
1212
DONT_FAIL_ON_TIMEOUT= # default: if it times out, it fails
13-
NON_FATAL= # default: fail on error
1413
ARGS=("$@")
1514

1615
while [[ $# -gt 0 ]]; do
@@ -35,10 +34,6 @@ while [[ $# -gt 0 ]]; do
3534
DONT_FAIL_ON_TIMEOUT=1
3635
shift
3736
;;
38-
--non-fatal)
39-
NON_FATAL=1
40-
shift
41-
;;
4237
*)
4338
echo "Parameter unknown: $1" >&2
4439
exit 1
@@ -63,7 +58,7 @@ function banner() {
6358
echo "=== $TEST_NAME - $1 ===" >&2
6459
}
6560

66-
banner "Starting test. Max attempts: $MAX_ATTEMPTS.${TIMEOUT:+" Timeout per attempt: $TIMEOUT."}${DONT_FAIL_ON_TIMEOUT:+" Timeouts are not fatal."}${NON_FATAL:+" Errors are not fatal."}"
61+
banner "Starting test. Max attempts: $MAX_ATTEMPTS.${TIMEOUT:+" Timeout per attempt: $TIMEOUT."}${DONT_FAIL_ON_TIMEOUT:+" Timeouts are not fatal."}"
6762

6863
for A in "${ARGS[@]}"; do
6964
banner "Argument: $A"
@@ -123,9 +118,5 @@ if [[ $DONT_FAIL_ON_TIMEOUT && $ERR == 124 ]]; then
123118
banner "Reason for failure: timeout, explicitly set as not fatal. Exiting with 0"
124119
cp "${LOG}.${ERR}" "${LOG}.${ERR}.nonfatal"
125120
exit 0
126-
elif [[ $NON_FATAL ]]; then
127-
banner "Failed with error $ERR, but errors are set as not fatal. Exiting with 0"
128-
cp "${LOG}.${ERR}" "${LOG}.${ERR}.nonfatal"
129-
exit 0
130121
fi
131122
exit 1

0 commit comments

Comments
 (0)