ci: cashu test-mint harness — Cashu foundation CF-3#799
Conversation
Cashu foundation CF-3 (docs/cashu/01-fundamentals.md, section 6): - docker-compose.cashu.yml: throwaway nutshell 0.20.1 mint on the FakeWallet backend (no LN node, auto-settled mints). MINT_PRIVATE_KEY is a documented non-sensitive fixture for deterministic keysets. - .github/workflows/cashu.yml: dedicated workflow, never a default required check — nightly cron on main + opt-in per-PR via the 'cashu' label + workflow_dispatch, mirroring the mutation-testing pattern. It also runs 'cargo test cashu -- --ignored' so in-tree mint-backed tests added by later PRs are picked up automatically. - tests/cashu_mint.rs + tests/common/mod.rs: env-gated integration skeleton (CASHU_TEST_MINT_URL). Smoke test asserts the mint is reachable and supports NUT-07/11/12 (the same prerequisites CashuClient::connect enforces). Skips cleanly when the env var is unset, so default CI stays offline. Wallet-level helpers (fund a wallet, build a 2-of-3 token) land once cdk is on main (CF-2). Pure test/infra; no daemon code. Validated locally: skip-path without the env var, and a real run against the dockerized mint (1 passed).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
👮 Files not reviewed due to content moderation or server errors (4)
Warning Walkthrough skippedFile diffs could not be summarized. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b94904c48d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let info_url = format!("{mint_url}/v1/info"); | ||
| let deadline = Instant::now() + timeout; | ||
| loop { | ||
| match client.get(&info_url).send().await { |
There was a problem hiding this comment.
Bound each mint probe before awaiting it
If the mint container opens port 3338 but stalls before completing /v1/info (for example during a bad image startup or blocked handler), this send().await can wait indefinitely because the client has no per-request timeout, so the helper's 90s deadline is never checked and the Cashu workflow hangs until the job-level timeout instead of failing fast.
Useful? React with 👍 / 👎.
Summary
CF-3 of the Cashu foundation (
docs/cashu/01-fundamentals.md§6): a real Cashu mint for CI and local runs, so CF-2 (#798) and the feature tracks have something to test against. Pure test/infra — no daemon code.docker-compose.cashu.yml— throwaway nutshell 0.20.1 mint on the FakeWallet backend (no Lightning node; mint requests auto-settle).MINT_PRIVATE_KEY=TEST_PRIVATE_KEYis the documented non-sensitive fixture the spec calls for (deterministic keysets across runs; guards nothing)..github/workflows/cashu.yml— dedicated workflow, never a default required check: nightly cron onmain(safety net) + opt-in per-PR via thecashulabel +workflow_dispatch, mirroring the mutation-testing trigger pattern. It also runscargo test cashu -- --ignored, so mint-backed#[ignore]tests that later PRs add insidesrc(e.g.CashuClient::connect/check_state/DLEQ) are picked up with zero workflow changes.tests/cashu_mint.rs+tests/common/mod.rs— env-gated integration skeleton (CASHU_TEST_MINT_URL): spin-up wait helper + a smoke test asserting the mint is reachable and supports NUT-07/11/12 (the same prerequisitesCashuClient::connectenforces, so a mint-image bump that drops one fails loudly here). Skips cleanly when the env var is unset — defaultcargo teststays offline.Note
The spec also lists wallet-level helpers (fund a wallet, build a 2-of-3 token) in
tests/common/. Those need thecdkdependency, which lands with CF-2 (#798) — they'll follow once it merges (documented in the module header). Everything else in the CF-3 spec ships here.Test plan
CASHU_TEST_MINT_URL: test compiles and skips cleanly (offline default preserved)docker compose -f docker-compose.cashu.yml up -d→CASHU_TEST_MINT_URL=http://127.0.0.1:3338 cargo test --test cashu_mint→ 1 passed (mint up, NUT-07/11/12 supported) →down -vcargo fmt --all/cargo clippy --all-targets --all-features -- -D warningsci.ymluntouched — no default required job changedWave-1 PR of the CF-0…CF-5 series (CF-0 #795, CF-1 #796, CF-4 #797, CF-2 #798). Remaining: CF-5 (integration — needs CF-0+CF-1+CF-2 merged, ships last).