Skip to content

Commit

Permalink
Fixup EnableIfOidcExistsCondition condition for running tests locally
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  • Loading branch information
vlsi committed Sep 16, 2022
1 parent 96707e0 commit fbcf87c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
tasks.withType<Test>().configureEach {
if (project.hasProperty("skipOidc")) {
println("skipOidc: ${project.findProperty("skipOidc")}")
systemProperty("sigstore-java.test.skipOidc", project.findProperty("skipOidc")!!)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ class EnableIfOidcExistsCondition : ExecutionCondition {
.map { it.provider }.orElse(OidcProviderType.ANY)

return when {
provider == OidcProviderType.MANUAL ->
if (System.getenv("CI") == "true") {
disabled("CI environment is present, and the test has been configured to run with MANUAL OIDC only")
} else {
enabled("the test has been configured with MANUAL OIDC, and no CI environment variable is detected")
}
provider == OidcProviderType.MANUAL &&
System.getenv("CI") == "true" ->
disabled("CI environment variable is present, and the test has been configured to run with MANUAL OIDC only")

provider in listOf(OidcProviderType.ANY, OidcProviderType.MANUAL) &&
System.getenv("CI") != "true" ->
enabled("the test has been configured with MANUAL OIDC, and no CI environment variable is detected")

provider in listOf(OidcProviderType.ANY, OidcProviderType.CI, OidcProviderType.GITHUB) &&
System.getenv("ACTIONS_ID_TOKEN_REQUEST_URL") != null ->
Expand Down

0 comments on commit fbcf87c

Please sign in to comment.