Skip to content

iOS settings migration tests #399

iOS settings migration tests

iOS settings migration tests #399

name: iOS Settings Migration Tests
concurrency:
group: ios-end-to-end-tests
cancel-in-progress: false
permissions:
contents: read
issues: write
pull-requests: write
on:
workflow_dispatch:
schedule:
# At midnight every day.
# Notifications for scheduled workflows are sent to the user who last modified the cron
# syntax in the workflow file. If you update this, ensure notifications for
# GitHub Actions are enabled.
# https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/notifications-for-workflow-runs
- cron: '0 0 * * *'
# Global environment variables for easy updates
env:
TEST_DEVICE_UDID: 00008130-0019181022F3803A
OLD_APP_COMMIT_HASH: "4319bfbe700d3e0f7ecfcd9d004a63f6f12c40ac"
jobs:
set_commit_hash:
name: Set Commit Hash Environment Variable
runs-on:
- self-hosted
- macOS
- ios-test
outputs:
old_app_commit_hash: ${{ steps.set-hash.outputs.old_app_commit_hash }}
steps:
- name: Set OLD_APP_COMMIT_HASH
id: set-hash
run: echo "::set-output name=old_app_commit_hash::${{ env.OLD_APP_COMMIT_HASH }}"
uninstall_app:
name: Uninstall Old App
runs-on:
- self-hosted
- macOS
- ios-test
needs: set_commit_hash
env:
TEST_DEVICE_UDID: 00008130-0019181022F3803A
steps:
- name: Install ios-deploy
run: brew install ios-deploy
- name: Verify Device Connection
run: ios-deploy --detect
- name: Uninstall Old App from Device
timeout-minutes: 10
run: ios-deploy --id ${{ env.TEST_DEVICE_UDID }} --uninstall_only --bundle_id net.mullvad.MullvadVPN
- name: Verify Uninstallation
run: |
if ios-deploy --id ${{ env.TEST_DEVICE_UDID }} --list | grep net.mullvad.MullvadVPN; then
echo "Uninstallation failed."
exit 1
else
echo "App successfully uninstalled."
fi
change_dns_settings:
name: Change DNS Settings on Old App Version
uses: ./.github/workflows/ios-end-to-end-tests.yml
needs:
- set_commit_hash
- uninstall_app
with:
arg_tests_json_key: "mullvadVPNUITestsChangeDNSSettings"
commit_hash: ${{ needs.set_commit_hash.outputs.old_app_commit_hash }}
secrets: inherit
verify_dns_settings:
name: Verify DNS Settings on Current App Version
needs:
- change_dns_settings
uses: ./.github/workflows/ios-end-to-end-tests.yml
with:
arg_tests_json_key: "mullvadVPNUITestsVerifyDNSSettingsChanged"
secrets: inherit
change_other_settings:
name: Change All Other Settings on Old App Version
needs:
- set_commit_hash
- verify_dns_settings
uses: ./.github/workflows/ios-end-to-end-tests.yml
with:
arg_tests_json_key: "mullvadVPNUITestsChangeSettings"
commit_hash: ${{ needs.set_commit_hash.outputs.old_app_commit_hash }}
secrets: inherit
verify_other_settings:
name: Verify All Other Settings on Current App Version
needs:
- change_other_settings
uses: ./.github/workflows/ios-end-to-end-tests.yml
with:
arg_tests_json_key: "mullvadVPNUITestsVerifySettingsChanged"
secrets: inherit