github.com/oam-dev/kubevela@v1.9.11/e2e/env/env_test.go (about) 1 /* 2 Copyright 2021 The KubeVela Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package e2e 18 19 import ( 20 "github.com/oam-dev/kubevela/e2e" 21 22 "github.com/onsi/ginkgo/v2" 23 "github.com/onsi/gomega" 24 ) 25 26 var ( 27 envName = "env-hello" 28 envName2 = "env-world" 29 ) 30 31 var _ = ginkgo.Describe("Env", ginkgo.Ordered, func() { 32 e2e.EnvInitWithNamespaceOptionContext("env init env-hello --namespace heelo", envName, "heelo") 33 e2e.EnvInitWithNamespaceOptionContext("env init another one --namespace heelo2", envName2, "heelo2") 34 e2e.EnvShowContext("env show", envName) 35 e2e.EnvSetContext("env set", envName) 36 37 ginkgo.Context("env list", func() { 38 ginkgo.It("should list all envs", func() { 39 output, err := e2e.Exec("vela env ls") 40 gomega.Expect(err).NotTo(gomega.HaveOccurred()) 41 gomega.Expect(output).To(gomega.ContainSubstring("NAME")) 42 gomega.Expect(output).To(gomega.ContainSubstring("NAMESPACE")) 43 gomega.Expect(output).To(gomega.ContainSubstring(envName)) 44 gomega.Expect(output).To(gomega.ContainSubstring(envName2)) 45 }) 46 }) 47 48 e2e.EnvDeleteContext("env delete", envName2) 49 })