Skip to content

test(router/lnurl): cover localhost branch of lnurlp_handler - #172

Merged
TaprootFreak merged 1 commit into
stagingfrom
fix/lnurlp-localhost-coverage
Jun 2, 2026
Merged

test(router/lnurl): cover localhost branch of lnurlp_handler#172
TaprootFreak merged 1 commit into
stagingfrom
fix/lnurlp-localhost-coverage

Conversation

@TaprootFreak

Copy link
Copy Markdown
Contributor

Problem

The Coverage Gate on PR #169 (Promote staging→develop) failed at 3265/3266 lines = 99.97 % with one uncovered line:

node/src/router.rs: 2647

Source:

let scheme = if host.contains("localhost") {
    "http"        // ← line 2647, uncovered
} else {
    "https"
};

The https:// arm is already pinned by lnurlp_known_address_returns_pay_request (which sends Host: api.zkcoins.app). The http:// arm was not exercised — the workflow's --all-features flag in the consolidated CI (PR #167) brought the lnurl feature 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):

  • Issues the same /.well-known/lnurlp/<prefix> request the existing happy-path test does.
  • Sets Host: localhost:8080.
  • Asserts the returned LNURL callback URL starts with http://localhost:8080/.

No production-code change, no schema change, no API-shape change.

Verification

Local (CI-equivalent invocations):

  • cargo fmt --all -- --check → clean
  • cargo clippy -p node -p shared -- -D warnings → clean
  • cargo clippy -p node --all-features -- -D warnings → clean
  • cargo check -p node --all-features → clean

Tests 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..5 runner pool (set up earlier today on dfxai, OrbStack, dedicated to zk-coins/node CI — see DFXServer/server commit 4347a4a). The dfxai pool ran 399/399 tests green in 48.5 min with 0 PoolTimedOut flakes — 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).

…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
TaprootFreak marked this pull request as ready for review June 1, 2026 23:49
@TaprootFreak TaprootFreak added the ci:full Trigger heavy CI jobs (Server + Shared Tests + Coverage Gate, ~60-90 min on M3 Ultra) label Jun 1, 2026
@TaprootFreak
TaprootFreak merged commit 9bf6e8d into staging Jun 2, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Trigger heavy CI jobs (Server + Shared Tests + Coverage Gate, ~60-90 min on M3 Ultra)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant