Skip to content

Commit

Permalink
Updated naming
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasberglund committed Aug 16, 2024
1 parent 48ea864 commit f46ba3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.mullvad.mullvadvpn.test.e2e.annotations

import androidx.test.platform.app.InstrumentationRegistry
import net.mullvad.mullvadvpn.test.e2e.constant.IGNORE_HIGHLY_RATE_LIMITED
import net.mullvad.mullvadvpn.test.e2e.constant.ENABLE_HIGHLY_RATE_LIMITED
import net.mullvad.mullvadvpn.test.e2e.extension.getRequiredArgument
import org.junit.jupiter.api.extension.ConditionEvaluationResult
import org.junit.jupiter.api.extension.ExecutionCondition
Expand All @@ -19,19 +19,19 @@ annotation class HighlyRateLimited {
override fun evaluateExecutionCondition(
context: ExtensionContext?
): ConditionEvaluationResult {
val ignoreHighlyRateLimited =
val enableHighlyRateLimited =
InstrumentationRegistry.getArguments()
.getRequiredArgument(IGNORE_HIGHLY_RATE_LIMITED)
.getRequiredArgument(ENABLE_HIGHLY_RATE_LIMITED)
.toBoolean()

if (ignoreHighlyRateLimited) {
return ConditionEvaluationResult.disabled(
"Skipping test highly affected by rate limiting."
)
} else {
if (enableHighlyRateLimited) {
return ConditionEvaluationResult.enabled(
"Running test highly affected by rate limiting."
)
} else {
return ConditionEvaluationResult.disabled(
"Skipping test highly affected by rate limiting."
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ const val LOG_TAG = "mullvad-e2e"
const val PARTNER_AUTH = "partner_auth"
const val VALID_TEST_ACCOUNT_NUMBER_ARGUMENT_KEY = "valid_test_account_number"
const val INVALID_TEST_ACCOUNT_NUMBER_ARGUMENT_KEY = "invalid_test_account_number"
const val IGNORE_HIGHLY_RATE_LIMITED = "enable_highly_rate_limited_tests"
const val ENABLE_HIGHLY_RATE_LIMITED = "enable_highly_rate_limited_tests"

0 comments on commit f46ba3a

Please sign in to comment.