mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-02 14:03:06 +00:00
fix: make test configuration (#3480)
This commit is contained in:
parent
c3991dbbc1
commit
a0f8cb8297
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@ -119,12 +119,13 @@ jobs:
|
||||
sudo docker run --rm -d -e POSTGRES_PASSWORD=test123 -p 5432:5432 postgres:15.4-alpine3.18
|
||||
postgres_enabled=1
|
||||
fi
|
||||
|
||||
|
||||
export MAKEFLAGS="-j1"
|
||||
export NIMFLAGS="--colors:off -d:chronicles_colors:none"
|
||||
export USE_LIBBACKTRACE=0
|
||||
|
||||
make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 POSTGRES=$postgres_enabled test testwakunode2
|
||||
make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 POSTGRES=$postgres_enabled test
|
||||
make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 POSTGRES=$postgres_enabled testwakunode2
|
||||
|
||||
build-docker-image:
|
||||
needs: changes
|
||||
|
||||
21
Makefile
21
Makefile
@ -53,7 +53,19 @@ endif
|
||||
# default target, because it's the first one that doesn't start with '.'
|
||||
all: | wakunode2 example2 chat2 chat2bridge libwaku
|
||||
|
||||
test: | testcommon testwaku
|
||||
TEST_FILE := $(word 2,$(MAKECMDGOALS))
|
||||
TEST_NAME := $(wordlist 3,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
||||
|
||||
test:
|
||||
ifeq ($(strip $(TEST_FILE)),)
|
||||
$(MAKE) testcommon
|
||||
$(MAKE) testwaku
|
||||
else
|
||||
$(MAKE) compile-test $(TEST_FILE) $(TEST_NAME)
|
||||
endif
|
||||
# this prevents make from erroring on unknown targets like "Index"
|
||||
%:
|
||||
@true
|
||||
|
||||
waku.nims:
|
||||
ln -s waku.nimble $@
|
||||
@ -244,9 +256,10 @@ build/%: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$*" && \
|
||||
$(ENV_SCRIPT) nim buildone $(NIM_PARAMS) waku.nims $*
|
||||
|
||||
test/%: | build deps librln
|
||||
echo -e $(BUILD_MSG) "test/$*" && \
|
||||
$(ENV_SCRIPT) nim testone $(NIM_PARAMS) waku.nims $*
|
||||
compile-test: | build deps librln
|
||||
echo -e $(BUILD_MSG) "$(TEST_FILE)" && \
|
||||
$(ENV_SCRIPT) nim buildTest $(NIM_PARAMS) waku.nims $(TEST_FILE) && \
|
||||
$(ENV_SCRIPT) nim execTest $(NIM_PARAMS) waku.nims $(TEST_FILE) "$(TEST_NAME)"
|
||||
|
||||
################
|
||||
## Waku tools ##
|
||||
|
||||
@ -38,7 +38,8 @@ when os == "Linux" and
|
||||
#./waku_archive_legacy/test_driver_postgres_query,
|
||||
#./waku_archive_legacy/test_driver_postgres,
|
||||
./factory/test_node_factory,
|
||||
./wakunode_rest/test_rest_store
|
||||
./wakunode_rest/test_rest_store,
|
||||
./wakunode_rest/test_all
|
||||
|
||||
# Waku store test suite
|
||||
import
|
||||
@ -91,9 +92,6 @@ import
|
||||
# Waku Keystore test suite
|
||||
import ./test_waku_keystore_keyfile, ./test_waku_keystore
|
||||
|
||||
## Wakunode Rest API test suite
|
||||
import ./wakunode_rest/test_all
|
||||
|
||||
import ./waku_rln_relay/test_all
|
||||
|
||||
# Node Factory
|
||||
|
||||
@ -161,10 +161,13 @@ task buildone, "Build custom target":
|
||||
let filepath = paramStr(paramCount())
|
||||
discard buildModule filepath
|
||||
|
||||
task testone, "Test custom target":
|
||||
task buildTest, "Test custom target":
|
||||
let filepath = paramStr(paramCount())
|
||||
if buildModule(filepath):
|
||||
exec "build/" & filepath & ".bin"
|
||||
discard buildModule(filepath)
|
||||
|
||||
task execTest, "Run test":
|
||||
let filepath = paramStr(paramCount() - 1)
|
||||
exec "build/" & filepath & ".bin" & " test \"" & paramStr(paramCount()) & "\""
|
||||
|
||||
### C Bindings
|
||||
let chroniclesParams =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user