From ac834c90823e1007bc7c3085cc4f4372a528a5dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sat, 3 May 2025 08:44:10 +0000 Subject: [PATCH] ci: fix wasting of runtime testing resources after failed builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently we're wasting roughly about 3 minutes of precious testbed time when the firmware build CI job fails, every time. Due to increased testing, this is no longer acceptable waste of testing resources. During the investigation it was found out, that this is happening due to changes introduced in commit febd8b0032fa (".gitlab: Only run tests when TFTP_IMAGE_DOWNLOAD_URL is set"), feature which was mainly introduced to allow testing of externally build firmware images inside SoftAtHome for previous, pre-2024 contribution delivery workflow. This is no longer being used. So lets fix it, but removing of TFTP_IMAGE_DOWNLOAD_URL feature. If we need this feature again, it should be implemented in a different way, avoiding wasting of the testbed resources after failed build. Additionally, we need to change `rules: - when: always` in testbed.yml, as it would still make run the CI job, despite of the failed dependency, resorting back to the default `on_success` when rules, where the job is run only when no jobs in earlier stages fail. Signed-off-by: Petr Štetiar --- .gitlab-ci.yml | 20 +++++-------------- .gitlab/build.yml | 2 -- .gitlab/cdrouter.yml | 15 +++----------- .gitlab/cdrouter/mxl25641-hdk-6.yml | 8 +------- .gitlab/cdrouter/prpl-haze.yml | 12 +---------- .gitlab/cdrouter/turris-omnia.yml | 12 +---------- .gitlab/cdrouter/urx851-hdk-3.yml | 8 +------- .gitlab/cdrouter/wnc-freedom.yml | 8 +------- .gitlab/docker.yml | 2 -- .gitlab/testbed.yml | 17 ++++------------ .../060-xpon-mock.t | 5 ----- 11 files changed, 17 insertions(+), 92 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc62ad7d6c..779545396d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,32 +75,22 @@ coverity scan ipq807x prpl: run test Turris Omnia initramfs: allow_failure: true - needs: - - job: build test mvebu prpl security - optional: true + needs: ["build test mvebu prpl security"] extends: .turris-omnia testbed run test Haze initramfs: allow_failure: true - needs: - - job: build test ipq807x prpl security - optional: true + needs: ["build test ipq807x prpl security"] extends: .prpl-haze testbed run test URX851-HDK-3 with system on eMMC: - needs: - - job: build test mxl_x86_osp_tb341 mxl_wlan_hostap_ng prpl security - optional: true + needs: ["build test mxl_x86_osp_tb341 mxl_wlan_hostap_ng prpl security"] extends: .urx851-hdk-3 testbed run test MXL25641-HDK-6 with system on eMMC: - needs: - - job: build test mxl_x86_osp_tb341_v2 mxl_wlan_hostap_ng_wav700 prpl cellular security - optional: true + needs: ["build test mxl_x86_osp_tb341_v2 mxl_wlan_hostap_ng_wav700 prpl cellular security"] extends: .mxl25641-hdk-6 testbed run test Freedom initramfs: - needs: - - job: build test qca_ipq95xx prpl cellular security thread - optional: true + needs: ["build test qca_ipq95xx prpl cellular security thread"] extends: .wnc-freedom testbed diff --git a/.gitlab/build.yml b/.gitlab/build.yml index 8c40f882fa..86c6f7a7cd 100644 --- a/.gitlab/build.yml +++ b/.gitlab/build.yml @@ -10,8 +10,6 @@ rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - if: '$TFTP_IMAGE_DOWNLOAD_URL' - when: never - if: '$CI_COMMIT_BRANCH == $CI_DESIGNATED_BRANCH' - if: '$CI_COMMIT_TAG =~ /^prplos-v[0-9]+\.[0-9]+\.[0-9]+.*$/' - when: manual diff --git a/.gitlab/cdrouter.yml b/.gitlab/cdrouter.yml index 41cb31ebb8..420be3a5c6 100644 --- a/.gitlab/cdrouter.yml +++ b/.gitlab/cdrouter.yml @@ -5,10 +5,6 @@ rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - if: '$TFTP_IMAGE_DOWNLOAD_URL =~ $TFTP_IMAGE_FILENAME_PATTERN' - when: always - - if: '$TFTP_IMAGE_DOWNLOAD_URL' - when: never - when: manual variables: CDROUTER_CONFIG_WIFI_BEACON_PHY: 'ax b g n' @@ -43,14 +39,9 @@ fi - > - if [ -n "$TFTP_IMAGE_DOWNLOAD_URL" ]; then - echo "Downloading firmware image from $TFTP_IMAGE_DOWNLOAD_URL" - curl "$TFTP_IMAGE_DOWNLOAD_URL" > "$TESTBED_TFTP_PATH/$TFTP_IMAGE_FILENAME" - else - echo "Using firmware image $TFTP_IMAGE_PATH/$TFTP_IMAGE_FILENAME" - cp "$TFTP_IMAGE_PATH/$TFTP_IMAGE_FILENAME" "$TESTBED_TFTP_PATH" - fi - - > + echo "Using firmware image $TFTP_IMAGE_PATH/$TFTP_IMAGE_FILENAME" + cp "$TFTP_IMAGE_PATH/$TFTP_IMAGE_FILENAME" "$TESTBED_TFTP_PATH" + if [ -n "$TFTP_IMAGE_UNPACK_COMMAND" ]; then echo "Running $TFTP_IMAGE_UNPACK_COMMAND" eval "$TFTP_IMAGE_UNPACK_COMMAND" diff --git a/.gitlab/cdrouter/mxl25641-hdk-6.yml b/.gitlab/cdrouter/mxl25641-hdk-6.yml index 5525de6375..1d08bed09b 100644 --- a/.gitlab/cdrouter/mxl25641-hdk-6.yml +++ b/.gitlab/cdrouter/mxl25641-hdk-6.yml @@ -1,7 +1,5 @@ .mxl25641-cdrouter: &mxl25641_cdrouter - needs: - - job: build test mxl_x86_osp_tb341_v2 mxl_wlan_hostap_ng_wav700 prpl cellular security - optional: true + needs: ["build test mxl_x86_osp_tb341_v2 mxl_wlan_hostap_ng_wav700 prpl cellular security"] extends: - .mxl25641-hdk-6 testbed - .cdrouter @@ -49,10 +47,6 @@ CDRouter-Wireless MXL25641-HDK-6 eMMC: rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - if: '$TFTP_IMAGE_DOWNLOAD_URL =~ $TFTP_IMAGE_FILENAME_PATTERN' - when: always - - if: '$TFTP_IMAGE_DOWNLOAD_URL' - when: never - if: '$CI_COMMIT_BRANCH == $CI_DESIGNATED_BRANCH' - when: manual diff --git a/.gitlab/cdrouter/prpl-haze.yml b/.gitlab/cdrouter/prpl-haze.yml index c159bc91c2..86f70cfe1c 100644 --- a/.gitlab/cdrouter/prpl-haze.yml +++ b/.gitlab/cdrouter/prpl-haze.yml @@ -3,14 +3,8 @@ rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - if: '$TFTP_IMAGE_DOWNLOAD_URL =~ $TFTP_IMAGE_FILENAME_PATTERN' - when: always - - if: '$TFTP_IMAGE_DOWNLOAD_URL' - when: never - when: manual - needs: - - job: build test ipq807x prpl security - optional: true + needs: ["build test ipq807x prpl security"] extends: - .prpl-haze testbed - .cdrouter @@ -56,10 +50,6 @@ CDRouter-Wireless Haze initramfs: rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - if: '$TFTP_IMAGE_DOWNLOAD_URL =~ $TFTP_IMAGE_FILENAME_PATTERN' - when: always - - if: '$TFTP_IMAGE_DOWNLOAD_URL' - when: never - when: manual CDRouter-UPnP-IPv46 Haze initramfs: diff --git a/.gitlab/cdrouter/turris-omnia.yml b/.gitlab/cdrouter/turris-omnia.yml index 69adb86ce2..09f8d1e876 100644 --- a/.gitlab/cdrouter/turris-omnia.yml +++ b/.gitlab/cdrouter/turris-omnia.yml @@ -1,18 +1,12 @@ .turris-cdrouter: &turris_cdrouter allow_failure: true - needs: - - job: build test mvebu prpl security - optional: true + needs: ["build test mvebu prpl security"] extends: - .turris-omnia testbed - .cdrouter rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - if: '$TFTP_IMAGE_DOWNLOAD_URL =~ $TFTP_IMAGE_FILENAME_PATTERN' - when: always - - if: '$TFTP_IMAGE_DOWNLOAD_URL' - when: never - when: manual CDRouter-Top-100+mDNS Turris initramfs: @@ -56,10 +50,6 @@ CDRouter-Wireless Turris initramfs: rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - if: '$TFTP_IMAGE_DOWNLOAD_URL =~ $TFTP_IMAGE_FILENAME_PATTERN' - when: always - - if: '$TFTP_IMAGE_DOWNLOAD_URL' - when: never - when: manual CDRouter-UPnP-IPv46 Turris initramfs: diff --git a/.gitlab/cdrouter/urx851-hdk-3.yml b/.gitlab/cdrouter/urx851-hdk-3.yml index 779d4c321e..087160535a 100644 --- a/.gitlab/cdrouter/urx851-hdk-3.yml +++ b/.gitlab/cdrouter/urx851-hdk-3.yml @@ -1,7 +1,5 @@ .urx851-cdrouter: &urx851_cdrouter - needs: - - job: build test mxl_x86_osp_tb341 mxl_wlan_hostap_ng prpl security - optional: true + needs: ["build test mxl_x86_osp_tb341 mxl_wlan_hostap_ng prpl security"] extends: - .urx851-hdk-3 testbed - .cdrouter @@ -47,10 +45,6 @@ CDRouter-Wireless-OSPv1 URX851-HDK-3 eMMC: rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - if: '$TFTP_IMAGE_DOWNLOAD_URL =~ $TFTP_IMAGE_FILENAME_PATTERN' - when: always - - if: '$TFTP_IMAGE_DOWNLOAD_URL' - when: never - if: '$CI_COMMIT_BRANCH == $CI_DESIGNATED_BRANCH' - when: manual diff --git a/.gitlab/cdrouter/wnc-freedom.yml b/.gitlab/cdrouter/wnc-freedom.yml index b88032b017..4f8c4e2028 100644 --- a/.gitlab/cdrouter/wnc-freedom.yml +++ b/.gitlab/cdrouter/wnc-freedom.yml @@ -1,7 +1,5 @@ .wnc-freedom: &wnc_freedom - needs: - - job: build test qca_ipq95xx prpl cellular security thread - optional: true + needs: ["build test qca_ipq95xx prpl cellular security thread"] extends: - .wnc-freedom testbed - .cdrouter @@ -49,10 +47,6 @@ CDRouter-Wireless Freedom initramfs: rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - if: '$TFTP_IMAGE_DOWNLOAD_URL =~ $TFTP_IMAGE_FILENAME_PATTERN' - when: always - - if: '$TFTP_IMAGE_DOWNLOAD_URL' - when: never - if: '$CI_COMMIT_BRANCH == $CI_DESIGNATED_BRANCH' - when: manual diff --git a/.gitlab/docker.yml b/.gitlab/docker.yml index 55efda03ea..13fb202688 100644 --- a/.gitlab/docker.yml +++ b/.gitlab/docker.yml @@ -7,8 +7,6 @@ rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - if: '$TFTP_IMAGE_DOWNLOAD_URL' - when: never - if: '$CI_COMMIT_BRANCH == $CI_DESIGNATED_BRANCH' - when: manual allow_failure: true diff --git a/.gitlab/testbed.yml b/.gitlab/testbed.yml index bac5567072..d90c0da2ab 100644 --- a/.gitlab/testbed.yml +++ b/.gitlab/testbed.yml @@ -5,11 +5,7 @@ rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - if: '$TFTP_IMAGE_DOWNLOAD_URL =~ $TFTP_IMAGE_FILENAME_PATTERN' - when: always - - if: '$TFTP_IMAGE_DOWNLOAD_URL' - when: never - - when: always + - when: on_success variables: DUT_WAN_INTERFACE: eth1 TESTBED_MNG_INTERFACE: enp1s0 @@ -53,14 +49,9 @@ fi - > - if [ -n "$TFTP_IMAGE_DOWNLOAD_URL" ]; then - echo "Downloading firmware image from $TFTP_IMAGE_DOWNLOAD_URL" - curl --fail "$TFTP_IMAGE_DOWNLOAD_URL" > "$TESTBED_TFTP_PATH/$TFTP_IMAGE_FILENAME" - else - echo "Using firmware image $TFTP_IMAGE_PATH/$TFTP_IMAGE_FILENAME" - cp "$TFTP_IMAGE_PATH/$TFTP_IMAGE_FILENAME" "$TESTBED_TFTP_PATH" - fi - - > + echo "Using firmware image $TFTP_IMAGE_PATH/$TFTP_IMAGE_FILENAME" + cp "$TFTP_IMAGE_PATH/$TFTP_IMAGE_FILENAME" "$TESTBED_TFTP_PATH" + if [ -n "$TFTP_IMAGE_UNPACK_COMMAND" ]; then echo "Running $TFTP_IMAGE_UNPACK_COMMAND" eval "$TFTP_IMAGE_UNPACK_COMMAND" diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/060-xpon-mock.t b/.gitlab/tests/cram/generic/acceleration-plan-components/060-xpon-mock.t index 7bebfbc40f..ffb1b5623c 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/060-xpon-mock.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/060-xpon-mock.t @@ -2,11 +2,6 @@ Create R alias: $ alias R="${CRAM_REMOTE_COMMAND:-}" -Skip the tests if TFTP_IMAGE_DOWNLOAD_URL is used as the mock package would be missing: - - $ [ -n "$TFTP_IMAGE_DOWNLOAD_URL" ] && exit 80 - [1] - Skip test on urx851-b0-dk-pon as it has real PON and thus mocking is not needed: $ [ "$DUT_BOARD" = "urx851-b0-dk-pon" ] && exit 80