Skip to content

test: let the suite address a regtest stack that is not on localhost - #206

Open
mdozhdev wants to merge 1 commit into
synonymdev:mainfrom
mdozhdev:test/configurable-backend-host
Open

test: let the suite address a regtest stack that is not on localhost#206
mdozhdev wants to merge 1 commit into
synonymdev:mainfrom
mdozhdev:test/configurable-backend-host

Conversation

@mdozhdev

Copy link
Copy Markdown

Why

The suite assumes the regtest stack runs on the machine the tests run on — LND at localhost, its cert and macaroon read from the working copy, and connectToLND typing 0.0.0.0 into the app.

That holds only while Docker and the iOS Simulator share a host. GitHub-hosted macOS runners cannot run Docker (Apple's Virtualization framework has no nested virtualization for macOS guests, closed not planned), which is why the iOS suite runs on a self-hosted Mac at ~2h per run against ~20m for the same tests on Android's hosted Linux runners.

What

Makes the address configurable. Every current default is preserved, so existing runs are unaffected.

File Change
docker-compose.yml LND advertises LND_EXTERNAL_IP, else 127.0.0.1
constants.ts lndConfig host, ports and credential paths from env
lnd.ts connectToLND uses the configured host
wdio.conf.ts forwards E2E_LOCAL_HOST into the app's launch environment

Credential paths are separate from the host because they are files — they have to be fetched from wherever the stack runs before the suite can read them.

wdio.conf.ts is the link that is easy to miss: setting E2E_LOCAL_HOST in a workflow only sets it on the runner's shell. Appium launches the app as a separate process, so it needs processArguments.env to reach Env.swift.

Scope

This is the groundwork both candidate approaches need, split out so it can be agreed independently of which one is chosen:

Both depend on this. On its own it changes no behaviour — nothing sets these variables yet.

The matching app-side change is synonymdev/bitkit-ios#680, which lets Env.swift read E2E_LOCAL_HOST at launch rather than only from Info.plist at build time.

Verified

tsc --noEmit and eslint clean. docker compose config renders 127.0.0.1 with nothing set and the supplied address when LND_EXTERNAL_IP is present; confirmed against a running LND that it advertises the injected value.

Related

  • synonymdev/pubky-stack#275

The suite assumes the stack runs on the machine the tests run on: LND is
reached at localhost, its cert and macaroon are read from the working
copy, and connectToLND types 0.0.0.0 into the app. That holds only while
Docker and the iOS Simulator share a host, which GitHub-hosted macOS
runners cannot do.

Make the address configurable, keeping every current default so existing
runs are unaffected:

  docker-compose.yml  LND advertises LND_EXTERNAL_IP, else 127.0.0.1
  constants.ts        lndConfig host, ports and credential paths from env
  lnd.ts              connectToLND uses the configured host
  wdio.conf.ts        forwards E2E_LOCAL_HOST into the app's launch
                      environment, which is how a build made before the
                      stack existed learns its address

The credential paths are separate from the host because they are files,
so they have to be fetched from wherever the stack runs before the suite
can use them.

Required by either way of running the stack off the Mac, so it is
independent of that choice.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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