Skip to content

Remove redundant cargo check/test calls from CI scripts#4459

Open
joostjager wants to merge 1 commit intolightningdevkit:mainfrom
joostjager:ci-cleanup-redundant-checks
Open

Remove redundant cargo check/test calls from CI scripts#4459
joostjager wants to merge 1 commit intolightningdevkit:mainfrom
joostjager:ci-cleanup-redundant-checks

Conversation

@joostjager
Copy link
Contributor

  • Remove cargo check calls that immediately followed cargo test with the same crate and features, as cargo test already compiles everything that cargo check would.
  • Add --tests to cargo check calls that precede cargo test, so test code is also checked for compilation errors.
  • Replace per-member cargo doc loop with cargo doc --workspace.
  • Move feature-specific cargo check for lightning-transaction-sync into the skip branch only, avoiding redundant work when tests run.
  • Remove redundant cargo test -p lightning-custom-message already covered by the workspace-level cargo test.
  • Fix stale "except lightning-transaction-sync" comments, as that crate was moved back into the workspace in b19848e.

AI tools were used in preparing this commit.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Mar 4, 2026

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@joostjager joostjager marked this pull request as ready for review March 4, 2026 13:30
@ldk-reviews-bot ldk-reviews-bot requested a review from jkczyz March 4, 2026 13:30
@@ -6,12 +6,10 @@ source "$(dirname "$0")/ci-tests-common.sh"

echo -e "\n\nChecking and testing lightning with features"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you remove the check part, you might want to update the printed message here and elsewhere to remove the Checking part.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed. I left it in place in ci-tests-sync.sh, because there is still some only-checking in non CI.


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 -p lightning-transaction-sync --tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this line dropped?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored

- Remove `cargo check` calls that immediately followed `cargo test`
  with the same crate and features, as `cargo test` already compiles
  everything that `cargo check` would.
- Add `--tests` to `cargo check` calls that precede `cargo test`, so
  test code is also checked for compilation errors.
- Replace per-member `cargo doc` loop with `cargo doc --workspace`.
- Move feature-specific `cargo check` for lightning-transaction-sync
  into the skip branch only, avoiding redundant work when tests run.
- Remove redundant `cargo test -p lightning-custom-message` already
  covered by the workspace-level `cargo test`.
- Fix stale "except lightning-transaction-sync" comments, as that
  crate was moved back into the workspace in b19848e.

AI tools were used in preparing this commit.
@joostjager joostjager force-pushed the ci-cleanup-redundant-checks branch from 03629f0 to 6b0eeea Compare March 5, 2026 08:08
@joostjager joostjager requested a review from tnull March 5, 2026 08:40
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.07%. Comparing base (90b79e4) to head (6b0eeea).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4459      +/-   ##
==========================================
+ Coverage   85.97%   86.07%   +0.09%     
==========================================
  Files         159      159              
  Lines      104722   105185     +463     
  Branches   104722   105185     +463     
==========================================
+ Hits        90030    90533     +503     
+ Misses      12191    12140      -51     
- Partials     2501     2512      +11     
Flag Coverage Δ
tests 86.07% <ø> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joostjager joostjager self-assigned this Mar 5, 2026
Copy link
Contributor

@jkczyz jkczyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review courtesy of Claude

@@ -7,23 +7,17 @@ source "$(dirname "$0")/ci-tests-common.sh"
echo -e "\n\nChecking and testing Block Sync Clients with features"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop "Checking and ".

Comment on lines +8 to 11
cargo check --tests --quiet --color always

WORKSPACE_MEMBERS=( $(cat Cargo.toml | tr '\n' '\r' | sed 's/\r //g' | tr '\r' '\n' | grep '^members =' | sed 's/members.*=.*\[//' | tr -d '"' | tr ',' ' ') )

echo -e "\n\nTesting the workspace, except lightning-transaction-sync."
echo -e "\n\nTesting the workspace."
cargo test --quiet --color always
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these two redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the goal is to fail as fast as possible - perhaps 🤷‍♂️

cargo check -p lightning-transaction-sync --tests --quiet --color always --features esplora-async-https
cargo check -p lightning-transaction-sync --tests --quiet --color always --features electrum
else
echo -e "\n\nTesting Transaction Sync Clients with features."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also test without any features?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants