From a8025906348005384f44deece9adcb289e60f2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Thu, 27 Apr 2023 21:29:04 +0200 Subject: [PATCH] Windows run tests using bash scripts --- .github/workflows/unit_tests.yml | 18 ++++++++++++++---- ci/tests/common.sh | 16 ++++++++++++++++ ci/tests/run-core-tests.sh | 4 +++- ci/tests/run-qt-tests.sh | 4 +++- ci/tests/run-rpc-tests.sh | 4 +++- ci/tests/run-system-tests.sh | 4 +++- 6 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 ci/tests/common.sh diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 39145710..80fa0c3d 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -182,7 +182,17 @@ jobs: path: build key: ${{ runner.os }}-build-cache - - name: Run Tests [TEST_USE_ROCKSDB=${{ env.TEST_USE_ROCKSDB }}] - run: ci/actions/windows/run.ps1 - env: - DEADLINE_SCALE_FACTOR: ${{ env.TEST_USE_ROCKSDB == 1 && '2' || '1' }} + - name: Core Tests + if: steps.build.outcome == 'success' && (success() || failure()) + run: cd build && ../ci/tests/run-core-tests.sh + shell: bash + + - name: RPC Tests + if: steps.build.outcome == 'success' && (success() || failure()) + run: cd build && ../ci/tests/run-rpc-tests.sh + shell: bash + + - name: System Tests + if: steps.build.outcome == 'success' && (success() || failure()) + run: cd build && ../ci/tests/run-system-tests.sh + shell: bash \ No newline at end of file diff --git a/ci/tests/common.sh b/ci/tests/common.sh new file mode 100644 index 00000000..03d464a1 --- /dev/null +++ b/ci/tests/common.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +get_exec_extension() { + case "$(uname -s)" in + Linux*|Darwin*) + echo "" + ;; + CYGWIN*|MINGW32*|MSYS*|MINGW*) + echo ".exe" + ;; + *) + echo "Unknown OS" + exit 1 + ;; + esac +} \ No newline at end of file diff --git a/ci/tests/run-core-tests.sh b/ci/tests/run-core-tests.sh index e2d56136..a3e02b70 100755 --- a/ci/tests/run-core-tests.sh +++ b/ci/tests/run-core-tests.sh @@ -1,6 +1,8 @@ #!/bin/bash set -euo pipefail +source "$(dirname "$BASH_SOURCE")/common.sh" + BUILD_DIR=${1-${PWD}} -${BUILD_DIR}/core_test \ No newline at end of file +${BUILD_DIR}/core_test$(get_exec_extension) \ No newline at end of file diff --git a/ci/tests/run-qt-tests.sh b/ci/tests/run-qt-tests.sh index caceb686..8faa28d4 100755 --- a/ci/tests/run-qt-tests.sh +++ b/ci/tests/run-qt-tests.sh @@ -1,6 +1,8 @@ #!/bin/bash set -euo pipefail +source "$(dirname "$BASH_SOURCE")/common.sh" + BUILD_DIR=${1-${PWD}} # Alpine doesn't offer an xvfb @@ -18,4 +20,4 @@ xvfb_run_() return ${res} } -xvfb_run_ ${BUILD_DIR}/qt_test \ No newline at end of file +xvfb_run_ ${BUILD_DIR}/qt_test$(get_exec_extension) \ No newline at end of file diff --git a/ci/tests/run-rpc-tests.sh b/ci/tests/run-rpc-tests.sh index d62ee5de..6b64607d 100755 --- a/ci/tests/run-rpc-tests.sh +++ b/ci/tests/run-rpc-tests.sh @@ -1,6 +1,8 @@ #!/bin/bash set -euo pipefail +source "$(dirname "$BASH_SOURCE")/common.sh" + BUILD_DIR=${1-${PWD}} -${BUILD_DIR}/rpc_test \ No newline at end of file +${BUILD_DIR}/rpc_test$(get_exec_extension) \ No newline at end of file diff --git a/ci/tests/run-system-tests.sh b/ci/tests/run-system-tests.sh index 2fc71f42..e5e53945 100755 --- a/ci/tests/run-system-tests.sh +++ b/ci/tests/run-system-tests.sh @@ -1,7 +1,9 @@ #!/bin/bash set -euo pipefail +source "$(dirname "$BASH_SOURCE")/common.sh" + BUILD_DIR=${1-${PWD}} -export NANO_NODE_EXE=${BUILD_DIR}/nano_node +export NANO_NODE_EXE=${BUILD_DIR}/nano_node$(get_exec_extension) cd ../systest && ./RUNALL \ No newline at end of file