Skip to content

ci: cashu test-mint harness — Cashu foundation CF-3#799

Open
grunch wants to merge 1 commit into
mainfrom
feat/cashu-cf3-harness
Open

ci: cashu test-mint harness — Cashu foundation CF-3#799
grunch wants to merge 1 commit into
mainfrom
feat/cashu-cf3-harness

Conversation

@grunch

@grunch grunch commented Jul 2, 2026

Copy link
Copy Markdown
Member

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_KEY is 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 on main (safety net) + opt-in per-PR via the cashu label + workflow_dispatch, mirroring the mutation-testing trigger pattern. It also runs cargo test cashu -- --ignored, so mint-backed #[ignore] tests that later PRs add inside src (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 prerequisites CashuClient::connect enforces, so a mint-image bump that drops one fails loudly here). Skips cleanly when the env var is unset — default cargo test stays offline.

Note

The spec also lists wallet-level helpers (fund a wallet, build a 2-of-3 token) in tests/common/. Those need the cdk dependency, 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

  • Without CASHU_TEST_MINT_URL: test compiles and skips cleanly (offline default preserved)
  • Against the real dockerized mint locally: docker compose -f docker-compose.cashu.yml up -dCASHU_TEST_MINT_URL=http://127.0.0.1:3338 cargo test --test cashu_mint1 passed (mint up, NUT-07/11/12 supported) → down -v
  • cargo fmt --all / cargo clippy --all-targets --all-features -- -D warnings
  • ci.yml untouched — no default required job changed

Wave-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).

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).
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0faa97c7-c70d-4fdd-bcab-3486a4298740

📥 Commits

Reviewing files that changed from the base of the PR and between 53e0086 and b94904c.

📒 Files selected for processing (4)
  • .github/workflows/cashu.yml
  • docker-compose.cashu.yml
  • tests/cashu_mint.rs
  • tests/common/mod.rs
👮 Files not reviewed due to content moderation or server errors (4)
  • tests/common/mod.rs
  • .github/workflows/cashu.yml
  • docker-compose.cashu.yml
  • tests/cashu_mint.rs

Warning

Walkthrough skipped

File diffs could not be summarized.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cashu-cf3-harness

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@grunch

grunch commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread tests/common/mod.rs
let info_url = format!("{mint_url}/v1/info");
let deadline = Instant::now() + timeout;
loop {
match client.get(&info_url).send().await {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant