Skip to content

Add upgrade test#1788

Open
DRadmir wants to merge 11 commits intomainfrom
1629-add-integration-test-for-ios-app-upgrade-flow-from-1-version-to-another
Open

Add upgrade test#1788
DRadmir wants to merge 11 commits intomainfrom
1629-add-integration-test-for-ios-app-upgrade-flow-from-1-version-to-another

Conversation

@DRadmir
Copy link
Contributor

@DRadmir DRadmir commented Mar 13, 2026

Local upgrade test via just test-upgrade <commit>:

  1. Builds old version in a git worktree
  2. Installs on simulator and creates a wallet
  3. Builds current version
  4. Verifies wallet survived the upgrade

Usage

just test-upgrade 1.3.335

Close: #1629

Add a GitHub Actions workflow (upgrade_tests.yml) to run upgrade verification on a self-hosted macOS runner: it creates a simulator, installs/builds an old tagged release to create a wallet, then checks out the current SHA and verifies the wallet survives the upgrade. Add a new UITest (UpgradeVerificationTests.swift) that asserts onboarding is skipped and the Bitcoin receive flow still shows the expected address. Update Gem.xcodeproj to include the new test file and extend the justfile to add test-upgrade-setup and test-upgrade-verify targets and allow running _test-ui for a specific test target.
@DRadmir DRadmir self-assigned this Mar 13, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes a robust automated upgrade verification process for the iOS application. By integrating a new GitHub Actions workflow, a dedicated UI test, and justfile modifications, the changes ensure that existing user wallet data and core functionalities remain intact and accessible after application upgrades, significantly improving the reliability of future releases.

Highlights

  • Upgrade Tests Workflow: A new GitHub Actions workflow (upgrade_tests.yml) has been added to automate upgrade verification on a self-hosted macOS runner. This workflow creates a simulator, installs an old release to create a wallet, then checks out the current SHA and verifies the wallet survives the upgrade.
  • New UI Test: A new UITest file, UpgradeVerificationTests.swift, was introduced. This test asserts that onboarding is skipped and the Bitcoin receive flow correctly displays the expected address after an upgrade.
  • Project Configuration Update: The Gem.xcodeproj file was updated to include the newly added UpgradeVerificationTests.swift in the project structure.
  • justfile Enhancements: The justfile was extended to include test-upgrade-setup and test-upgrade-verify targets, facilitating the upgrade test process. Additionally, the _test-ui command now allows running specific UI test targets.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Gem.xcodeproj/project.pbxproj
    • Added UpgradeVerificationTests.swift to the Xcode project configuration, including it as a build file, file reference, and within the GemUITestsAppTests group.
  • GemUITestsAppTests/UpgradeVerificationTests.swift
    • Added a new UI test file (UpgradeVerificationTests.swift) containing testWalletSurvivedUpgrade to verify wallet data persistence and functionality after an application upgrade.
  • justfile
    • Updated the _test-ui command to accept an optional target parameter, enabling the execution of specific UI tests.
    • Introduced a new test-upgrade-setup target to run ImportWalletReceiveBitcoinUITests without building.
    • Added a new test-upgrade-verify target to run UpgradeVerificationTests without building and without resetting the simulator.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/upgrade_tests.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an upgrade test workflow and a new UI test to verify wallet data persistence across upgrades. The changes to the justfile to support running these tests are a good addition.

I have a couple of suggestions:

  • In UpgradeVerificationTests.swift, I recommend replacing hardcoded strings for UI identifiers with constants to improve maintainability.
  • In the justfile, the test-upgrade-setup recipe should probably ensure the simulator is reset to provide a clean state for the first phase of the upgrade test.

Overall, this is a valuable addition for ensuring application stability during upgrades.

DRadmir added 7 commits March 13, 2026 13:57
Add a pull_request trigger scoped to the main branch to exercise the upgrade_tests workflow on this branch. A TODO notes that the pull_request trigger should be removed before merging; workflow_dispatch inputs are unchanged.
Update the upgrade_tests GitHub Actions workflow to use explicit xcodebuild commands for resolving packages, building UI tests, and running a targeted test, replacing several just tasks. Bump the default old_version input (and related env/job name) from 1.3.327 to 1.3.335 and clarify the input description (must be >= 1.3.328). Reorganize and rename steps to separate Phase 1 (build/run old version to create wallet) and Phase 2 (build/run current version to verify), and pipe xcodebuild output through xcbeautify for cleaner CI logs.
Improve stability of UpgradeVerificationTests by waiting for UI elements before interacting with them. Store buttons in local variables and assert their existence with timeouts (10s for asset and action buttons, 5s for the address) to reduce flakiness when tapping elements after an app upgrade.
Refines tests to improve clarity and stability. In UpgradeVerificationTests the Bitcoin asset assertion message was updated to mention 'after upgrade' and a subsequent bitcoin address existence assertion was removed (to avoid a brittle check). In WalletServiceTests the WalletService.mock is now created with an injected walletStore backed by a mocked DB pre-populated with the Ethereum chain so the test has the expected initial state for deleteLastWalletNotifiesObservers.
Replace the old Receive->SelectAsset->Copy flow with a Wallet-detail based verification. The test now navigates to the Wallets screen, opens wallet settings (gearshape), taps Show Secret Phrase, proceeds through the security reminder, and verifies the displayed secret phrase words against UITestKitConstants. This adapts the test to the updated UI and ensures the wallet keys were not corrupted after upgrade.
…integration-test-for-ios-app-upgrade-flow-from-1-version-to-another

# Conflicts:
#	Gem.xcodeproj/project.pbxproj
Remove GitHub Actions workflow and consolidate upgrade test into a single
`just test-upgrade <commit>` command that uses git worktree for isolation.
@DRadmir DRadmir force-pushed the 1629-add-integration-test-for-ios-app-upgrade-flow-from-1-version-to-another branch from 0c5f468 to ec134c6 Compare March 17, 2026 06:45
@DRadmir DRadmir changed the title Add upgrade tests workflow and UI test Add upgrade test Mar 17, 2026
…integration-test-for-ios-app-upgrade-flow-from-1-version-to-another
@DRadmir DRadmir marked this pull request as ready for review March 17, 2026 07:11
-allowProvisioningUpdates \
-allowProvisioningDeviceRegistration \
-parallelizeTargets \
-jobs "$BUILD_THREADS" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
-jobs "$BUILD_THREADS" \

why you need this? it should be default

ONLY_ACTIVE_ARCH=YES \
-destination "$SIMULATOR_DEST" \
-derivedDataPath "$DERIVED_DATA" \
-clonedSourcePackagesDirPath "$SPM_CACHE" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
-clonedSourcePackagesDirPath "$SPM_CACHE" \

don't use cache for this testing

DRadmir added 2 commits March 18, 2026 00:26
Update build-system/scripts/upgrade-test.sh to remove explicit SPM cache and parallel build settings. Deleted OLD_SPM_CACHE and SPM_CACHE variables and removed BUILD_THREADS. Also removed -clonedSourcePackagesDirPath, -parallelizeTargets and -jobs from xcodebuild invocations, simplifying the script's build/test commands.
…integration-test-for-ios-app-upgrade-flow-from-1-version-to-another
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.

Add integration test for iOS app upgrade flow from 1 version to another

2 participants