test(router/lnurl): cover localhost branch of lnurlp_handler - #172
Merged
Conversation
…election lnurlp_handler picks http:// for hosts containing 'localhost' and https:// otherwise. The https arm is already pinned by lnurlp_known_address_returns_pay_request; the http arm (router.rs:2647) was uncovered, which broke the 100%-line coverage gate at 3265/3266 lines = 99.97%. New test lnurlp_localhost_host_returns_http_callback issues the same .well-known/lnurlp/<prefix> request the existing test does, but with Host: localhost:8080, and asserts the callback URL starts with http://localhost:8080/. Closes the 1-line gap without changing production code. Surfaced as part of the dfxai runner pool smoke test on PR #169 — see DFXServer/server commit 4347a4a for the new dfxai CI host.
TaprootFreak
marked this pull request as ready for review
June 1, 2026 23:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Coverage Gate on PR #169 (Promote staging→develop) failed at 3265/3266 lines = 99.97 % with one uncovered line:
Source:
The
https://arm is already pinned bylnurlp_known_address_returns_pay_request(which sendsHost: api.zkcoins.app). Thehttp://arm was not exercised — the workflow's--all-featuresflag in the consolidated CI (PR #167) brought thelnurlfeature into the gate's scope and surfaced the gap.Fix
New test
lnurlp_localhost_host_returns_http_callback(node/src/router_tests.rs, alongside the existing lnurlp tests):/.well-known/lnurlp/<prefix>request the existing happy-path test does.Host: localhost:8080.callbackURL starts withhttp://localhost:8080/.No production-code change, no schema change, no API-shape change.
Verification
Local (CI-equivalent invocations):
cargo fmt --all -- --check→ cleancargo clippy -p node -p shared -- -D warnings→ cleancargo clippy -p node --all-features -- -D warnings→ cleancargo check -p node --all-features→ cleanTests not run locally per
feedback_zkcoins_node_ci_tests.md— CI will run the full suite.Context: why this surfaced now
PR #169's CI ran on the new
dfxai-1..5runner pool (set up earlier today on dfxai, OrbStack, dedicated tozk-coins/nodeCI — seeDFXServer/servercommit 4347a4a). The dfxai pool ran 399/399 tests green in 48.5 min with 0PoolTimedOutflakes — the dfx01 pool's recurring DB-test flake is gone in the new environment. The only remaining gate failure was this 1-line coverage gap, which is repo-scope and not infra-related.Unblocks
PR #169 (Promote staging→develop), which in turn unblocks PR #166 (Release develop→main).