Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#31257: ci: make ctest stop on failure
Browse files Browse the repository at this point in the history
36a22e5 ci: make ctest stop on failure (furszy)

Pull request description:

  Make `ctest` stops when the first failure happens.
  Wasting less resources and notifying the developer faster when a failure occurs.

ACKs for top commit:
  maflcko:
    lgtm ACK 36a22e5
  tdb3:
    code review and test ACK 36a22e5

Tree-SHA512: 3abdb330e76aa312f7a5432e3d447a654e6689fc56e067b8e4d07ed8d677fc92f836e603aab0b2f175a6c039a5d50e5fd1160d503164321c1af44ad902f09605
  • Loading branch information
fanquake committed Nov 11, 2024
2 parents 19f2777 + 36a22e5 commit 5acd5e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
run: |
# Run tests on commits after the last merge commit and before the PR head commit
# Use clang++, because it is a bit faster and uses less memory than g++
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 }}
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 }}
macos-native-arm64:
name: 'macOS 14 native, arm64, no depends, sqlite only, gui'
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
- name: Run test suite
working-directory: build
run: |
ctest --output-on-failure -j $env:NUMBER_OF_PROCESSORS -C Release
ctest --output-on-failure --stop-on-failure -j $env:NUMBER_OF_PROCESSORS -C Release
- name: Run functional tests
working-directory: build
Expand Down
2 changes: 1 addition & 1 deletion ci/test/03_test_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ if [ "$RUN_CHECK_DEPS" = "true" ]; then
fi

if [ "$RUN_UNIT_TESTS" = "true" ]; then
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 ))
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 ))
fi

if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
Expand Down

0 comments on commit 5acd5e7

Please sign in to comment.