Skip to content

Commit

Permalink
Get flag to uninstall app
Browse files Browse the repository at this point in the history
  • Loading branch information
mojganii committed Nov 18, 2024
1 parent 99adcc4 commit dbb746b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/actions/run-ios-e2e-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ inputs:
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
should_uninstall_app:
description: 'Boolean value to decide whether to uninstall the app before running tests'
required: true
default: 'true'

runs:
using: 'composite'
steps:
# Set up a unique output directory
- name: Set up outputs directory
run: |
# Forcing the filesystem buffers to be flushed to ensure the
# directory tree is updated
sync
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"
Expand All @@ -40,16 +41,17 @@ runs:
TEST_NAME: ${{ inputs.test_name }}
OUTPUTS_PATH: ${{ inputs.outputs_path }}

# Conditionally uninstall the app if should_uninstall_app is true
- name: Uninstall app
if: ${{ inputs.should_uninstall_app == 'true' }}
run: ios-deploy --id $TEST_DEVICE_UDID --uninstall_only --bundle_id net.mullvad.MullvadVPN
shell: bash
env:
TEST_DEVICE_UDID: ${{ inputs.test_device_udid }}

# Run end-to-end-tests
- name: Run end-to-end-tests
run: |
# Forcing the filesystem buffers to be flushed to ensure the
# directory tree is updated
sync
if [ -n "$TEST_NAME" ]; then
TEST_NAME_ARGUMENT=" -only-testing $TEST_NAME"
Expand All @@ -71,6 +73,7 @@ runs:
TEST_NAME: ${{ inputs.test_name }}
TEST_DEVICE_UDID: ${{ inputs.test_device_udid }}

# Store test report artifact
- name: Store test report artifact
if: always()
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit dbb746b

Please sign in to comment.