rust-lightning icon indicating copy to clipboard operation
rust-lightning copied to clipboard

Disallow skipping tx-sync tests in CI

Open tnull opened this issue 1 year ago • 1 comments

Minor follow-up to #3020.

Previously, we'd always skip tx-sync tests if the BITCOIND_EXE/ELECTRS_EXE environment variables would be unset. While this is especially fine for local testing, we still want to enforce tests failing if somehow the bitcoind/electrs downloading or caching in CI stops working. Here, we therefore add a CI_ENV variable that indicates we're indeed running in CI, and only skip if it's unset.

tnull avatar Aug 14 '24 07:08 tnull

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.01%. Comparing base (fc21640) to head (43bc78c). Report is 75 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3240      +/-   ##
==========================================
+ Coverage   89.74%   91.01%   +1.26%     
==========================================
  Files         122      127       +5     
  Lines      101921   114325   +12404     
  Branches   101921   114325   +12404     
==========================================
+ Hits        91470   104052   +12582     
+ Misses       7763     7684      -79     
+ Partials     2688     2589      -99     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 14 '24 07:08 codecov[bot]

Force-pushed the following changes:

> git diff-tree -U2 7883f502f 35710958f
diff --git a/ci/ci-tests.sh b/ci/ci-tests.sh
index 1a912016e..a0dc27d5a 100755
--- a/ci/ci-tests.sh
+++ b/ci/ci-tests.sh
@@ -45,20 +45,21 @@ popd

 if [[ "$HOST_PLATFORM" != *windows* ]]; then
+       pushd lightning-transaction-sync
+       echo -e "\n\nChecking Transaction Sync Clients with features."
+       cargo check --verbose --color always --features esplora-blocking
+       cargo check --verbose --color always --features esplora-async
+       cargo check --verbose --color always --features esplora-async-https
+       cargo check --verbose --color always --features electrum
+
        if [ -z "$CI_ENV" ] && [[ -z "$BITCOIND_EXE" || -z "$ELECTRS_EXE" ]]; then
                echo -e "\n\nSkipping testing Transaction Sync Clients due to BITCOIND_EXE or ELECTRS_EXE being unset."
        else
-               echo -e "\n\nBuilding and testing Transaction Sync Clients with features"
-               pushd lightning-transaction-sync
-
+               echo -e "\n\nTesting Transaction Sync Clients with features."
                cargo test --verbose --color always --features esplora-blocking
-               cargo check --verbose --color always --features esplora-blocking
                cargo test --verbose --color always --features esplora-async
-               cargo check --verbose --color always --features esplora-async
                cargo test --verbose --color always --features esplora-async-https
-               cargo check --verbose --color always --features esplora-async-https
                cargo test --verbose --color always --features electrum
-               cargo check --verbose --color always --features electrum
-               popd
        fi
+       popd
 fi

tnull avatar Aug 15 '24 17:08 tnull

Force-pushed once more:

> git diff-tree -U2 35710958f 43bc78ce3
diff --git a/ci/ci-tests.sh b/ci/ci-tests.sh
index a0dc27d5a..43d6aeaa4 100755
--- a/ci/ci-tests.sh
+++ b/ci/ci-tests.sh
@@ -54,4 +54,5 @@ if [[ "$HOST_PLATFORM" != *windows* ]]; then
        if [ -z "$CI_ENV" ] && [[ -z "$BITCOIND_EXE" || -z "$ELECTRS_EXE" ]]; then
                echo -e "\n\nSkipping testing Transaction Sync Clients due to BITCOIND_EXE or ELECTRS_EXE being unset."
+               cargo check --tests
        else
                echo -e "\n\nTesting Transaction Sync Clients with features."

tnull avatar Aug 16 '24 15:08 tnull