-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the way iOS end to end tests workflows are set up
- Loading branch information
1 parent
94c1da4
commit 84f90cd
Showing
15 changed files
with
394 additions
and
123 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
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: 'Run iOS end to end tests action' | ||
description: 'Runs end to end tests on iOS device' | ||
inputs: | ||
test_name: | ||
description: 'Test case/suite name. Will run all tests in the test plan if not provided.' | ||
required: false | ||
test_device_udid: | ||
description: 'Test Device UDID' | ||
required: true | ||
outputs_path: | ||
description: 'Path to where outputs are stored - both build outputs and outputs from running tests. This should be unique for each job run in order to avoid concurrency issues.' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
# Set up a unique output directory | ||
- name: Set up outputs directory | ||
run: | | ||
if [ -n "$TEST_NAME" ]; then | ||
# Strip slashes to avoid creating subdirectories | ||
test_name_sanitized=$(printf "$TEST_NAME" | sed 's/\//_/g') | ||
echo "Setting output directory tests-output-test-name-sanitized" | ||
echo "$test_name_sanitized" | ||
test_output_directory="${{ env.OUTPUTS_PATH }}/tests-output-$test_name_sanitized" | ||
else | ||
echo "Setting output directory output" | ||
test_output_directory="${{ env.OUTPUTS_PATH }}/tests-output" | ||
fi | ||
echo "TEST_OUTPUT_DIRECTORY=$test_output_directory" >> $GITHUB_ENV | ||
echo "TEST_NAME_SANITIZED=$test_name_sanitized" >> $GITHUB_ENV | ||
shell: bash | ||
env: | ||
TEST_NAME: ${{ inputs.test_name }} | ||
OUTPUTS_PATH: ${{ inputs.outputs_path }} | ||
|
||
- name: Uninstall app | ||
run: ios-deploy --id $TEST_DEVICE_UDID --uninstall_only --bundle_id net.mullvad.MullvadVPN | ||
shell: bash | ||
env: | ||
TEST_DEVICE_UDID: ${{ inputs.test_device_udid }} | ||
|
||
- name: Run end-to-end-tests | ||
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 \ | ||
-resultBundlePath ${{ env.TEST_OUTPUT_DIRECTORY }}/xcode-test-report \ | ||
-derivedDataPath derived-data \ | ||
-destination "platform=iOS,id=$TEST_DEVICE_UDID" \ | ||
test-without-building 2>&1 #| xcbeautify --report junit --report-path ${{ env.TEST_OUTPUT_DIRECTORY }}/junit-test-report | ||
shell: bash | ||
working-directory: ${{ inputs.outputs_path }}/mullvadvpn-app/ios | ||
env: | ||
TEST_NAME: ${{ inputs.test_name }} | ||
TEST_DEVICE_UDID: ${{ inputs.test_device_udid }} | ||
|
||
- name: Store test report artifact | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.TEST_NAME_SANITIZED }}-test-results | ||
path: | | ||
${{ env.TEST_OUTPUT_DIRECTORY }}/junit-test-report/junit.xml | ||
${{ env.TEST_OUTPUT_DIRECTORY }}/xcode-test-report.xcresult | ||
env: | ||
TEST_NAME: ${{ inputs.test_name }} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
name: iOS end-to-end API tests | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
reuse-e2e-workflow: | ||
uses: ./.github/workflows/ios-end-to-end-tests.yml | ||
with: | ||
arg_tests_json_key: "api-tests" |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: iOS end-to-end merge to main tests | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
paths: | ||
- .github/workflows/ios-end-to-end-tests*.yml | ||
- ios/** | ||
jobs: | ||
reuse-e2e-workflow: | ||
uses: ./.github/workflows/ios-end-to-end-tests.yml | ||
with: | ||
arg_tests_json_key: "pr-merge-to-main" |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
name: iOS end-to-end nightly tests | ||
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 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 * * *' | ||
jobs: | ||
reuse-e2e-workflow: | ||
uses: ./.github/workflows/ios-end-to-end-tests.yml | ||
with: | ||
arg_tests_json_key: "nightly" |
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
Oops, something went wrong.