From 313dd1e1a819b15570f32061388f9e13a2b56e53 Mon Sep 17 00:00:00 2001 From: Chemaclass Date: Tue, 14 Jul 2026 15:24:19 +0200 Subject: [PATCH 1/2] test(cli): stop upgrade acceptance test flapping on network flakes test_upgrade_when_a_new_version_found runs a real network upgrade. It only skipped on empty output, so a non-empty non-regression outcome (tag-resolve failure, download failure, or a no-op when latest already equals the built version) failed CI intermittently. Capture stderr and skip those known transient cases; a genuine upgrade regression still reaches the assertions. --- tests/acceptance/bashunit_upgrade_test.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/bashunit_upgrade_test.sh b/tests/acceptance/bashunit_upgrade_test.sh index 0f2adc99..d59fb995 100644 --- a/tests/acceptance/bashunit_upgrade_test.sh +++ b/tests/acceptance/bashunit_upgrade_test.sh @@ -69,11 +69,19 @@ function test_upgrade_when_a_new_version_found() { fi local output - output="$($TMP_BIN upgrade 2>/dev/null)" - - if [[ -z "$output" ]]; then - bashunit::skip "upgrade produced no output (transient network failure)" && return - fi + output="$($TMP_BIN upgrade 2>&1)" + + # Real-network test: skip on the non-regression outcomes (no output, tag/download + # failure, or a no-op when latest already equals the built version) so a flaky + # network doesn't fail CI; a genuine upgrade regression still hits the asserts. + case "$output" in + '' | \ + *"Failed to resolve latest"* | \ + *"Failed to download"* | \ + *"You are already on latest version"*) + bashunit::skip "upgrade could not run (transient network/env)" && return + ;; + esac assert_contains "> Upgrading bashunit to latest version" "$output" assert_contains "> bashunit upgraded successfully to latest version $LATEST_VERSION" "$output" From 6230e4f571ab8fc92a519b558a8b5249e3852dfe Mon Sep 17 00:00:00 2001 From: Chemaclass Date: Tue, 14 Jul 2026 15:26:27 +0200 Subject: [PATCH 2/2] test(cli): skip install checksum tests when the checksum asset is unreachable install.sh prints "> Skipping checksum verification: " when the sha tool is missing or the checksum asset can't be downloaded. The two checksum acceptance tests only guarded on the binary file existing, so a transient checksum-asset fetch failure dropped the "Checksum verified" line and failed CI. Skip on that explicit signal; a real mismatch still fails loudly. --- tests/acceptance/install_test.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/acceptance/install_test.sh b/tests/acceptance/install_test.sh index ffa6e8b2..c9bdcb78 100644 --- a/tests/acceptance/install_test.sh +++ b/tests/acceptance/install_test.sh @@ -145,6 +145,11 @@ function test_install_verifies_checksum_when_enabled() { if [ ! -f "./tmp_install/bashunit" ]; then bashunit::skip "transient download failure" && return fi + case "$output" in + *"Skipping checksum verification"*) + bashunit::skip "checksum asset unreachable (transient network/env)" && return + ;; + esac assert_contains "Checksum verified" "$output" assert_file_exists "./tmp_install/bashunit" assert_same "$(printf "\e[1m\e[32mbashunit\e[0m - 0.37.0")" \ @@ -168,6 +173,11 @@ function test_install_verifies_checksum_by_default() { if [ ! -f "./tmp_install/bashunit" ]; then bashunit::skip "transient download failure" && return fi + case "$output" in + *"Skipping checksum verification"*) + bashunit::skip "checksum asset unreachable (transient network/env)" && return + ;; + esac assert_contains "Checksum verified" "$output" assert_file_exists "./tmp_install/bashunit" }