Run instrumented tests as part of the Smoke Suite

Avoid using a separate job as the test cases are not that many and we don't need to run them in isolation.

MAILANDR-581
This commit is contained in:
Niccolò Forlini
2023-06-08 10:55:48 +02:00
parent e0d885977b
commit 99952c67dd
6 changed files with 10 additions and 46 deletions
-5
View File
@@ -149,11 +149,6 @@ run_unit_test:
script:
- bundle exec fastlane unitTest
run_firebase_instrumentation_tests:
extends: .firebase_test_job
script:
- bundle exec fastlane instrumentedTest
run_firebase_proton_core_libs_tests:
extends: .firebase_test_job
allow_failure: true # Temporary, as long as we don't have a more specific test environment.
@@ -29,12 +29,14 @@ import ch.protonmail.android.mailmessage.data.local.relation.MessageWithLabelIds
import ch.protonmail.android.mailmessage.data.sample.MessageEntitySample
import ch.protonmail.android.mailmessage.data.sample.MessageLabelEntitySample
import ch.protonmail.android.mailmessage.data.sample.MessageWithLabelIdsSample
import ch.protonmail.android.test.annotations.suite.SmokeTest
import kotlinx.coroutines.runBlocking
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertContentEquals
class MessageDaoTest : BaseDatabaseTest() {
@SmokeTest
internal class MessageDaoTest : BaseDatabaseTest() {
private val allMessages = listOf(
MessageWithLabelIdsSample.AugWeatherForecast,
@@ -21,10 +21,12 @@ package ch.protonmail.android.db
import androidx.room.Room
import androidx.room.testing.MigrationTestHelper
import androidx.test.platform.app.InstrumentationRegistry
import ch.protonmail.android.test.annotations.suite.SmokeTest
import org.junit.Rule
import org.junit.Test
class MigrationTest {
@SmokeTest
internal class MigrationTest {
private val testDb = "migration-test"
@@ -19,6 +19,7 @@
package ch.protonmail.android.feature.forceupdate
import android.content.Context
import ch.protonmail.android.test.annotations.suite.SmokeTest
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
@@ -28,7 +29,8 @@ import me.proton.core.presentation.app.AppLifecycleProvider
import org.junit.Before
import org.junit.Test
class ForceUpdateHandlerTest {
@SmokeTest
internal class ForceUpdateHandlerTest {
private val context = mockk<Context>(relaxed = true)
private val appState = MutableStateFlow(AppLifecycleProvider.State.Background)
@@ -37,7 +39,7 @@ class ForceUpdateHandlerTest {
every { state } returns appState
}
lateinit var forceUpdateHandler: ForceUpdateHandler
private lateinit var forceUpdateHandler: ForceUpdateHandler
@Before
fun setUp() {
-5
View File
@@ -54,11 +54,6 @@ platform :android do
sh("../scripts/uitests/setup-mock-network-assets.sh setup-remote")
end
desc "Runs Instrumented Tests on Firebase"
lane :instrumentedTest do
sh("../scripts/run_firebase_instrumentation_tests.sh")
end
desc "Runs Proton Core Libraries Tests Suite on Firebase Test lab"
lane :coreLibsTest do
sh("../scripts/run_firebase_ui_tests.sh core-libs-test")
@@ -1,32 +0,0 @@
#
# Copyright (c) 2022 Proton Technologies AG
# This file is part of Proton Technologies AG and Proton Mail.
#
# Proton Mail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Proton Mail is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proton Mail. If not, see <https://www.gnu.org/licenses/>.
#
#!/bin/bash
set -e
gcloud firebase test android run \
--app ../app/build/outputs/apk/dev/debug/app-dev-debug.apk \
--test ../app/build/outputs/apk/androidTest/dev/debug/app-dev-debug-androidTest.apk \
--type=instrumentation \
--device model=Pixel2.arm,version=28 \
--test-targets "notPackage ch.protonmail.android.uitest" \
--use-orchestrator \
--num-flaky-test-attempts=1 \
--timeout 10m \
--no-auto-google-login