mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-21 20:10:36 +00:00
Show last 10 lines from the test log file on test failure (#4284)
This commit is contained in:
parent
8417b7e064
commit
865637e8d8
16
Makefile
16
Makefile
@ -36,6 +36,8 @@ VALIDATORS := 1
|
||||
CPU_LIMIT := 0
|
||||
BUILD_END_MSG := "\\x1B[92mBuild completed successfully:\\x1B[39m"
|
||||
|
||||
TEST_MODULES_FLAGS := -d:chronicles_log_level=TRACE -d:chronicles_sinks=json[file]
|
||||
|
||||
ifeq ($(CPU_LIMIT), 0)
|
||||
CPU_LIMIT_CMD :=
|
||||
else
|
||||
@ -248,7 +250,7 @@ consensus_spec_tests_mainnet: | build deps
|
||||
MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
|
||||
$@ \
|
||||
"tests/consensus_spec/consensus_spec_tests_preset.nim" \
|
||||
$(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:chronicles_sinks="json[file]" && \
|
||||
$(NIM_PARAMS) -d:const_preset=mainnet $(TEST_MODULES_FLAGS) && \
|
||||
echo -e $(BUILD_END_MSG) "build/$@"
|
||||
|
||||
consensus_spec_tests_minimal: | build deps
|
||||
@ -256,7 +258,7 @@ consensus_spec_tests_minimal: | build deps
|
||||
MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
|
||||
$@ \
|
||||
"tests/consensus_spec/consensus_spec_tests_preset.nim" \
|
||||
$(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:const_preset=minimal -d:chronicles_sinks="json[file]" && \
|
||||
$(NIM_PARAMS) -d:const_preset=minimal $(TEST_MODULES_FLAGS) && \
|
||||
echo -e $(BUILD_END_MSG) "build/$@"
|
||||
|
||||
# Tests we only run for the default preset
|
||||
@ -265,7 +267,7 @@ proto_array: | build deps
|
||||
MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
|
||||
$@ \
|
||||
"beacon_chain/fork_choice/$@.nim" \
|
||||
$(NIM_PARAMS) -d:chronicles_sinks="json[file]" && \
|
||||
$(NIM_PARAMS) $(TEST_MODULES_FLAGS) && \
|
||||
echo -e $(BUILD_END_MSG) "build/$@"
|
||||
|
||||
fork_choice: | build deps
|
||||
@ -273,7 +275,7 @@ fork_choice: | build deps
|
||||
MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
|
||||
$@ \
|
||||
"beacon_chain/fork_choice/$@.nim" \
|
||||
$(NIM_PARAMS) -d:chronicles_sinks="json[file]" && \
|
||||
$(NIM_PARAMS) $(TEST_MODULES_FLAGS) && \
|
||||
echo -e $(BUILD_END_MSG) "build/$@"
|
||||
|
||||
all_tests: | build deps
|
||||
@ -281,7 +283,7 @@ all_tests: | build deps
|
||||
MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
|
||||
$@ \
|
||||
"tests/$@.nim" \
|
||||
$(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:chronicles_sinks="json[file]" && \
|
||||
$(NIM_PARAMS) $(TEST_MODULES_FLAGS) && \
|
||||
echo -e $(BUILD_END_MSG) "build/$@"
|
||||
|
||||
# State and block sims; getting to 4th epoch triggers consensus checks
|
||||
@ -310,7 +312,7 @@ endif
|
||||
for TEST_BINARY in $(XML_TEST_BINARIES); do \
|
||||
PARAMS="--xml:build/$${TEST_BINARY}.xml --console"; \
|
||||
echo -e "\nRunning $${TEST_BINARY} $${PARAMS}\n"; \
|
||||
build/$${TEST_BINARY} $${PARAMS} || { echo -e "\n$${TEST_BINARY} $${PARAMS} failed; Aborting."; exit 1; }; \
|
||||
build/$${TEST_BINARY} $${PARAMS} || { echo -e "\n$${TEST_BINARY} $${PARAMS} failed; Last 10 lines from the log:"; tail -n10 "$${TEST_BINARY}.log"; exit 1; }; \
|
||||
done; \
|
||||
rm -rf 0000-*.json t_slashprot_migration.* *.log block_sim_db
|
||||
for TEST_BINARY in $(TEST_BINARIES); do \
|
||||
@ -319,7 +321,7 @@ endif
|
||||
elif [[ "$${TEST_BINARY}" == "block_sim" ]]; then PARAMS="--validators=8000 --slots=160"; \
|
||||
fi; \
|
||||
echo -e "\nRunning $${TEST_BINARY} $${PARAMS}\n"; \
|
||||
build/$${TEST_BINARY} $${PARAMS} || { echo -e "\n$${TEST_BINARY} $${PARAMS} failed; Aborting."; exit 1; }; \
|
||||
build/$${TEST_BINARY} $${PARAMS} || { echo -e "\n$${TEST_BINARY} $${PARAMS} failed; Last 10 lines from the log:"; tail -n10 "$${TEST_BINARY}.log"; exit 1; }; \
|
||||
done; \
|
||||
rm -rf 0000-*.json t_slashprot_migration.* *.log block_sim_db
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user