mirror of
https://github.com/status-im/nim-codex.git
synced 2025-02-10 17:56:32 +00:00
Allow parallel integration tests to be disabled
Disable with `make ENABLE_PARALLEL_TESTS=0 testIntegration`
This commit is contained in:
parent
9b1584d2aa
commit
42152773ce
6
.github/workflows/ci-reusable.yml
vendored
6
.github/workflows/ci-reusable.yml
vendored
@ -62,7 +62,7 @@ jobs:
|
||||
npm install
|
||||
|
||||
- name: Run Ethereum node with Codex contracts
|
||||
if: matrix.tests == 'contract' || matrix.tests == 'tools' || matrix.tests == 'all'
|
||||
if: matrix.tests == 'contract' || matrix.tests == 'integration' || matrix.tests == 'tools' || matrix.tests == 'all'
|
||||
working-directory: vendor/codex-contracts-eth
|
||||
env:
|
||||
MSYS2_PATH_TYPE: inherit
|
||||
@ -77,6 +77,10 @@ jobs:
|
||||
## Part 3 Tests ##
|
||||
- name: Integration tests
|
||||
if: matrix.tests == 'integration' || matrix.tests == 'all'
|
||||
run: make -j${ncpu} ENABLE_PARALLEL_TESTS=0 testIntegration
|
||||
|
||||
- name: Parallel integration tests
|
||||
if: matrix.tests == 'integration-parallel'
|
||||
run: make -j${ncpu} DEBUG_CODEXNODES=1 DEBUG_TESTHARNESS=1 DEBUG_UPDATES=1 testIntegration
|
||||
|
||||
- name: Upload integration tests log files
|
||||
|
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -27,9 +27,9 @@ jobs:
|
||||
uses: fabiocaccamo/create-matrix-action@v5
|
||||
with:
|
||||
matrix: |
|
||||
os {linux}, cpu {amd64}, builder {runner-node-01-linux-02-eu-hel1}, tests {integration}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
||||
os {macos}, cpu {amd64}, builder {macos-14-large}, tests {integration}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
||||
os {windows}, cpu {amd64}, builder {windows-latest-amd64-32vcpu}, tests {integration}, nim_version {${{ env.nim_version }}}, shell {msys2}
|
||||
os {linux}, cpu {amd64}, builder {runner-node-01-linux-03-eu-hel1}, tests {integration-parallel}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
||||
os {macos}, cpu {amd64}, builder {macos-14-large}, tests {integration-parallel}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
||||
os {windows}, cpu {amd64}, builder {windows-latest-amd64-32vcpu}, tests {integration-parallel}, nim_version {${{ env.nim_version }}}, shell {msys2}
|
||||
|
||||
|
||||
build:
|
||||
|
3
Makefile
3
Makefile
@ -157,6 +157,9 @@ endif
|
||||
ifdef TEST_TIMEOUT
|
||||
TEST_PARAMS := $(TEST_PARAMS) -d:TestTimeout=$(TEST_TIMEOUT)
|
||||
endif
|
||||
ifdef ENABLE_PARALLEL_TESTS
|
||||
TEST_PARAMS := $(TEST_PARAMS) -d:EnableParallelTests=$(ENABLE_PARALLEL_TESTS)
|
||||
endif
|
||||
|
||||
# Builds and runs the integration tests
|
||||
testIntegration: | build deps
|
||||
|
@ -55,6 +55,7 @@ task testIntegration, "Run integration tests":
|
||||
for i in 2 ..< paramCount():
|
||||
if "DebugTestHarness" in paramStr(i) and truthy paramStr(i).split('=')[1]:
|
||||
testParams = "-d:chronicles_log_level=TRACE -d:chronicles_sinks=textlines[stdout]"
|
||||
break
|
||||
test "testIntegration", params = testParams
|
||||
# use params to enable logging from the integration test executable
|
||||
# test "testIntegration", params = "-d:chronicles_sinks=textlines[notimestamps,stdout],textlines[dynamic] " &
|
||||
|
@ -34,6 +34,8 @@ const ShowContinuousStatusUpdates {.booldefine.} = false
|
||||
# Timeout duration (in mimutes) for EACH integration test file.
|
||||
const TestTimeout {.intdefine.} = 60
|
||||
|
||||
const EnableParallelTests {.booldefine.} = true
|
||||
|
||||
proc run() {.async.} =
|
||||
when DebugTestHarness and enabledLogLevel != LogLevel.TRACE:
|
||||
styledEcho bgWhite,
|
||||
@ -78,4 +80,17 @@ proc run() {.async.} =
|
||||
if not wasSuccessful:
|
||||
quit(1) # indicate with a non-zero exit code that the tests failed
|
||||
|
||||
waitFor run()
|
||||
when EnableParallelTests:
|
||||
waitFor run()
|
||||
else:
|
||||
# run tests serially
|
||||
import ./integration/testcli
|
||||
import ./integration/testrestapi
|
||||
import ./integration/testupdownload
|
||||
import ./integration/testsales
|
||||
import ./integration/testpurchasing
|
||||
import ./integration/testblockexpiration
|
||||
import ./integration/testmarketplace
|
||||
import ./integration/testproofs
|
||||
import ./integration/testvalidator
|
||||
import ./integration/testecbug
|
||||
|
Loading…
x
Reference in New Issue
Block a user