From 5a97b034e21f01a6f92723078264d2528d51870a Mon Sep 17 00:00:00 2001 From: Jakub Date: Mon, 21 Oct 2024 20:49:17 +0200 Subject: [PATCH] fix(nim-tests): split tests into individual targets (#16546) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(nim-tests): split tests into individual targets Otherwise combining separate `nim` calls with `;` results in only the last one informing `make` call what exit code the hole target had. Resolves: https://github.com/status-im/status-desktop/issues/16545 Signed-off-by: Jakub Sokołowski * test: fix message_model test * fix; Update default sorting for assets and collectibles (#16552) * chore(status-go): bump status-go to latest (#16559) * test: fix collectibles_model test --------- Signed-off-by: Jakub Sokołowski Co-authored-by: Jonathan Rainville Co-authored-by: Cuteivist Co-authored-by: Dario Gabriel Lipicar --- Makefile | 9 ++++++--- ci/Jenkinsfile.tests-nim | 6 ++++-- src/app/modules/shared_models/collectibles_entry.nim | 2 +- test/nim/message_model_test.nim | 2 ++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 76c00e897e..396f4546ec 100644 --- a/Makefile +++ b/Makefile @@ -851,9 +851,12 @@ run-windows: compile_windows_resources nim_status_client $(NIM_WINDOWS_PREBUILT_ ./bin/nim_status_client.exe $(ARGS) NIM_TEST_FILES := $(wildcard test/nim/*.nim) +NIM_TESTS := $(foreach test_file,$(NIM_TEST_FILES),nim-test-run/$(test_file)) -tests-nim-linux: | dotherside - LD_LIBRARY_PATH="$(QT5_LIBDIR):$(LD_LIBRARY_PATH)" \ - $(foreach nimfile,$(NIM_TEST_FILES),$(ENV_SCRIPT) nim c $(NIM_PARAMS) $(NIM_EXTRA_PARAMS) -r $(nimfile);) +nim-test-run/%: | dotherside + LD_LIBRARY_PATH="$(QT5_LIBDIR):$(LD_LIBRARY_PATH)" $(ENV_SCRIPT) \ + nim c $(NIM_PARAMS) $(NIM_EXTRA_PARAMS) -r $(subst nim-test-run/,,$@) + +tests-nim-linux: $(NIM_TESTS) endif # "variables.mk" was not included diff --git a/ci/Jenkinsfile.tests-nim b/ci/Jenkinsfile.tests-nim index 3558bd0c0b..fae45e3af2 100644 --- a/ci/Jenkinsfile.tests-nim +++ b/ci/Jenkinsfile.tests-nim @@ -44,7 +44,7 @@ pipeline { environment { PLATFORM = 'tests/nim' /* Improve make performance */ - MAKEFLAGS = "-j4 V=${params.VERBOSE}" + MAKEFLAGS = "-j${utils.getProcCount()} V=${params.VERBOSE}" /* Makefile assumes the compiler folder is included */ QTDIR = "/opt/qt/5.15.2/gcc_64" /* Avoid weird bugs caused by stale cache. */ @@ -62,7 +62,9 @@ pipeline { } stage('Tests') { - steps { sh 'make tests-nim-linux' } + steps { + sh 'make tests-nim-linux V=1' + } } } diff --git a/src/app/modules/shared_models/collectibles_entry.nim b/src/app/modules/shared_models/collectibles_entry.nim index 1c2e9261d9..865ac9703e 100644 --- a/src/app/modules/shared_models/collectibles_entry.nim +++ b/src/app/modules/shared_models/collectibles_entry.nim @@ -396,7 +396,7 @@ QtObject: result.extradata = extradata result.generatedId = result.id.toString() result.generatedCollectionId = result.id.contractID.toString() - result.tokenType = contractTypeToTokenType(data.contractType.get()) + result.tokenType = contractTypeToTokenType(data.contractType.get(ContractType.ContractTypeUnknown)) result.setup() proc newCollectibleDetailsBasicEntry*(id: backend.CollectibleUniqueID, extradata: ExtraData): CollectiblesEntry = diff --git a/test/nim/message_model_test.nim b/test/nim/message_model_test.nim index dc3228203c..269247cb0d 100644 --- a/test/nim/message_model_test.nim +++ b/test/nim/message_model_test.nim @@ -12,6 +12,7 @@ proc createTestMessageItem(id: string, clock: int64): Item = return initItem( id = id, communityId = "", + chatId = "", responseToMessageWithId = "", senderId = "", senderDisplayName = "", @@ -60,6 +61,7 @@ proc createTestMessageItem(id: string, clock: int64): Item = albumMessageIds = @[], albumImagesCount = 0, bridgeMessage = BridgeMessage(), + quotedBridgeMessage = BridgeMessage(), ) let message0_chatIdentifier = createTestMessageItem("chat-identifier", -2)