Merge pull request #953 from wonderflow/svcd

deprecate unused vela commands
This commit is contained in:
Jianbo Sun
2021-01-29 13:48:31 +08:00
committed by GitHub
58 changed files with 112 additions and 814 deletions
-37
View File
@@ -6,7 +6,6 @@ import (
"io/ioutil"
"net/http"
"strings"
"time"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
@@ -16,19 +15,6 @@ import (
)
var (
// SystemInitContext used for test install
SystemInitContext = func(context string) bool {
return ginkgo.Context(context, func() {
ginkgo.It("Install OAM runtime and vela builtin capabilities.", func() {
output, err := LongTimeExec("vela install --wait", 180*time.Second)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("- Installing OAM Kubernetes Runtime"))
gomega.Expect(output).To(gomega.ContainSubstring("- Installing builtin capabilities"))
gomega.Expect(output).To(gomega.ContainSubstring("Successful applied"))
gomega.Expect(output).To(gomega.ContainSubstring("Waiting KubeVela runtime ready to serve"))
})
})
}
// EnvInitContext used for test Env
EnvInitContext = func(context string, envName string) bool {
@@ -113,17 +99,6 @@ var (
})
}
//WorkloadRunContext used for test vela svc deploy
WorkloadRunContext = func(context string, cli string) bool {
return ginkgo.Context(context, func() {
ginkgo.It("should print successful creation information", func() {
output, err := Exec(cli)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("deployed"))
})
})
}
WorkloadDeleteContext = func(context string, applicationName string) bool {
return ginkgo.Context(context, func() {
ginkgo.It("should print successful deletion information", func() {
@@ -154,18 +129,6 @@ var (
})
})
}
// TraitManualScalerAttachContext used for test trait attach success
TraitManualScalerAttachContext = func(context string, traitAlias string, applicationName string) bool {
return ginkgo.Context(context, func() {
ginkgo.It("should print successful attached information", func() {
cli := fmt.Sprintf("vela %s %s", traitAlias, applicationName)
output, err := LongTimeExec(cli, 180*time.Second)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("Adding " + traitAlias + " for app"))
gomega.Expect(output).To(gomega.ContainSubstring("Checking Status"))
})
})
}
// ComponentListContext used for test vela svc ls
ComponentListContext = func(context string, applicationName string, workloadType string, traitAlias string) bool {
-13
View File
@@ -1,13 +0,0 @@
package e2e
import (
"testing"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
)
func TestApplication(t *testing.T) {
gomega.RegisterFailHandler(ginkgo.Fail)
ginkgo.RunSpecs(t, "System Suite")
}
-10
View File
@@ -1,10 +0,0 @@
package e2e
import (
"github.com/onsi/ginkgo"
)
var _ = ginkgo.Describe("Application", func() {
// TODO(zzxwill) Need to find out why it failed in Github workflow.
//e2e.SystemInitContext("install")
})
-37
View File
@@ -1,48 +1,11 @@
package e2e
import (
"fmt"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
"github.com/oam-dev/kubevela/e2e"
)
var (
envName = "env-trait"
applicationName = "app-trait-basic"
applicationNotExistedName = "app-trait-basic-NOT-EXISTED"
traitAlias = "scaler"
serviceNameNotExisting = "svc-not-existing"
)
var _ = ginkgo.Describe("Trait", func() {
e2e.TraitCapabilityListContext()
e2e.EnvInitContext("env init", envName)
e2e.EnvSetContext("env set", envName)
e2e.WorkloadRunContext("deploy", fmt.Sprintf("vela svc deploy -t webservice %s -p 80 --image nginx:1.9.4", applicationName))
e2e.TraitManualScalerAttachContext("vela attach trait", traitAlias, applicationName)
// Trait
ginkgo.Context("vela attach trait to a not existing app", func() {
ginkgo.It("should alert app not exist", func() {
cli := fmt.Sprintf("vela %s %s", traitAlias, applicationNotExistedName)
output, err := e2e.Exec(cli)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("the application " + applicationNotExistedName + " doesn't exist in current env " + envName))
})
})
ginkgo.Context("vela attach trait to a not existing service", func() {
ginkgo.It("should alert service not exist", func() {
cli := fmt.Sprintf("vela %s %s --svc %s", traitAlias, applicationName, serviceNameNotExisting)
output, err := e2e.Exec(cli)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("the service " + serviceNameNotExisting + " doesn't exist in the application " + applicationName))
})
})
e2e.WorkloadDeleteContext("delete", applicationName)
})
-23
View File
@@ -1,34 +1,11 @@
package e2e
import (
"fmt"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
"github.com/oam-dev/kubevela/e2e"
)
var (
envName = "env-workload"
applicationName = "app-workload-basic"
notEnoughFlagsApplicationName = "app-workload-basic"
)
var _ = ginkgo.Describe("Workload", func() {
e2e.WorkloadCapabilityListContext()
e2e.EnvInitContext("env init", envName)
e2e.EnvSetContext("env set", envName)
e2e.WorkloadRunContext("deploy", fmt.Sprintf("vela svc deploy -t webservice %s -p 80 --image nginx:1.9.4", applicationName))
ginkgo.Context("run without enough flags", func() {
ginkgo.It("should throw error message: some flags are NOT set", func() {
cli := fmt.Sprintf("vela svc deploy -t webservice %s -p 80", notEnoughFlagsApplicationName)
output, err := e2e.Exec(cli)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("required flag(s) \"image\" not set"))
})
})
e2e.WorkloadDeleteContext("delete", applicationName)
})