From edd88ea9e93cb9c13e8766fc4c8a5654d2637e28 Mon Sep 17 00:00:00 2001 From: Bogdan Kolendovskyy Date: Wed, 19 Nov 2025 13:41:33 +0100 Subject: [PATCH] ci: Fix mqtt being unavailable to host test --- .gitlab/ci/test.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.gitlab/ci/test.yml b/.gitlab/ci/test.yml index 319432d..d9d877e 100644 --- a/.gitlab/ci/test.yml +++ b/.gitlab/ci/test.yml @@ -26,12 +26,20 @@ host_tests: path: "**/coverage.xml" before_script: - pip install -U gcovr 'idf-ci<1' - script: - - idf-ci build run -t linux -p test/host - - cd test/host - - ./build_linux_coverage/host_mqtt_client_test.elf -r junit -o junit.xml - - cd ../.. - - gcovr --gcov-ignore-parse-errors -g -k -r . --html coverage.html -x coverage.xml + script: | + set -euo pipefail + ORIG_DIR="${CI_PROJECT_DIR:-$(pwd)}" + cd "${ORIG_DIR}" + echo "Original dir: $(pwd)" + rm -rf mqtt + git worktree add --force mqtt HEAD || (echo "Worktree failed; using local clone" && git clone --local --no-hardlinks . mqtt) + git worktree list || true + cd mqtt + idf-ci build run -t linux -p test/host + cd test/host + ./build_linux_coverage/host_mqtt_client_test.elf -r junit -o junit.xml + cd ../.. + gcovr --gcov-ignore-parse-errors -g -k -r . --html coverage.html -x coverage.xml check_remotes_sync: stage: test_deploy