You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests can be triggered locally from Xcode in the Test navigator or by running tests from the diamond in the editor gutter.
1
+
# Integration tests
5
2
6
-
#### On GitHub
7
-
There are five workflows running tests:
8
-
-[ios-end-to-end-tests.yml](https://github.com/mullvad/mullvadvpn-app/actions/workflows/ios-end-to-end-tests.yml) - super workflow which other workflows reuse. This is also the workflow you can manually trigger to run all tests or optionally specify which tests to run.
9
-
-[ios-end-to-end-tests-nightly.yml](https://github.com/mullvad/mullvadvpn-app/actions/workflows/ios-end-to-end-tests-nightly.yml) - scheduled nightly test run, running all tests.
10
-
-[ios-end-to-end-tests-merge-to-main.yml](https://github.com/mullvad/mullvadvpn-app/actions/workflows/ios-end-to-end-tests-merge-to-main.yml) - automatically tryggered by a PR merge to `main`.
11
-
-[ios-end-to-end-tests-api.yml](https://github.com/mullvad/mullvadvpn-app/actions/workflows/ios-end-to-end-tests-api.yml) - manually triggered tests focusing on making sure the API is functioning as intended on stagemole.
12
-
-[ios-end-to-end-tests-settings-migration.yml](https://github.com/mullvad/mullvadvpn-app/actions/workflows/ios-end-to-end-tests-settings-migration.yml) - for now this is still manually triggered. Tests installing older version of the app, changing settings, upgrading the app and verifying that settings were correctly migrated.
13
-
14
-
## Adding more tests
15
-
When adding more files with test suites they must be added to the `MullvadVPNUITestsAll` test plan and also added to the appropriate node(s) in `ios/MullvadVPNUITests/tests.json` file in order to run in CI. For new test cases in already existing test suite nothing needs to be done. The test case/suite values in `tests.json` translate to input for `xcodebuild -only-testing` which is in the format `<target-name>/<test-suite-name>/<test-case-name>`. The GitHub actions workflow will add the `<target-name>` part so only `<test-suite-name>/<test-case-name>` is required, where `<test-case-name>` is optional. So for example `AccountTests` and `AccountTests/testLogin` are both valid values.
16
-
17
-
## Set up local environment
18
-
To run tests locally you need to make sure you have copied the configuration template `UITests.xcconfig.template` to `UITests.xcconfig` and set up the configuration attributes. The configuration attributes you're mostly likely to want to set custom values for are at the top:
19
-
```
20
-
// Pin code of the iOS device under test
21
-
IOS_DEVICE_PIN_CODE =
22
-
23
-
// UUID to identify test runs. Should be unique per test device. Generate with for example uuidgen on macOS.
24
-
TEST_DEVICE_IDENTIFIER_UUID =
25
-
```
26
-
27
-
Look through other configuration attributes as well, but it is likely that their default value should be kept. Default values are set with local test execution in mind. They are changed in CI.
28
-
29
-
## CI setup
30
-
### iOS device setup
3
+
## iOS device setup
31
4
1. Make sure device is added to provisioning profiles
32
-
2. Enable developer mode
33
-
3. Disable passcode in iOS settings - otherwise tests cannot be started without manually entering passcode
34
-
4. Set the value of `TEST_DEVICE_UDID` to the UDID of the test device in `ios-end-to-end-tests.yml` and `ios-end-to-end-tests-settings-migration.yml`.
35
-
5. Make sure the test device is connected to the WiFi `app-team-ios-tests`
36
-
6. Make sure iCloud syncing of keychain is off on the device so that the device isn't getting WiFi passwords from another device causing it to sometimes connect to another WiFi.
37
-
7. After the device is set up download updated provisioning profiles on the GitHub runner computer(Download manual profiles in Xcode settings)
5
+
2. Disable passcode in iOS settings - otherwise tests cannot be started without manually entering passcode
6
+
3. Make sure device is configured in GitHub secrets(see *GitHub setup* below)
7
+
4. Make sure the test device is connected to the WiFi `app-team-ios-tests`
8
+
5. Make sure iCloud syncing of keychain is off on the device so that the device isn't getting WiFi passwords from another device causing it to sometimes connect to another WiFi.
38
9
39
-
###Set up of runner build environment
10
+
## Set up of runner environment
40
11
1. Install Xcode
41
12
2. Sign in with Apple id in Xcode
42
13
3. Download manual provisioning profiles in Xcode
43
14
4. Install Xcode command line tools `xcode-select --install`
@@ -57,18 +28,24 @@ Look through other configuration attributes as well, but it is likely that their
57
28
10. Install Go 1.19
58
29
-`brew install go@1.19`
59
30
60
-
###GitHub runner setup
31
+
## GitHub runner setup
61
32
1. Ask GitHub admin for new runner token and setup steps from GitHub. Set it up according to the steps, pass `--labels ios-test` to `config.sh` when running it. By default it will also have the labels `self-hosted` and `macOS` which are required as well.
62
-
2. Make sure GitHub actions secrets for the GitHub project are correctly set up:
33
+
2. Make sure GitHub actions secrets for the repository are correctly set up:
63
34
-`IOS_DEVICE_PIN_CODE` - Device passcode if the device require it, otherwise leave blank. Devices used with CI should not require passcode.
64
35
-`IOS_HAS_TIME_ACCOUNT_NUMBER` - Production server account without time left
65
36
-`IOS_NO_TIME_ACCOUNT_NUMBER` - Production server account with time added to it
66
-
-`TEST_DEVICE_IDENTIFIER_UUID` - unique identifier for the test device. Create new identifier with `uuidgen`.
37
+
-`IOS_TEST_DEVICE_IDENTIFIER_UUID` - unique identifier for the test device. Create new identifier with `uuidgen`.
38
+
-`IOS_TEST_DEVICE_UDID` - the iOS device's UDID.
67
39
-`PARTNER_API_TOKEN` - secret token for partner API. Optional and only intended to be used in CI when running tests against staging environment.
68
40
69
-
### Specifying which tests run when in CI
70
-
Which tests run when is specified in `tests.json`(See _Adding more tests_). Settings migration is an exception, it uses four different test plans and a separate workflow `ios-end-to-end-tests-settings-migration.yml` which executes the test plans in order, do not reinstall the app in between runs but upgrades the app after changing settings:
41
+
## Test plans
42
+
There are a few different test plans which are mainly to be triggered by GitHub action workflows but can also be triggered manually with Xcode:
43
+
*`MullvadVPNUITestsAll` - All tests except settings migration tests which are in separate test plan and workflow
44
+
*`MullvadVPNUITestsSmoke` - A few tests for smoke testing when merge:ing to `main`
45
+
46
+
And also the following test plans which are used for testing settings migration(`ios-end-to-end-tests-settings-migration`):
47
+
71
48
*`MullvadVPNUITestsChangeDNSSettings` - Change settings for using custom DNS
72
49
*`MullvadVPNUITestsVerifyDNSSettingsChanged` - Verify custom DNS settings still changed
73
50
*`MullvadVPNUITestsChangeSettings` - Change all settings except custom DNS setting
74
-
*`MullvadVPNUITestsVerifySettingsChanged` - Verify all settings except custom DNS setting still changed
51
+
*`MullvadVPNUITestsVerifySettingsChanged` - Verify all settings except custom DNS setting still changed
0 commit comments