Skip to content

Commit

Permalink
test: e2e test on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-hm19 committed Jun 28, 2024
1 parent 339424d commit 76d915d
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package e2e
import (
"fmt"
"path/filepath"
"runtime"
"testing"

"github.com/onsi/ginkgo/v2"
Expand All @@ -16,12 +17,14 @@ func TestE2e(t *testing.T) {

// BeforeSuite Create kubernetes
var _ = ginkgo.BeforeSuite(func() {
ginkgo.By("create k3s cluster", func() {
cli := "k3d cluster create kusion-e2e"
output, err := Exec(cli)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("successfully"))
})
if runtime.GOOS != "windows" {
ginkgo.By("create k3s cluster", func() {
cli := "k3d cluster create kusion-e2e"
output, err := Exec(cli)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("successfully"))
})
}

ginkgo.By("git clone konfig", func() {
output, err := ExecWithWorkDir("git clone https://github.com/KusionStack/konfig.git", GetWorkDir())
Expand All @@ -38,12 +41,14 @@ var _ = ginkgo.BeforeSuite(func() {

// AfterSuite clean kubernetes
var _ = ginkgo.AfterSuite(func() {
ginkgo.By("clean up k3s cluster", func() {
cli := "k3d cluster delete kusion-e2e"
output, err := Exec(cli)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("Successfully"))
})
if runtime.GOOS != "windows" {
ginkgo.By("clean up k3s cluster", func() {
cli := "k3d cluster delete kusion-e2e"
output, err := Exec(cli)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("Successfully"))
})
}

ginkgo.By("clean up konfig", func() {
path := filepath.Join(GetWorkDir(), "konfig")
Expand Down

0 comments on commit 76d915d

Please sign in to comment.