Skip to content

Commit

Permalink
Added EnterpriseTestsFilter.| #2162
Browse files Browse the repository at this point in the history
  • Loading branch information
DenBond7 committed Mar 8, 2023
1 parent b47043d commit e235216
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .idea/runConfigurations/ADB_Print_enterprise_tests.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions .idea/runConfigurations/Run_enterprise_UI_tests.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact [email protected]
* Contributors: DenBond7
*/

package com.flowcrypt.email.junit.annotations

/**
* Via this annotation, we can mark a class or a method that should be run only for enterprise testing.
*
* @author Denys Bondarenko
*/
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
annotation class EnterpriseTest
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact [email protected]
* Contributors: DenBond7
*/

package com.flowcrypt.email.junit.filters

import com.flowcrypt.email.junit.annotations.EnterpriseTest
import org.junit.runner.Description

/**
* @author Denys Bondarenko
*/
class EnterpriseTestsFilter : ReadyForCIFilter() {
override fun evaluateTest(description: Description?): Boolean {
val annotationClass = EnterpriseTest::class.java
return super.evaluateTest(description)
&& isAnnotationPresentAtClassOrMethod(description, annotationClass)
}

override fun describe() = "Filter tests that should be run only for enterprise testing"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.flowcrypt.email.api.retrofit.response.base.ApiError
import com.flowcrypt.email.api.retrofit.response.model.ClientConfiguration
import com.flowcrypt.email.api.retrofit.response.model.Key
import com.flowcrypt.email.extensions.exceptionMsg
import com.flowcrypt.email.junit.annotations.EnterpriseTest
import com.flowcrypt.email.rules.ClearAppSettingsRule
import com.flowcrypt.email.rules.GrantPermissionRuleChooser
import com.flowcrypt.email.rules.RetryRule
Expand All @@ -34,7 +35,6 @@ import okhttp3.mockwebserver.RecordedRequest
import org.hamcrest.Matchers.containsString
import org.hamcrest.Matchers.`is`
import org.hamcrest.Matchers.not
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand All @@ -49,7 +49,7 @@ import java.util.concurrent.TimeUnit
*/
@MediumTest
@RunWith(AndroidJUnit4::class)
@Ignore("not completed")
@EnterpriseTest
class FesDuringSetupEnterpriseFlowTest : BaseFesDuringSetupFlowTest() {
@get:Rule
var ruleChain: TestRule = RuleChain
Expand Down

0 comments on commit e235216

Please sign in to comment.