Skip to content

Commit

Permalink
Adding RUNNER_IMG setting test
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Aufart <[email protected]>
  • Loading branch information
aufi committed Jun 3, 2024
1 parent 476c376 commit 3d5e578
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cmd/settings_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cmd

import (
"os"
"testing"
)

// Test RUNNER_IMG settings
func TestRunnerImgDefault(t *testing.T) {
os.Unsetenv("RUNNER_IMG") // Ensure empty variable
s := &Config{}
s.Load();
if s.RunnerImage != "quay.io/konveyor/kantra" {
t.Errorf("Unexpected RUNNER_IMG default: %s", s.RunnerImage)
}
}

func TestRunnerImgCustom(t *testing.T) {
os.Setenv("RUNNER_IMG", "quay.io/some-contributor/my-kantra")
s := &Config{}
s.Load();
if s.RunnerImage != "quay.io/some-contributor/my-kantra" {
t.Errorf("Unexpected RUNNER_IMG: %s", s.RunnerImage)
}
}

0 comments on commit 3d5e578

Please sign in to comment.