Skip to content

Commit 36a22e5

Browse files
committed
ci: make ctest stop on failure
Wastes less resources and notifies the developer faster when a failure occurs.
1 parent 018e5fc commit 36a22e5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
run: |
7373
# Run tests on commits after the last merge commit and before the PR head commit
7474
# Use clang++, because it is a bit faster and uses less memory than g++
75-
git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && CC=clang CXX=clang++ cmake -B build -DWERROR=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWITH_BDB=ON -DWITH_USDT=ON -DCMAKE_CXX_FLAGS='-Wno-error=unused-member-function' && cmake --build build -j $(nproc) && ctest --output-on-failure --test-dir build -j $(nproc) && ./build/test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
75+
git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && CC=clang CXX=clang++ cmake -B build -DWERROR=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWITH_BDB=ON -DWITH_USDT=ON -DCMAKE_CXX_FLAGS='-Wno-error=unused-member-function' && cmake --build build -j $(nproc) && ctest --output-on-failure --stop-on-failure --test-dir build -j $(nproc) && ./build/test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
7676
7777
macos-native-arm64:
7878
name: 'macOS 14 native, arm64, no depends, sqlite only, gui'
@@ -199,7 +199,7 @@ jobs:
199199
- name: Run test suite
200200
working-directory: build
201201
run: |
202-
ctest --output-on-failure -j $env:NUMBER_OF_PROCESSORS -C Release
202+
ctest --output-on-failure --stop-on-failure -j $env:NUMBER_OF_PROCESSORS -C Release
203203
204204
- name: Run functional tests
205205
working-directory: build

ci/test/03_test_script.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ if [ "$RUN_CHECK_DEPS" = "true" ]; then
145145
fi
146146

147147
if [ "$RUN_UNIT_TESTS" = "true" ]; then
148-
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" CTEST_OUTPUT_ON_FAILURE=ON ctest "${MAKEJOBS}" --timeout $(( TEST_RUNNER_TIMEOUT_FACTOR * 60 ))
148+
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" CTEST_OUTPUT_ON_FAILURE=ON ctest --stop-on-failure "${MAKEJOBS}" --timeout $(( TEST_RUNNER_TIMEOUT_FACTOR * 60 ))
149149
fi
150150

151151
if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then

0 commit comments

Comments
 (0)