From 4ff6312453caf14fec2c2514624d1531dd5b8dae Mon Sep 17 00:00:00 2001 From: Abit Date: Thu, 3 Dec 2020 17:59:55 +0100 Subject: [PATCH 1/3] Check availability of the 'parallel' command Run tests serially if the 'parallel' command is not available --- tests/run-parallel-tests.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/run-parallel-tests.sh b/tests/run-parallel-tests.sh index eac2c58b5..2056c2764 100755 --- a/tests/run-parallel-tests.sh +++ b/tests/run-parallel-tests.sh @@ -16,6 +16,9 @@ fi if [ "$BOOST_VERSION" = "" -o "$BOOST_VERSION" -lt 105900 ]; then echo "Boost version '$BOOST_VERSION' - executing tests serially" "$@" +elif ! command -v parallel >/dev/null 2>&1; then + echo "Can not find the 'parallel' command - executing tests serially" + "$@" else echo "=== $1 list_content test begin ===" "$1" --list_content 2>&1 \ From 0dbf57ce5f61c4683fa4428b8e9595d808ffd7f9 Mon Sep 17 00:00:00 2001 From: abitmore Date: Thu, 3 Dec 2020 12:12:53 -0500 Subject: [PATCH 2/3] Run all_tests in parallel in Github CI --- .github/workflows/build-and-test-macos.yml | 2 +- .github/workflows/build-and-test-ubuntu-debug.yml | 2 +- .github/workflows/build-and-test-ubuntu-release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index f228a17f0..ac7b91798 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -44,8 +44,8 @@ jobs: df -h - name: Unit-Tests run: | + tests/run-parallel-tests.sh _build/tests/all_tests -l message pushd _build/tests - ./all_tests -l message ./bloom_test -- README.md ./ecc_test README.md ./hmac_test diff --git a/.github/workflows/build-and-test-ubuntu-debug.yml b/.github/workflows/build-and-test-ubuntu-debug.yml index 2b9d68edf..d73399423 100644 --- a/.github/workflows/build-and-test-ubuntu-debug.yml +++ b/.github/workflows/build-and-test-ubuntu-debug.yml @@ -64,8 +64,8 @@ jobs: make -j 2 -C _build - name: Test run: | + tests/run-parallel-tests.sh _build/tests/all_tests -l message parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_ - all_tests -l message bloom_test -- README.md ecc_test README.md hmac_test diff --git a/.github/workflows/build-and-test-ubuntu-release.yml b/.github/workflows/build-and-test-ubuntu-release.yml index 58a8b2229..308541283 100644 --- a/.github/workflows/build-and-test-ubuntu-release.yml +++ b/.github/workflows/build-and-test-ubuntu-release.yml @@ -64,8 +64,8 @@ jobs: make -j 2 -C _build - name: Test run: | + tests/run-parallel-tests.sh _build/tests/all_tests -l message parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_ - all_tests -l message bloom_test -- README.md ecc_test README.md hmac_test From ff9938dad82d81ddd0403f55aef5e55007cb37be Mon Sep 17 00:00:00 2001 From: abitmore Date: Thu, 3 Dec 2020 12:52:00 -0500 Subject: [PATCH 3/3] Improve testing in parallel in Github CI --- .github/workflows/build-and-test-macos.yml | 11 ++++++----- .github/workflows/build-and-test-ubuntu-debug.yml | 10 +++++----- .github/workflows/build-and-test-ubuntu-release.yml | 10 +++++----- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index ac7b91798..a96d3e84a 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -44,9 +44,10 @@ jobs: df -h - name: Unit-Tests run: | + parallel echo Running {}\; sh -c "./{}" <<_EOT_ tests/run-parallel-tests.sh _build/tests/all_tests -l message - pushd _build/tests - ./bloom_test -- README.md - ./ecc_test README.md - ./hmac_test - ./task_cancel_test + _build/tests/bloom_test -- README.md + _build/tests/ecc_test README.md + _build/tests/hmac_test + _build/tests/task_cancel_test + _EOT_ diff --git a/.github/workflows/build-and-test-ubuntu-debug.yml b/.github/workflows/build-and-test-ubuntu-debug.yml index d73399423..1048cdd26 100644 --- a/.github/workflows/build-and-test-ubuntu-debug.yml +++ b/.github/workflows/build-and-test-ubuntu-debug.yml @@ -64,10 +64,10 @@ jobs: make -j 2 -C _build - name: Test run: | + parallel echo Running {}\; sh -c "./{}" <<_EOT_ tests/run-parallel-tests.sh _build/tests/all_tests -l message - parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_ - bloom_test -- README.md - ecc_test README.md - hmac_test - task_cancel_test + _build/tests/bloom_test -- README.md + _build/tests/ecc_test README.md + _build/tests/hmac_test + _build/tests/task_cancel_test _EOT_ diff --git a/.github/workflows/build-and-test-ubuntu-release.yml b/.github/workflows/build-and-test-ubuntu-release.yml index 308541283..eaaa98a96 100644 --- a/.github/workflows/build-and-test-ubuntu-release.yml +++ b/.github/workflows/build-and-test-ubuntu-release.yml @@ -64,10 +64,10 @@ jobs: make -j 2 -C _build - name: Test run: | + parallel echo Running {}\; sh -c "./{}" <<_EOT_ tests/run-parallel-tests.sh _build/tests/all_tests -l message - parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_ - bloom_test -- README.md - ecc_test README.md - hmac_test - task_cancel_test + _build/tests/bloom_test -- README.md + _build/tests/ecc_test README.md + _build/tests/hmac_test + _build/tests/task_cancel_test _EOT_