Skip to content

Commit 4d82e41

Browse files
[CMake] Add option to treat skips in tests as fails
Enable it in CI, in all workflows and make sure we don't omit setting it in the future workflows (via check in CMake).
1 parent 4223876 commit 4d82e41

File tree

11 files changed

+28
-0
lines changed

11 files changed

+28
-0
lines changed

.github/workflows/basic.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
5959
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
6060
-DUMF_BUILD_EXAMPLES=ON
61+
-DUMF_TESTS_FAIL_ON_SKIP=ON
6162
6263
- name: Build UMF
6364
run: cmake --build build -j $(nproc)
@@ -151,6 +152,7 @@ jobs:
151152
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
152153
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
153154
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
155+
-DUMF_TESTS_FAIL_ON_SKIP=ON
154156
155157
- name: Build UMF
156158
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
@@ -235,6 +237,7 @@ jobs:
235237
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
236238
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
237239
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}}
240+
-DUMF_TESTS_FAIL_ON_SKIP=ON
238241
239242
- name: Build UMF
240243
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
@@ -289,6 +292,7 @@ jobs:
289292
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
290293
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
291294
-DUMF_BUILD_SHARED_LIBRARY=ON
295+
-DUMF_TESTS_FAIL_ON_SKIP=ON
292296
293297
- name: Build UMF
294298
run: cmake --build ${{env.BUILD_DIR}} -j $(sysctl -n hw.logicalcpu)

.github/workflows/codeql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
7575
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
7676
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
77+
-DUMF_TESTS_FAIL_ON_SKIP=ON
7778
7879
- name: Build
7980
run: cmake --build ${{github.workspace}}/build --config Release -j

.github/workflows/gpu.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
5858
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
5959
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
60+
-DUMF_TESTS_FAIL_ON_SKIP=ON
6061
6162
- name: Configure build for Ubuntu
6263
if: matrix.os == 'Ubuntu'
@@ -77,6 +78,7 @@ jobs:
7778
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
7879
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
7980
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
81+
-DUMF_TESTS_FAIL_ON_SKIP=ON
8082
8183
- name: Build UMF
8284
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j ${{matrix.number_of_processors}}

.github/workflows/multi_numa.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
3939
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
4040
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
41+
-DUMF_TESTS_FAIL_ON_SKIP=ON
4142
4243
- name: Build UMF
4344
run: cmake --build ${{github.workspace}}/build -j $(nproc)

.github/workflows/nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
4141
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
4242
-DUSE_VALGRIND=1
43+
-DUMF_TESTS_FAIL_ON_SKIP=ON
4344
4445
- name: Build
4546
run: cmake --build ${{github.workspace}}/build --config Debug -j$(nproc)

.github/workflows/pr_push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ jobs:
7676
-DUMF_BUILD_TESTS=${{matrix.build_tests}}
7777
-DUMF_BUILD_EXAMPLES=ON
7878
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
79+
-DUMF_TESTS_FAIL_ON_SKIP=ON
7980
${{matrix.extra_build_options}}
8081
8182
- name: Build

.github/workflows/proxy_lib.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
4343
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
4444
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
45+
-DUMF_TESTS_FAIL_ON_SKIP=ON
4546
-DUMF_PROXY_LIB_BASED_ON_POOL=${{matrix.proxy_lib_pool}}
4647
4748
- name: Build UMF

.github/workflows/sanitizers.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
-DUSE_UBSAN=${{matrix.sanitizers.ubsan}}
5353
-DUSE_TSAN=${{matrix.sanitizers.tsan}}
5454
-DUMF_BUILD_EXAMPLES=ON
55+
-DUMF_TESTS_FAIL_ON_SKIP=ON
5556
5657
- name: Build UMF
5758
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
@@ -96,6 +97,7 @@ jobs:
9697
-DUSE_UBSAN=${{matrix.sanitizers.ubsan}}
9798
-DUSE_TSAN=${{matrix.sanitizers.tsan}}
9899
-DUMF_BUILD_EXAMPLES=ON
100+
-DUMF_TESTS_FAIL_ON_SKIP=ON
99101
100102
- name: Build UMF
101103
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
@@ -157,6 +159,7 @@ jobs:
157159
-DUSE_ASAN=${{matrix.sanitizers.asan}}
158160
-DUMF_BUILD_EXAMPLES=ON
159161
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
162+
-DUMF_TESTS_FAIL_ON_SKIP=ON
160163
161164
- name: Build UMF
162165
run: cmake --build ${{env.BUILD_DIR}} --config Debug -j $Env:NUMBER_OF_PROCESSORS

.github/workflows/valgrind.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
3636
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
3737
-DUSE_VALGRIND=1
38+
-DUMF_TESTS_FAIL_ON_SKIP=ON
3839
3940
- name: Build
4041
run: cmake --build ${{github.workspace}}/build --config Debug -j$(nproc)

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ option(UMF_DEVELOPER_MODE "Enable developer checks, treats warnings as errors"
4444
option(UMF_FORMAT_CODE_STYLE
4545
"Add clang, cmake, and black -format-check and -format-apply targets"
4646
OFF)
47+
# Only a part of skips is treated as a failure now. TODO: extend to all tests
48+
option(UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF)
4749
option(USE_ASAN "Enable AddressSanitizer checks" OFF)
4850
option(USE_UBSAN "Enable UndefinedBehaviorSanitizer checks" OFF)
4951
option(USE_TSAN "Enable ThreadSanitizer checks" OFF)
@@ -59,6 +61,16 @@ set(UMF_PROXY_LIB_BASED_ON_POOL
5961
set_property(CACHE UMF_PROXY_LIB_BASED_ON_POOL
6062
PROPERTY STRINGS ${KNOWN_PROXY_LIB_POOLS})
6163

64+
if(UMF_BUILD_TESTS
65+
AND DEFINED ENV{CI}
66+
AND NOT UMF_TESTS_FAIL_ON_SKIP)
67+
message(
68+
FATAL_ERROR
69+
"Env variable 'CI' is set, tests are enabled, but UMF_TESTS_FAIL_ON_SKIP is not. "
70+
"Please set UMF_TESTS_FAIL_ON_SKIP to ON in all CI workflows running tests."
71+
)
72+
endif()
73+
6274
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
6375
set(LINUX TRUE)
6476
set(OS_NAME "linux")

0 commit comments

Comments
 (0)