From bf3ce384e5a84ffbbc08d6b63d8ff764a3a62626 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 12 Oct 2021 18:09:08 +0200 Subject: [PATCH] handle multi worker --- lib/common.sh | 5 +++-- lib/tests_coordination.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/common.sh b/lib/common.sh index 931db29..9663a64 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -14,10 +14,11 @@ DIST=${DIST:-buster} # Yunohost version: stable, testing or unstable YNH_BRANCH=${YNH_BRANCH:-stable} +WORKER_ID=${WORKER_ID:-0} LXC_BASE="ynh-appci-$DIST-$ARCH-$YNH_BRANCH-base" -LXC_NAME="ynh-appci-$DIST-$ARCH-$YNH_BRANCH-test" +LXC_NAME="ynh-appci-$DIST-$ARCH-$YNH_BRANCH-test-${WORKER_ID}" -readonly lock_file="./pcheck.lock" +readonly lock_file="./pcheck-${WORKER_ID}.lock" DEFAULT_PHP_VERSION="7.3" [[ "$DIST" == "bullseye" ]] && DEFAULT_PHP_VERSION="7.4" diff --git a/lib/tests_coordination.sh b/lib/tests_coordination.sh index 1e81022..9861f03 100644 --- a/lib/tests_coordination.sh +++ b/lib/tests_coordination.sh @@ -4,7 +4,7 @@ source lib/lxc.sh source lib/tests.sh source lib/witness.sh -complete_log="./Complete.log" +readonly complete_log="./Complete-${LXC_NAME}.log" # Purge some log files rm -f "$complete_log" && touch "$complete_log" @@ -295,7 +295,7 @@ run_all_tests() { # Print the final results of the tests log_title "Tests summary" - python3 lib/analyze_test_results.py $TEST_CONTEXT 2>./results.json + python3 lib/analyze_test_results.py $TEST_CONTEXT 2> ./results-${LXC_NAME}.json [[ -e "$TEST_CONTEXT/summary.png" ]] && cp "$TEST_CONTEXT/summary.png" ./summary.png || rm -f summary.png # Restore the started time for the timer