diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 67a0e37ff..4bad00fb2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -34,6 +34,9 @@ jobs: with: version: "v0.7.0" + - name: Run Make + run: make + - name: Run e2e tests run: | make e2e-setup @@ -41,8 +44,5 @@ jobs: make e2e-api-test make e2e-cleanup - - name: Run Make - run: make - - name: Run Make test run: make test diff --git a/Makefile b/Makefile index 36b166db6..5c9ae9710 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ docker-push: e2e-setup: ginkgo version ginkgo -v -r e2e/setup - /tmp/vela dashboard & # Somehow API server service doesn't start during setup in Github environment + bin/vela dashboard & e2e-test: # Run e2e test @@ -54,4 +54,4 @@ e2e-api-test: ginkgo -v -r e2e/apiserver e2e-cleanup: - # Clean up \ No newline at end of file + # Clean up diff --git a/e2e/cli.go b/e2e/cli.go index 8a2398999..f7936038d 100644 --- a/e2e/cli.go +++ b/e2e/cli.go @@ -7,23 +7,16 @@ import ( "strings" "time" - "github.com/onsi/gomega" - "github.com/onsi/ginkgo" "github.com/onsi/gomega/gexec" ) -var ( - rudrPath = "/tmp" -) +var rudrPath = GetCliBinary() //GetCliBinary is to build rudr binary. -func GetCliBinary() (string, error) { +func GetCliBinary() string { cwd, _ := os.Getwd() - mainPath := path.Join(cwd, "../../cmd/vela/main.go") - cmd := exec.Command("go", "build", "-o", path.Join(rudrPath, "vela"), mainPath) - _, err := cmd.Output() - return rudrPath, err + return path.Join(cwd, "../..", "./bin") } func Exec(cli string) (string, error) { @@ -45,8 +38,6 @@ func AsyncExec(cli string) (*gexec.Session, error) { } func BeforeSuit() { - _, err := GetCliBinary() - gomega.Expect(err).NotTo(gomega.HaveOccurred()) Exec("vela system init") //Without this line, will hit issue like `: Error: unknown command "scale" for "vela"` Exec("vela system update")