test: allow the e2e backend host to be set at launch - #680
Conversation
8ecc725 to
03aaf1f
Compare
Greptile SummaryThis PR allows E2E builds to override the local backend host at app launch while retaining the existing Info.plist lookup and localhost fallback.
Confidence Score: 5/5The PR appears safe to merge, with the host override following the existing configuration precedence and preserving the prior fallback. The changed E2E-only lookup adds the intended runtime configuration sources while retaining Info.plist and localhost behavior when no override is supplied.
|
| Filename | Overview |
|---|---|
| Bitkit/Constants/Env.swift | The E2E local host now supports runtime overrides through the existing configuration resolver; no actionable defect was identified. |
Reviews (1): Last reviewed commit: "test: allow the e2e backend host to be s..." | Re-trigger Greptile
piotr-iohk
left a comment
There was a problem hiding this comment.
Looks good. configValue is the right helper - unset still falls through to Info.plist / 127.0.0.1, so existing e2e builds behave as now. Needed so a later run can pass the stack host at launch without rebuilding.
|
@mdozhdev the repository requires signed commits. May you please sign your commits. 🙏 |
e2eLocalHost read only from Info.plist, which is written when the app is compiled. A run against a stack on another machine does not know the address until it has provisioned one, after the build. Rebuilding per run is not viable on macOS. configValue is the existing helper directly above, resolving env var, then launch argument, then Info.plist. Falling through to the same lookup means builds that set nothing are unaffected; it only adds a way to override at launch, which is how the test runner supplies the address. Reachable only from isE2E, which requires the E2E_BUILD compilation flag that no project file sets and only e2e build commands pass, so a release build never compiles that branch. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
03aaf1f to
2a99dd7
Compare
Description
e2e-tests-localneeds Docker and the iOS Simulator on the same machine, which GitHub-hosted macOS runners cannot provide — Apple's Virtualization framework has no nested virtualization for macOS guests. That is why the job runs on a self-hosted Mac, and why it runs as a single shard at ~2h per run.This adds a parallel workflow that keeps the Simulator on a hosted runner and puts the regtest stack on a short-lived GCP VM.
e2e-tests.ymlis untouched. The self-hosted path keeps working exactly as now. The new workflow isworkflow_dispatchonly, so both can run against the same PRs until this one is trusted, and rollback is deleting one file.Env.swift(1 line)e2eLocalHostread only fromInfo.plist, which is written when the app is compiled. A run against a remote stack does not know the address until it has provisioned one — after the build. Rebuilding per run is not viable on macOS.configValueis the existing helper directly above it, resolving env var → launch argument → Info.plist. Because it falls through to the same lookup, builds that set nothing behave identically; it only adds a way to override at launch.It is reachable only from
isE2E, which requires theE2E_BUILDcompilation flag. That flag appears in no project file, no scheme and no default — only in e2e build commands. A release build never compiles that branch.Status
Draft — the workflow has not been run end to end yet. It depends on synonymdev/bitkit-e2e-tests#204 being merged (it references those actions at
@main) and on a configured GCP project.Verified so far, on a GitHub-hosted macOS runner: VM provisioned, stack reached, credentials fetched, and a request from inside a booted Simulator recorded in the VM's own access log. What remains unproven is a real suite run.
Configuration needed
Produced by
ci/regtest-vm/setup-wif.shin bitkit-e2e-tests. Without them the new workflow simply cannot be dispatched; nothing else is affected.Linked Issues/Tasks
Screenshot / Video
n/a — CI only.