Updated tests to work in more CICD envs
All checks were successful
test / test-default (push) Successful in 59s

This commit is contained in:
2025-09-09 10:14:07 +02:00
parent caa9787770
commit e61ec39f79
3 changed files with 72 additions and 6 deletions

View File

@@ -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),