diff --git a/test/_oncluster/scenario_runtime_test.go b/test/_oncluster/scenario_runtime_test.go index 50840484ce..a19dbe8174 100644 --- a/test/_oncluster/scenario_runtime_test.go +++ b/test/_oncluster/scenario_runtime_test.go @@ -4,6 +4,7 @@ package oncluster import ( + "fmt" "os" "path/filepath" "strings" @@ -13,6 +14,15 @@ import ( e2e "knative.dev/kn-plugin-func/test/_e2e" ) +var runtimeSupportMap = map[string][]string{ + "node": {"pack", "s2i"}, + "go": {}, + "python": {"pack"}, + "quarkus": {"pack", "s2i"}, + "springboot": {"pack"}, + "typescript": {"pack", "s2i"}, +} + // TestRuntime will invoke a language runtime test against (by default) to all runtimes. // The Environment Variable E2E_RUNTIMES can be used to select the languages/runtimes to be tested func TestRuntime(t *testing.T) { @@ -25,19 +35,24 @@ func TestRuntime(t *testing.T) { runtimeList = strings.Split(runtimes, " ") } } else { - runtimeList = []string{"node", "python", "quarkus", "springboot", "typescript"} // "go" and "rust" pending support + for k := range runtimeSupportMap { + runtimeList = append(runtimeList, k) + } } + for _, lang := range runtimeList { - t.Run(lang+"_test", func(t *testing.T) { - runtimeImpl(t, lang) - }) + for _, builder := range runtimeSupportMap[lang] { + t.Run(fmt.Sprintf("%v_%v_test", lang, builder), func(t *testing.T) { + runtimeImpl(t, lang, builder) + }) + } } } -func runtimeImpl(t *testing.T, lang string) { +func runtimeImpl(t *testing.T, lang string, builder string) { - var gitProjectName = "test-func-lang-" + lang + var gitProjectName = fmt.Sprintf("test-runtime-%v-%v", lang, builder) var gitProjectPath = filepath.Join(os.TempDir(), gitProjectName) var funcName = gitProjectName var funcPath = gitProjectPath @@ -56,6 +71,7 @@ func runtimeImpl(t *testing.T, lang string) { knFunc.Exec("deploy", "-r", e2e.GetRegistry(), "-p", funcPath, + "--builder", builder, "--build", "git", "--git-url", remoteRepo.ClusterCloneURL)