Add e2e tests using Service Accounts

This commit is contained in:
Volodymyr Zotov
2025-08-19 09:51:19 -05:00
parent 7d2596a4aa
commit d504e5ef35
4 changed files with 117 additions and 0 deletions

29
test/cmd/cmd.go Normal file
View File

@@ -0,0 +1,29 @@
package cmd
import (
"fmt"
"os"
"os/exec"
"strings"
)
// Run executes the provided command within this context
func Run(name string, args ...string) (string, error) {
cmd := exec.Command(name, args...)
wd, err := os.Getwd()
if err != nil {
return wd, err
}
wd = strings.Replace(wd, "/test/e2e", "", -1)
// Command will run from project root
cmd.Dir = wd
command := strings.Join(cmd.Args, " ")
output, err := cmd.CombinedOutput()
if err != nil {
return string(output), fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))
}
return string(output), nil
}