Skip to content

ci: add hardware wallet e2e shard#1045

Merged
ovitrif merged 1 commit into
masterfrom
test/trezor-foundations
Jun 25, 2026
Merged

ci: add hardware wallet e2e shard#1045
ovitrif merged 1 commit into
masterfrom
test/trezor-foundations

Conversation

@piotr-iohk

Copy link
Copy Markdown
Collaborator

Refs #1038
Companion PR: synonymdev/bitkit-e2e-tests#184

This PR adds the Android CI wiring for hardware-wallet emulator E2E coverage.

Description

  • Enables Trezor Bridge support in the existing staging/regtest E2E APK build so the hardware-wallet tests can talk to the emulator Bridge.
  • Adds a dedicated hardware_wallet staging shard that runs the @hardware_wallet E2E tests from the companion E2E test branch.
  • Pulls the pinned Trezor User Env image before the shard runs so test setup does not spend its first attempt downloading the large emulator image.

Preview

N/A - CI workflow change only.

QA Notes

Manual Tests

N/A

Automated Checks

  • E2E coverage added in hardware-wallet.e2e.ts by companion PR Test/trezor foundations e2e tests bitkit-e2e-tests#184: connects the Trezor emulator, verifies settings/home visibility and removal, receives on-chain hardware funds, and transfers hardware funds to Spending.
  • Workflow behavior validation after merge: the hardware_wallet staging shard should build the regtest APK with TREZOR_BRIDGE=true, pull the Trezor User Env image, and run @hardware_wallet with BACKEND=regtest.

@piotr-iohk piotr-iohk self-assigned this Jun 25, 2026
@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown

Greptile Summary

This PR wires up Android CI support for hardware-wallet E2E tests by adding a hardware_wallet shard to the staging matrix, baking TREZOR_BRIDGE=true and the bridge URL into the shared staging APK build, and pre-pulling the Trezor User Env Docker image before the shard runs.

  • The hardware_wallet shard is added to e2e-tests-staging, using the existing regtest APK artifact (now built with TREZOR_BRIDGE=true) and running tests tagged @hardware_wallet with BACKEND=regtest.
  • A pre-pull step fetches the Trezor emulator image (docker compose --profile trezor pull trezor-user-env) before the first test attempt to avoid download time causing a spurious retry.
  • TREZOR_BRIDGE=true is added to the single shared staging build, meaning all three staging shards (multi_address_2_regtest, pubky_paykit, hardware_wallet) will use a Trezor-Bridge-enabled APK; actual container startup for the emulator is delegated to the companion test runner script rather than being explicit in the workflow.

Confidence Score: 4/5

The workflow change is additive and isolated to CI; production builds are unaffected. The main risk is that Trezor Bridge initialization in the shared APK could subtly affect the two pre-existing staging shards, and the Trezor container startup is not explicit in this workflow but instead relies on the companion test-runner script.

The CI change is straightforward: a new matrix shard, a pre-pull step, and two new build env vars. The gap between pulling the Trezor image and actually starting its container (delegated to the companion repo) is worth verifying before this runs in production CI, but is unlikely to cause a hard breakage since failed test attempts are retried and a third failure surfaces correctly. The TREZOR_BRIDGE flag applying to all staging shards deserves a second look to confirm it has no side effects on unrelated tests.

.github/workflows/e2e.yml — specifically the build-staging env block (lines 129–130) and the Pull Trezor emulator image step (lines 396–401).

Important Files Changed

Filename Overview
.github/workflows/e2e.yml Adds hardware_wallet shard to staging matrix, bakes TREZOR_BRIDGE=true into the shared staging APK build, and pre-pulls the Trezor emulator Docker image before that shard runs. No explicit docker compose up for the Trezor container is added to the workflow — this is delegated to the test runner script in the companion repo.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[detect-changes] --> B[build-local]
    A --> C[build-staging\nTREZOR_BRIDGE=true\nTREZOR_BRIDGE_URL set]
    A --> D[e2e-branch]
    B --> E[e2e-tests-local\nshards: 7]
    C --> F[e2e-tests-staging\nshards: 3]
    D --> E
    D --> F
    F --> G[multi_address_2_regtest]
    F --> H[pubky_paykit]
    F --> I[hardware_wallet NEW]
    I --> J{avd-cache hit?}
    J -- miss --> K[Create AVD snapshot]
    J -- hit --> L[Download APK regtest]
    K --> L
    L --> M[npm ci]
    M --> N[Pull Trezor emulator image\ndocker compose --profile trezor pull]
    N --> O[Run E2E Tests 1\nBACKEND=regtest\ngrep @hardware_wallet]
    O -- success --> P[Done]
    O -- fail --> Q[Run E2E Tests 2\nBACKEND=regtest]
    Q -- success --> P
    Q -- fail --> R[Run E2E Tests 3\nBACKEND=regtest]
    R --> S[Upload artifacts on failure]
    E --> T[e2e-status]
    F --> T
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[detect-changes] --> B[build-local]
    A --> C[build-staging\nTREZOR_BRIDGE=true\nTREZOR_BRIDGE_URL set]
    A --> D[e2e-branch]
    B --> E[e2e-tests-local\nshards: 7]
    C --> F[e2e-tests-staging\nshards: 3]
    D --> E
    D --> F
    F --> G[multi_address_2_regtest]
    F --> H[pubky_paykit]
    F --> I[hardware_wallet NEW]
    I --> J{avd-cache hit?}
    J -- miss --> K[Create AVD snapshot]
    J -- hit --> L[Download APK regtest]
    K --> L
    L --> M[npm ci]
    M --> N[Pull Trezor emulator image\ndocker compose --profile trezor pull]
    N --> O[Run E2E Tests 1\nBACKEND=regtest\ngrep @hardware_wallet]
    O -- success --> P[Done]
    O -- fail --> Q[Run E2E Tests 2\nBACKEND=regtest]
    Q -- success --> P
    Q -- fail --> R[Run E2E Tests 3\nBACKEND=regtest]
    R --> S[Upload artifacts on failure]
    E --> T[e2e-status]
    F --> T
Loading

Reviews (1): Last reviewed commit: "ci: add hardware wallet e2e shard" | Re-trigger Greptile

Comment thread .github/workflows/e2e.yml
Comment thread .github/workflows/e2e.yml

@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: 5fd7b1c264

ℹ️ 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 .github/workflows/e2e.yml
@ovitrif ovitrif added this to the 2.4.0 milestone Jun 25, 2026
@piotr-iohk piotr-iohk requested review from jvsena42 and ovitrif June 25, 2026 13:32

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

LGTM

@ovitrif ovitrif merged commit f1769a8 into master Jun 25, 2026
47 of 49 checks passed
@ovitrif ovitrif deleted the test/trezor-foundations branch June 25, 2026 21:29
@ovitrif

ovitrif commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

migt've merged too early :|, sorry for that

@piotr-iohk

Copy link
Copy Markdown
Collaborator Author

migt've merged too early :|, sorry for that

I think it should be fine 👍

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.

2 participants