-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
206 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,74 @@ | ||
name: 'Build iOS end to end tests action' | ||
description: 'Prepares and builds end to end tests on iOS device' | ||
--- | ||
name: Build iOS end-to-end tests action | ||
description: Prepares and builds end-to-end tests on an iOS device | ||
inputs: | ||
ios_device_pin_code: | ||
description: 'iOS Device Pin Code' | ||
description: iOS Device Pin Code | ||
required: true | ||
test_device_identifier_uuid: | ||
description: 'Test Device Identifier UUID' | ||
description: Test Device Identifier UUID | ||
required: true | ||
has_time_account_number: | ||
description: 'Has Time Account Number' | ||
description: Has Time Account Number | ||
required: true | ||
no_time_account_number: | ||
description: 'No Time Account Number' | ||
description: No Time Account Number | ||
required: true | ||
test_device_udid: | ||
description: 'Test Device UDID' | ||
description: Test Device UDID | ||
required: true | ||
partner_api_token: | ||
description: 'Partner API Token' | ||
description: Partner API Token | ||
required: true | ||
test_name: | ||
description: 'Test case/suite name. Will run all tests in the test plan if not provided.' | ||
description: Test case/suite name. Will run all tests in the test plan if not provided. | ||
required: false | ||
outputs_path: | ||
description: 'Path to store outputs. This should be unique for each job run in order to avoid concurrency issues.' | ||
description: Path to store outputs. This should be unique for each job run in order to avoid concurrency issues. | ||
required: true | ||
base_directory: | ||
description: Base directory for the working paths. Defaults to the current directory ("."). | ||
required: false | ||
default: . | ||
|
||
runs: | ||
using: 'composite' | ||
using: composite | ||
steps: | ||
- name: Configure Xcode project | ||
- name: Set working-directory or default | ||
id: set-working-directory | ||
run: | | ||
for file in *.xcconfig.template ; do cp $file ${file//.template/} ; done | ||
sed -i "" "/^HAS_TIME_ACCOUNT_NUMBER/d" UITests.xcconfig | ||
sed -i "" "/^NO_TIME_ACCOUNT_NUMBER/d" UITests.xcconfig | ||
sed -i "" \ | ||
"/IOS_DEVICE_PIN_CODE =/ s/= .*/= $IOS_DEVICE_PIN_CODE/" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"/TEST_DEVICE_IDENTIFIER_UUID =/ s/= .*/= $TEST_DEVICE_IDENTIFIER_UUID/" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"s#^// PARTNER_API_TOKEN =#PARTNER_API_TOKEN =#" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"/PARTNER_API_TOKEN =/ s#= .*#= $PARTNER_API_TOKEN#" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"/ATTACH_APP_LOGS_ON_FAILURE =/ s#= .*#= 1#" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"/TEST_DEVICE_IS_IPAD =/ s#= .*#= 0#" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"/UNINSTALL_APP_IN_TEST_SUITE_TEAR_DOWN =/ s#= .*#= 0#" \ | ||
UITests.xcconfig | ||
if [ -z "${{ inputs.base_directory }}" ]; then | ||
echo "base_directory=." >> $GITHUB_ENV | ||
else | ||
echo "base_directory=${{ inputs.base_directory }}" >> $GITHUB_ENV | ||
fi | ||
shell: bash | ||
working-directory: ios/Configurations | ||
env: | ||
IOS_DEVICE_PIN_CODE: ${{ inputs.ios_device_pin_code }} | ||
TEST_DEVICE_IDENTIFIER_UUID: ${{ inputs.test_device_identifier_uuid }} | ||
HAS_TIME_ACCOUNT_NUMBER: ${{ inputs.has_time_account_number }} | ||
NO_TIME_ACCOUNT_NUMBER: ${{ inputs.no_time_account_number }} | ||
PARTNER_API_TOKEN: ${{ inputs.partner_api_token }} | ||
|
||
- name: Build app and tests for testing | ||
- name: Configure Xcode project | ||
run: | | ||
if [ -n "$TEST_NAME" ]; then | ||
TEST_NAME_ARGUMENT=" -only-testing $TEST_NAME" | ||
else | ||
TEST_NAME_ARGUMENT="" | ||
fi | ||
set -o pipefail && env NSUnbufferedIO=YES xcodebuild \ | ||
-project MullvadVPN.xcodeproj \ | ||
-scheme MullvadVPNUITests \ | ||
-testPlan MullvadVPNUITestsAll $TEST_NAME_ARGUMENT \ | ||
-destination "platform=iOS,id=$TEST_DEVICE_UDID" \ | ||
-derivedDataPath derived-data \ | ||
clean build-for-testing 2>&1 | ||
for file in *.xcconfig.template; do cp $file ${file//.template/}; done | ||
sed -i "" "/^HAS_TIME_ACCOUNT_NUMBER/d" UITests.xcconfig | ||
sed -i "" "/^NO_TIME_ACCOUNT_NUMBER/d" UITests.xcconfig | ||
sed -i "" \ | ||
"/IOS_DEVICE_PIN_CODE =/ s/= .*/= $IOS_DEVICE_PIN_CODE/" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"/TEST_DEVICE_IDENTIFIER_UUID =/ s/= .*/= $TEST_DEVICE_IDENTIFIER_UUID/" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"s#^// PARTNER_API_TOKEN =#PARTNER_API_TOKEN =#" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"/PARTNER_API_TOKEN =/ s#= .*#= $PARTNER_API_TOKEN#" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"/ATTACH_APP_LOGS_ON_FAILURE =/ s#= .*#= 1#" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"/TEST_DEVICE_IS_IPAD =/ s#= .*#= 0#" \ | ||
UITests.xcconfig | ||
sed -i "" \ | ||
"/UNINSTALL_APP_IN_TEST_SUITE_TEAR_DOWN =/ s#= .*#= 0#" \ | ||
UITests.xcconfig | ||
shell: bash | ||
working-directory: ios/ | ||
env: | ||
TEST_DEVICE_UDID: ${{ inputs.test_device_udid }} | ||
TEST_NAME: ${{ inputs.test_name }} | ||
working-directory: ${{ env.base_directory }}/ios/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,88 +3,92 @@ 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: | ||
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 you must have notifications for | ||
# Github Actions enabled, so these don't go unnoticed. | ||
# https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/notifications-for-workflow-runs | ||
- cron: '0 0 * * *' | ||
- cron: '0 0 * * *' # At midnight every day. | ||
|
||
env: | ||
TEST_DEVICE_UDID: 00008130-0019181022F3803A | ||
OLD_APP_COMMIT_HASH: 895b7d98825e678f5d7023d5ea3c9b7beee89280 | ||
OLD_APP_COMMIT_HASH: f82b90126441e9f8afa8c820faa0e5b2c99ecc3e | ||
|
||
jobs: | ||
checkout_old_version: | ||
name: Checkout Old Repository Version | ||
checkout_version: | ||
name: Checkout Current Repository Version | ||
runs-on: | ||
- self-hosted | ||
- macOS | ||
- ios-test | ||
steps: | ||
- name: Checkout old repository version | ||
- name: Checkout current repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.OLD_APP_COMMIT_HASH }} | ||
|
||
configure_rust: | ||
name: Configure Rust | ||
runs-on: | ||
- self-hosted | ||
- macOS | ||
- ios-test | ||
needs: checkout_old_version | ||
needs: checkout_version | ||
steps: | ||
- name: Configure Rust | ||
uses: actions-rs/[email protected] | ||
with: | ||
toolchain: stable | ||
override: true | ||
target: aarch64-apple-ios | ||
|
||
uninstall_app: | ||
name: Uninstall Old App | ||
name: Uninstall App | ||
runs-on: | ||
- self-hosted | ||
- macOS | ||
- ios-test | ||
needs: checkout_old_version | ||
needs: checkout_version | ||
steps: | ||
- name: Uninstall old app | ||
timeout-minutes: 5 | ||
run: ios-deploy --id ${{ env.TEST_DEVICE_UDID }} --uninstall_only --bundle_id | ||
net.mullvad.MullvadVPN | ||
run: ios-deploy --id ${{ env.TEST_DEVICE_UDID }} --uninstall_only --bundle_id net.mullvad.MullvadVPN | ||
|
||
change_dns_settings: | ||
name: Change DNS Settings on Old App Version | ||
needs: | ||
- checkout_old_version | ||
- checkout_version | ||
- configure_rust | ||
- uninstall_app | ||
uses: mullvad/mullvadvpn-app/.github/workflows/ios-end-to-end-tests.yml@main | ||
uses: ./.github/workflows/ios-end-to-end-tests.yml | ||
with: | ||
arg_tests_json_key: "MullvadVPNUITestsChangeDNSSettings" | ||
commit_hash: ${{ env.OLD_APP_COMMIT_HASH }} | ||
secrets: inherit | ||
|
||
verify_dns_settings: | ||
name: Verify DNS Settings Still Changed on Current App Version | ||
needs: change_dns_settings | ||
uses: mullvad/mullvadvpn-app/.github/workflows/ios-end-to-end-tests.yml@main | ||
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: verify_dns_settings | ||
uses: mullvad/mullvadvpn-app/.github/workflows/ios-end-to-end-tests.yml@main | ||
uses: ./.github/workflows/ios-end-to-end-tests.yml | ||
with: | ||
arg_tests_json_key: "MullvadVPNUITestsChangeSettings" | ||
commit_hash: ${{ env.OLD_APP_COMMIT_HASH }} | ||
secrets: inherit | ||
|
||
verify_other_settings: | ||
name: Verify All Other Settings Still Changed on Current App Version | ||
needs: change_other_settings | ||
uses: mullvad/mullvadvpn-app/.github/workflows/ios-end-to-end-tests.yml@main | ||
uses: ./.github/workflows/ios-end-to-end-tests.yml | ||
with: | ||
arg_tests_json_key: "MullvadVPNUITestsVerifySettingsChanged" | ||
secrets: inherit |
Oops, something went wrong.