From d07a5cd19e27203e87116a468bfa114411c58665 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Tue, 15 Mar 2022 15:24:03 +0100 Subject: [PATCH] [contracts] Run contract tests in CI Introduce new nimble 'test' task that runs *all* tests. Renames testAll to testDagger, because testAll didn't run all tests, it forgot to run the contract tests. --- Makefile | 12 ++++-------- dagger.nimble | 8 ++++++-- tests/{testAll.nim => testDagger.nim} | 0 3 files changed, 10 insertions(+), 10 deletions(-) rename tests/{testAll.nim => testDagger.nim} (100%) diff --git a/Makefile b/Makefile index e00f84e9..209074ad 100644 --- a/Makefile +++ b/Makefile @@ -65,12 +65,6 @@ update: | update-common rm -rf dagger.nims && \ $(MAKE) dagger.nims $(HANDLE_OUTPUT) -# a phony target, because teaching `make` how to do conditional recompilation of Nim projects is too complicated - -testAll: | build deps - echo -e $(BUILD_MSG) "build/$@" && \ - $(ENV_SCRIPT) nim testAll $(NIM_PARAMS) dagger.nims - # detecting the os ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10... detected_OS := Windows @@ -81,8 +75,10 @@ else detected_OS := $(strip $(shell uname)) endif -# Builds and run the test suite (Waku v1 + v2) -test: | testAll +# Builds and run the test suite +test: | build deps + echo -e $(BUILD_MSG) "build/$@" && \ + $(ENV_SCRIPT) nim test $(NIM_PARAMS) dagger.nims # symlink dagger.nims: diff --git a/dagger.nimble b/dagger.nimble index 4f0618ad..f81f1acf 100644 --- a/dagger.nimble +++ b/dagger.nimble @@ -51,8 +51,12 @@ task testContracts, "Build, deploy and test contracts": # kill simulator processes exec "ps -ef | grep hardhat | grep -v grep | awk '{ print $2 }' | xargs kill" -task testAll, "Build & run Dagger tests": - test "testAll", params = "-d:chronicles_log_level=WARN" +task testDagger, "Build & run Dagger tests": + test "testDagger", params = "-d:chronicles_log_level=WARN" + +task test, "Run all tests": + testDaggerTask() + testContractsTask() task dagger, "build dagger binary": buildBinary "dagger" diff --git a/tests/testAll.nim b/tests/testDagger.nim similarity index 100% rename from tests/testAll.nim rename to tests/testDagger.nim