Skip to content

test: cover Lightning receive on local Spark - #317

Merged
piotr-iohk merged 18 commits into
mainfrom
codex/spark-receive
Nov 23, 2026
Merged

piotr-iohk merged 18 commits into
mainfrom
codex/spark-receive

Conversation

@piotr-iohk

@piotr-iohk piotr-iohk commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • Add one shared Appium case that receives a 10,000-sat Lightning payment from the pinned Spark fixture and verifies the received activity and the Spark spending balance on Android and iOS.
  • Start the Spark profile from the existing Docker pin and build each shared image once. Stop only the Spark services when ending a local test run.
  • Prepare pinned ARM64 fixture images and wallet settings on hosted Linux. Build the configured simulator app on hosted macOS.
  • Reuse exact preloaded images on the shared Mac and start the fixture without registry access.
  • Reuse pinned image archives when available. Build images on a miss or an unreadable archive.
  • Document the local build commands and shared local E2E nightly in both app repos. Keep the bundled fixture for existing consumers.
  • Extend the shared Slack reporter to show local nightly job results on both platforms in the same format as staging and migration. Land this PR before the app workflows so they can load the reporter from E2E main.

Validation

  • Local Android emulator and iOS simulator each passed @spark_1 against a73f84c.
  • The warm fixture probe verified the generated loopback settings and preserved the running Bitcoin, Electrum, and LND services.
  • Android CI passed the single Spark case. Android CI
  • iOS CI passed the single @spark_1 case on macmini1 on the first test attempt after Docker Desktop recovered. The run reused the exact pinned Spark images and the hosted ARM64 simulator build. Passing iOS job · Runner recovery
  • Both nightly workflows passed actionlint and use the regular E2E three-attempt policy. They preserve the dedicated fixture, app build, and Spark test command.
  • A real image archive started the pinned fixture locally. Hit, miss, invalid archive, and save failure checks passed.
  • Android CI passed @spark_1 on the cold and warm runs. Restoring images reduced fixture setup from 24m 19s to 7m 44s. Cold run, Warm run
  • All 32 shared Python unit tests passed. Android and iOS render the same job-level format as staging and migration. Prior runs from the draft branches confirmed that @spark_1 passed and both reports reached Slack. Android run · iOS run

@ovitrif

ovitrif commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

@piotr-iohk thanks for the local Spark setup and @spark_1. If the nightly has room for more, a few Spark flows ship in 3.2 with no E2E case yet and could be candidates there only, keeping the PR runs as they are:

  • sending a Lightning payment from Spark
  • Transfer to Spending and Transfer to Savings
  • the update spending balance move (a payment only channels and Spark together cover)
  • restoring a wallet that holds Spark funds

Your call on which, if any, are worth the CI time.

@piotr-iohk
piotr-iohk marked this pull request as ready for review November 20, 2026 10:58

@talosmachina talosmachina 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.

1 finding (1 P1). Adds the shared @spark_1 Lightning receive case, the Spark fixture commands in local-backend, and the local nightly mode of the Slack reporter. Reviewed 1ae6c76, full tier.

What I checked, and 4 candidates I ruled out

Read in full: scripts/local-backend, scripts/run-spark-e2e.sh, scripts/build-ios-sim.sh, scripts/slack_summary.py, test/specs/spark.e2e.ts, test/helpers/receive-invoice.ts
Traced: every caller of build-ios-sim.sh (README, .agents/commands/archive-release.md, the bitkit-ios nightly in synonymdev/bitkit-ios#1371); the simulator slices of the BitkitCore.xcframework that bitkit-ios pins (0.8.0-rc15)
Build: skipped, the PR-run gate could not read the author's permission on this repo, so nothing here was executed
CI: no checks reported on this branch

Ruled out

  • env -u CI defeats retry skipping: intended, each dedicated run must pay again, and the app workflows retry the whole step.
  • editGateLightningInvoice() with no argument: the optional chaining keeps the old callers' comparison and only drops the check for the new caller, which asserts invoice !== originalInvoice itself.
  • spark_build cache load of a stale archive: the cache key includes BITKIT_DOCKER_REVISION, and a failed docker image inspect falls through to a rebuild.
  • Cold reader: it did not answer within the time limit on the P1, so that finding stands on the trace below without a second opinion.

Merge confidence: 3/5, the P1 on the default iOS build.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the session does not surface the setting to the reviewer)

