Updated tests to work in more CICD envs
All checks were successful
test / test-default (push) Successful in 59s
All checks were successful
test / test-default (push) Successful in 59s
This commit is contained in:
14
env_test.go
14
env_test.go
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
func TestEnvironment(t *testing.T) {
|
||||
key := "USER"
|
||||
if testInPipeline() {
|
||||
if _, ci := testInPipeline(); ci {
|
||||
key = "CI"
|
||||
}
|
||||
|
||||
@@ -24,9 +24,15 @@ func TestEnvironmentPrefix(t *testing.T) {
|
||||
prefix = "US"
|
||||
key = "ER"
|
||||
)
|
||||
if testInPipeline() {
|
||||
prefix = "CI_"
|
||||
key = "JOB_ID"
|
||||
if platform, ci := testInPipeline(); ci {
|
||||
switch platform {
|
||||
case "gitea":
|
||||
prefix = "GITEA_"
|
||||
key = "ACTIONS"
|
||||
case "gitlab":
|
||||
prefix = "CI_"
|
||||
key = "JOB_ID"
|
||||
}
|
||||
}
|
||||
|
||||
testProvider(t, EnvironmentPrefix(prefix),
|
||||
|
Reference in New Issue
Block a user