Skip to content

Commit

Permalink
add GITLAB_TOKEN to vars passed during mod test, make easier to expand
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Worm <tony@hofstadter.io>
  • Loading branch information
verdverm committed Aug 26, 2021
1 parent 8e7a1b5 commit 5d48525
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/mod/cli_test.go
@@ -1,6 +1,7 @@
package mod_test

import (
"fmt"
"os"
"testing"

Expand All @@ -9,8 +10,14 @@ import (
)

func envSetup(env *runtime.Env) error {
if token := os.Getenv("GITHUB_TOKEN"); token != "" {
env.Vars = append(env.Vars, "GITHUB_TOKEN="+token)
vars := []string{
"GITHUB_TOKEN",
"GITLAB_TOKEN",
}
for _, v := range vars {
if val := os.Getenv(v); val != "" {
env.Vars = append(env.Vars, fmt.Sprintf("%s=%s", v, val))
}
}
env.Vars = append(env.Vars, "HOF_TELEMETRY_DISABLED=1")
return nil
Expand Down

0 comments on commit 5d48525

Please sign in to comment.