move e2e test folder in case those test suites are triggerred by unit-test

This commit is contained in:
zzxwill 2020-08-03 15:51:43 +08:00
parent bc0c15988c
commit a0177272d0
4 changed files with 10 additions and 11 deletions

View File

@ -45,7 +45,7 @@ e2e-setup:
e2e-test:
# Run e2e test
ginkgo -v -r pkg/test
ginkgo -v -r e2e
e2e-cleanup:
# Clean up

View File

@ -1,4 +1,4 @@
package test
package e2e
import (
"os"
@ -20,7 +20,7 @@ func GetCliBinary() (string, error) {
// TODO(zzxwill) Need to check before building from scratch every time
cwd, _ := os.Getwd()
rudrPath = path.Join(cwd, "..")
mainPath := path.Join(rudrPath, "../../cmd/rudrx/main.go")
mainPath := path.Join(rudrPath, "../cmd/rudrx/main.go")
cmd := exec.Command("go", "build", "-o", path.Join(rudrPath, "rudr"), mainPath)
_, err := cmd.Output()

View File

@ -1,9 +1,9 @@
package component
package e2e
import (
"github.com/cloud-native-application/rudrx/e2e"
"testing"
"github.com/cloud-native-application/rudrx/pkg/test"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
)
@ -11,7 +11,7 @@ import (
var rudrPath string
var _ = ginkgo.BeforeSuite(func() {
p, err := test.GetCliBinary()
p, err := e2e.GetCliBinary()
rudrPath = p
gomega.Expect(err).NotTo(gomega.HaveOccurred())
})

View File

@ -1,9 +1,8 @@
package component
package e2e
import (
"fmt"
rudr "github.com/cloud-native-application/rudrx/pkg/test"
"github.com/cloud-native-application/rudrx/e2e"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
)
@ -16,7 +15,7 @@ var _ = ginkgo.Describe("Component", func() {
ginkgo.Context("run", func() {
ginkgo.It("should print successful creation information", func() {
cli := fmt.Sprintf("rudr containerized:run %s -p 80 --image nginx:1.9.4", applicationName)
output, err := rudr.Exec(cli)
output, err := e2e.Exec(cli)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("SUCCEED"))
})
@ -25,7 +24,7 @@ var _ = ginkgo.Describe("Component", func() {
ginkgo.Context("delete", func() {
ginkgo.It("should print successful deletion information", func() {
cli := fmt.Sprintf("rudr delete %s", applicationName)
output, err := rudr.Exec(cli)
output, err := e2e.Exec(cli)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("DELETE SUCCEED"))
})