Comment thread scripts/build-ios-sim.sh Resolved

@talosmachina talosmachina 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.

Re-review of 0bffc49 after 1ae6c76. 1 earlier finding: 1 fixed. 0 new findings. Adds the shared @spark_1 Lightning receive case, the Spark fixture commands in local-backend, and the local nightly mode of the Slack reporter. Full tier.

What I checked

Diff since 1ae6c76: scripts/build-ios-sim.sh only (one commit, 0bffc49).
Earlier P1, default simulator arch: fixed. ARCHS=${IOS_SIMULATOR_ARCH:-arm64} is now always passed, so the README's BACKEND=local ./scripts/build-ios-sim.sh, the Spark section and archive-release.md's BACKEND=regtest TREZOR_BRIDGE=true ./scripts/build-ios-sim.sh build the arm64 slice that the pinned BitkitCore.xcframework ships, and the nightly's explicit IOS_SIMULATOR_ARCH still overrides it. git grep ARCHS at the head finds no second place that sets it.
Build: not run, iOS does not build on this host.
CI: no checks reported on this branch; the author's linked app-repo runs are the only execution evidence.

Merge confidence: 4/5, no findings open, but no CI on this repo exercises the iOS build script and it was not built here.

@piotr-iohk
piotr-iohk requested review from a team and ovitrif and removed request for a team November 20, 2026 11:45

@ovi-reviewer ovi-reviewer 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.

Verdict: ✅ Approve

Findings: None.

QA for 0bffc49:

Check: Shared nightly reporting ✅ Shared Python tests pass, including Android/iOS nightly and existing staging/migration rendering.

Checked with the repository's Python test suite; Slack transport was mocked. Shell syntax and diff whitespace checks also passed.

Check: Default iOS simulator build ✅ The default build compiles and links an arm64 simulator app.

Built with Xcode 27.0 and IOS_SIMULATOR_ARCH unset, using the app revision from the linked iOS run. Verified the binary architecture and that the built app embeds exactly the generated Spark settings.

Check: Pinned Spark wallet settings ✅ Initialization emits the expected loopback settings using preloaded images.

Ran spark-init-env against Docker a73f84c. It completed without starting dependencies; decoded operator, SSP and chain endpoints match the documented loopback ports.

Receive Lightning into Spark on Android ✅ Passed in the linked CI run at b7e445a; the payment flow is unchanged.

Reused the Android run, whose log confirms one passing @spark_1. It verifies the 10,000-sat receive, spending balance, received activity and final Spark balance.

Receive Lightning into Spark on iOS ✅ Passed in the linked CI run at b7e445a; the payment flow is unchanged.

Reused the iOS run, whose log confirms one passing @spark_1. It verifies the same 10,000-sat receive and balance/activity assertions.

No new device run: the changes since the linked runs leave the fixture, runner and receive helper unchanged. The spec only loses status-reporting wrappers around the same actions and assertions; the reporter formatting and default architecture changes are covered above. Cold image building and the complete fixture startup were not repeated.

Full review: b49d1ab…0bffc49, eight changed files. The earlier simulator architecture finding is fixed.


Reviewed by gpt-6.1-sol-high

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

@piotr-iohk
piotr-iohk merged commit bed683b into main Nov 23, 2026
1 check passed
@piotr-iohk
piotr-iohk deleted the codex/spark-receive branch November 23, 2026 08:51
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.

3 participants