Repository navigation
test: keep blocktank staging tests out of the default run - #224
Conversation
Blocktank staging now requires an auth key that only the app repositories' CI has, so the tests calling the live staging API cannot pass here. Removes the 12 tests that call Blocktank over the network (info fetch, order and CJIT creation and refresh, fee estimates, regtest mine and deposit) and the STAGING_SERVER constant. The offline DB, model and liquidity tests stay and now build the client with the default URL, which they never call. Verified: cargo build --locked, cargo clippy --locked --all-targets, cargo test --locked
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Removes the 12 Blocktank tests that call the live staging API (now auth-gated) and the STAGING_SERVER constant; the offline DB, model and liquidity tests stay and build the client with the default URL. Reviewed d8b4c20, full tier, static only.
What I checked, and 3 candidates I ruled out
Read: the full diff of src/modules/blocktank/tests.rs, the remaining test list, BlocktankDB::new in db.rs
Removed tests (12, matches the description): test_fetch_and_store_info, test_create_and_store_order, test_refresh_orders, test_refresh_active_orders, test_get_min_zero_conf_tx_fee, test_estimate_order_fee, test_estimate_order_fee_full, test_cjit_entry_integration, test_cjit_entry_invalid_params, test_refresh_active_cjit_entries, test_regtest_mine, test_regtest_deposit
Build: skipped, talos-pr-run could not confirm the author's permission on this repo and fails closed, so nothing was compiled or run here
CI at review time: wake-tests, paykit-route-tests, manifests and SwiftPM green; usdt-tests (the job running cargo clippy --locked --lib --tests, which compiles this module's tests) and both bindgen jobs still pending
Ruled out
- Dangling
STAGING_SERVERreference: no other use in the crate; the only remainingstag0hosts are Electrum URLs inonchain/tests.rs, unrelated. - Dropping
use super::*leaves a name unresolved: the parent scope held only the removed constant;BlocktankDBandBlocktankErrorcome from the explicitcrate::modules::blocktankimport, the model types from therust_blocktank_client::*glob. - Remaining tests now hitting production through
DEFAULT_BLOCKTANK_URL: the only network call left isfetch_and_store_infointest_fetch_and_store_info_error_handling, which points athttp://invalid-url; the rest build fixtures locally (create_test_order,create_test_cjit_entry,create_test_info).
Merge confidence: 4/5. Nothing to fix; it is not 5 because I could not build it, and the CI job that compiles these tests was still running.
coreyphillips
left a comment
There was a problem hiding this comment.
Two independent reviews.
needs changing before merge
- Removes staging tests that still pass; only the regtest routes need auth (src/modules/blocktank/tests.rs:105)
worth doing, does not block
- Regtest tests could skip without the key instead of being deleted (src/modules/blocktank/tests.rs:1225)
- Removing the staging tests also drops empty-refresh coverage (src/modules/blocktank/tests.rs:749)
- The PR description overstates which tests failed for lack of auth. The cited run reported a successful info request and 404 responses for order and CJIT creation. Only mining and deposit returned 401. The shared reason for removing all 12 tests is their dependency on live staging. PR #190 review
Restores the 12 Blocktank tests the previous commit removed. Only the regtest routes need staging's auth key; the other tests still pass against live staging, and they are the only coverage of the code that fetches from Blocktank and stores the result. The 10 tests that call live staging are now #[ignore], so cargo test stays off the network; run them with --ignored. The regtest mine and deposit tests return early when BLOCKTANK_REGTEST_AUTH is unset. A new offline test checks that refreshing active orders and CJIT entries on an empty database returns empty lists. Verified: cargo build --locked, cargo clippy --locked --all-targets, cargo test --locked; cargo test --lib modules::blocktank with BLOCKTANK_REGTEST_AUTH unset
@coreyphillips Fixed: the description now gives the dependency on live staging as the reason, and names the auth key only for the regtest pair. |
coreyphillips
left a comment
There was a problem hiding this comment.
Rechecked after 1 new commit (a37e2ba). Nothing blocking remains.
addressed
- Removes staging tests that still pass; only the regtest routes need auth (src/modules/blocktank/tests.rs:105). Fixed: The 10 tests are back, byte-identical to master apart from
#[ignore = "calls live Blocktank staging"](e.g. tests.rs:114, 538, 565, 976, 1898), which I checked withgit diff origin/master...HEAD. Runningcargo test --locked --lib modules::blocktankwith the key unset gave 43 passed and 10 ignored, and the description now gives the live-staging dependency as the reason. - Regtest tests could skip without the key instead of being deleted (src/modules/blocktank/tests.rs:1225). Fixed:
test_regtest_mineandtest_regtest_depositnow return early whenBLOCKTANK_REGTEST_AUTHis unset (tests.rs:2012 and 2026) and pass the key through otherwise. With it unset both reported ok and made no call. I could not run the keyed path myself. - Removing the staging tests also drops empty-refresh coverage (src/modules/blocktank/tests.rs:749). Fixed:
test_refresh_active_with_empty_db(tests.rs:962-973) asserts that both refreshes return empty against an empty in-memory DB withhttp://invalid-url. It passed in my run, and api.rs:90 and api.rs:195 return before any network call. - The PR description overstates which tests failed for lack of auth. Fixed: The description now says the tests depend on live staging's state. It ties the auth key only to the regtest mine and deposit pair. The linked review is cited only for the tests being skipped, which matches what the earlier objection said that review contains.
new since the last review
worth doing, does not block
- Regtest tests run and fail when BLOCKTANK_REGTEST_AUTH is set but empty (src/modules/blocktank/tests.rs:2012-2014)
|
Merging: CI is green and the approval covers a37e2ba. Test-only change, so no release is needed. |
Refs: #190
The Blocktank tests call the live staging server, so a plain
cargo testdepended on staging's state and created orders and CJIT entries there. The regtest mine and deposit tests also need staging's regtest auth key, which only the bitkit-android and bitkit-ios CI have. They had to be skipped in this review.Description
#[ignore], socargo teststays off the network;cargo test -- --ignoredstill runs themBLOCKTANK_REGTEST_AUTHis unset, so anyone with the key still checks that staging accepts the basic-auth headerPreview
N/A — test-only change.
QA Notes
Automated Checks
cargo build --locked,cargo clippy --locked --all-targetsandcargo test --locked: all passcargo test --lib modules::blocktankwithBLOCKTANK_REGTEST_AUTHunset: 43 pass, 10 ignored, no Blocktank callstest_regtest_mineandtest_regtest_depositpass against stagingModels used
Claude Opus 5.5(reasoning:medium)Claude Opus 5.5(reasoning:medium)