diff options
| author | Kalle Lindström <karl.lindstrom@mullvad.net> | 2025-08-22 15:05:02 +0200 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-09-10 08:53:51 +0200 |
| commit | bdf63fb1bf50f16d1f8f3c8e9c4064aa20dd59a3 (patch) | |
| tree | 34b311e6851bff63f4f5f21e666340b82debdd8c /android/test/arch/src | |
| parent | efca82e53a62237fb7fe327ad24e9dc2ae50ddeb (diff) | |
| download | mullvadvpn-bdf63fb1bf50f16d1f8f3c8e9c4064aa20dd59a3.tar.xz mullvadvpn-bdf63fb1bf50f16d1f8f3c8e9c4064aa20dd59a3.zip | |
Add inital baseline profile generation
To improve startup performance this
PR adds a baseline profile generation module in test/baselineprofile.
The baseline profile plugin requires Junit4 so that is also added as a
dependency.
A baseline-prof.txt was also generated by running
`./gradlew generatePlayProdReleaseBaselineProfile` and checked in.
The tests that generate the baselineprofile currently only start the app
and accepts the privacy policy. This should be improved later on to
improve the startup performance.
Diffstat (limited to 'android/test/arch/src')
| -rw-r--r-- | android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/JUnitTest.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/JUnitTest.kt b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/JUnitTest.kt index a2c743b360..4e1faf5e19 100644 --- a/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/JUnitTest.kt +++ b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/JUnitTest.kt @@ -10,7 +10,7 @@ class JUnitTest { @Test fun `ensure only junit5 annotations are used for functions`() = - Konsist.scopeFromProject() + projectScopeExceptBaseline() .functions() .filter { it.annotations.any { annotation -> @@ -22,7 +22,7 @@ class JUnitTest { @Test fun `ensure only junit5 annotations are used for classes`() = - Konsist.scopeFromProject() + projectScopeExceptBaseline() .classes() .filter { it.annotations.any { annotation -> @@ -44,6 +44,10 @@ class JUnitTest { fun `ensure all non android tests have 'ensure' or 'should' in function name`() = allNonAndroidTests().assertTrue { it.name.containsEnsureOrShould() } + // We should exclude baselineprofile since it requires JUnit4 + private fun projectScopeExceptBaseline() = + (Konsist.scopeFromProject() - Konsist.scopeFromDirectory("test/baselineprofile")) + private fun String.containsEnsureOrShould(): Boolean { return contains("ensure") || contains("should") || contains("then") } |
