diff options
| author | David Göransson <david.goransson@mullvad.net> | 2025-05-20 10:12:12 +0200 |
|---|---|---|
| committer | David Göransson <david.goransson@mullvad.net> | 2025-05-21 11:56:46 +0200 |
| commit | f2b6a3d2d04d33e106b794ae489d506651f41f91 (patch) | |
| tree | 3946e8dc8792199eab45e6fee3d31775aa773fb8 | |
| parent | 39eccff2fbdd35e7a427877f77a31eef1510284a (diff) | |
| download | mullvadvpn-f2b6a3d2d04d33e106b794ae489d506651f41f91.tar.xz mullvadvpn-f2b6a3d2d04d33e106b794ae489d506651f41f91.zip | |
Update with new property references
| -rw-r--r-- | android/BuildInstructions.md | 25 | ||||
| -rw-r--r-- | android/test/e2e/README.md | 25 |
2 files changed, 25 insertions, 25 deletions
diff --git a/android/BuildInstructions.md b/android/BuildInstructions.md index da38741f40..161685fa89 100644 --- a/android/BuildInstructions.md +++ b/android/BuildInstructions.md @@ -207,7 +207,7 @@ in the following way: 1. Run update script: ```bash - ./scripts/update-lockfile.sh + ./scripts/lockfile -u ``` If you're on macOS make sure GNU sed is installed. Install with `brew install gnu-sed` and add it to your `PATH` so that it is used instead of the `sed` macOS ships with `PATH="$HOMEBREW_PREFIX/opt/gnu-sed/libexec/gnubin:$PATH"` @@ -221,25 +221,30 @@ rm ./gradle/verification-metadata.xml ``` ## Gradle properties -Some gradle properties can be set to simplify development. These are listed below. +Some gradle properties can be set to simplify development, for the full list see `android/gradle.properties`. +In order to override them, add the properties in `<USER_GRADLE_HOME>/gradle.properties`. See the +[gradle documentation](https://docs.gradle.org/current/userguide/build_environment.html#sec:project_properties) +for more info of the prioritization of properties. ### Override version code and version name -To avoid or override the rust based version generation, the `OVERRIDE_VERSION_CODE` and -`OVERRIDE_VERSION_NAME` properties can be set in `local.properties`. For example: +To avoid or override the rust based version generation, the `mullvad.app.config.override.versionCode` and +`mullvad.app.config.override.versionName` properties can be set: ``` -OVERRIDE_VERSION_CODE=123 -OVERRIDE_VERSION_NAME=1.2.3 +mullvad.app.config.override.versionCode=123 +mullvad.app.config.override.versionName=1.2.3 ``` ### Disable version in-app notifications To disable in-app notifications related to the app version during development or testing, -the `ENABLE_IN_APP_VERSION_NOTIFICATIONS` property can be set in `local.properties`: +the `mullvad.app.config.inAppVersionNotifications.enable` property can be set: ``` -ENABLE_IN_APP_VERSION_NOTIFICATIONS=false +mullvad.app.config.inAppVersionNotifications.enable=false ``` ### Run tests highly affected by rate limiting -To avoid being rate limited we avoid running tests sending requests that are highly rate limited too often. If you want to run these tests you can set `enable_highly_rate_limited_tests=true` in `local.properties`. The default value is `false`. +To avoid being rate limited we avoid running tests sending requests that are highly rate limited +too often. If you want to run these tests you can override the +`mullvad.test.e2e.config.runHighlyRateLimitedTests` gradle properties. The default value is `false`. ## Reproducible builds @@ -249,7 +254,7 @@ The Mullvad Android app is by default reproducible when built using our build co When building without the container on Linux systems, reproducibility depends on having the exact same versions of system tools (compilers, build tools, etc) installed. Small differences in tool versions or configurations can lead to different build outputs even when using the same source code. -> **Make sure that the `local.properties` file has not changed keys that affect the reproducibility of the build such as `CARGO_TARGETS` and `ENABLE_IN_APP_VERSION_NOTIFICATIONS`.** +> **Make sure that any `gradle.properties` has not changed or been overridden it will affect the reproducibility of the build such as changing `mullvad.app.build.cargo.targets` and `mullvad.app.config.inAppVersionNotifications.enable`.** To maximize reproducibility when building without the container: diff --git a/android/test/e2e/README.md b/android/test/e2e/README.md index adbcc042cd..58f6206c87 100644 --- a/android/test/e2e/README.md +++ b/android/test/e2e/README.md @@ -4,17 +4,14 @@ The tests in this module are end-to-end tests that rely on the publicly accessib ## How to run the tests ### Locally -Set account numbers in the below command and then execute the command in the `android` directory to run the tests on a local device: -``` -./gradlew :test:e2e:connectedDebugAndroidTest \ - -Pvalid_test_account_number=XXXX \ - -Pinvalid_test_account_number=XXXX -``` -For convenience, the numbers can also be set in `<REPO-ROOT>/android/local.properties` in the following way: +Configure all the `mullvad.test.e2e.xxxx` properties located in `android/gradle.properties` by adding them into your `<GRADLE_USER_HOME>/gradle.properties`. + +You can also set these properties or override them when executing the command in the following way: ``` -valid_test_account_number=XXXX -invalid_test_account_number=XXXX +./gradlew :test:e2e:connectedDebugAndroidTest \ + -Pmullvad.test.e2e.prod.accountNumber.valid=XXXX \ + -Pmullvad.test.e2e.prod.accountNumber.invalid==XXXX ``` It's also possible to provide the numbers to the test runner during test execution. However note that this requires [the APKs to be installed manually](https://developer.android.com/training/testing/instrumented-tests/androidx-test-libraries/runner#architecture). @@ -22,14 +19,12 @@ It's also possible to provide the numbers to the test runner during test executi adb shell 'CLASSPATH=$(pm path androidx.test.services) app_process / \ androidx.test.services.shellexecutor.ShellMain am instrument -w \ -e clearPackageData true \ - -e valid_test_account_number XXXX \ - -e invalid_test_account_number XXXX \ + -e mullvad.test.e2e.prod.accountNumber.valid XXXX \ + -e mullvad.test.e2e.prod.accountNumber.invalid XXXX \ -e targetInstrumentation net.mullvad.mullvadvpn.test.e2e/androidx.test.runner.AndroidJUnitRunner \ androidx.test.orchestrator/.AndroidTestOrchestrator' ``` -If you want to run tests that make use of APIs hosted at Mullvad HQ you need to set `ENABLE_ACCESS_TO_LOCAL_API_TESTS=true` in `e2e.properties` or pass it as a command line argument when launching tests. - ### Firebase Test Lab Firebase Test Lab can be used to run the tests on vast collection of physical and virtual devices. @@ -43,7 +38,7 @@ gcloud firebase test android run \ --test ./android/test/e2e/build/outputs/apk/debug/e2e-debug.apk \ --device model=redfin,version=30,locale=en,orientation=portrait \ --use-orchestrator \ - --environment-variables clearPackageData=true,valid_test_account_number=XXXX,invalid_test_account_number=XXXX + --environment-variables clearPackageData=true,ORG_GRADLE_PROJECT_mullvad.test.e2e.prod.accountNumber.valid=XXXX,ORG_GRADLE_PROJECT_mullvad.test.e2e.prod.accountNumber.invalid=XXXX ``` If using gcloud via the docker image, the following can be executed in the `android` directory to run the tests (on a Pixel 5e): @@ -54,7 +49,7 @@ docker run --rm --volumes-from gcloud-config -v ${PWD}:/android gcr.io/google.co --test ./android/test/e2e/build/outputs/apk/debug/e2e-debug.apk \ --device model=redfin,version=30,locale=en,orientation=portrait \ --use-orchestrator \ - --environment-variables clearPackageData=true,valid_test_account_number=XXXX,invalid_test_account_number=XXXX + --environment-variables clearPackageData=true,ORG_GRADLE_PROJECT_mullvad.test.e2e.prod.accountNumber.valid=XXXX,ORG_GRADLE_PROJECT_mullvad.test.e2e.prod.accountNumber.invalid=XXXX ``` ## Test artefacts |
