Add integration and e2e framework

This commit is contained in:
RainbowMango 2020-12-01 10:39:10 +08:00 committed by Kevin Wang
parent 160e961307
commit e49f9d6ea7
3 changed files with 67 additions and 0 deletions

29
test/e2e/suite_test.go Normal file
View File

@ -0,0 +1,29 @@
package e2e
import (
"testing"
"time"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
)
const (
// TestSuiteSetupTimeOut defines the time after which the suite setup times out.
TestSuiteSetupTimeOut = 300 * time.Second
// TestSuiteTeardownTimeOut defines the time after which the suite tear down times out.
TestSuiteTeardownTimeOut = 300 * time.Second
)
func TestE2E(t *testing.T) {
gomega.RegisterFailHandler(ginkgo.Fail)
ginkgo.RunSpecs(t, "E2E Suite")
}
var _ = ginkgo.BeforeSuite(func() {
// suite set up, such as get karmada environment ready.
}, TestSuiteSetupTimeOut.Seconds())
var _ = ginkgo.AfterSuite(func() {
// suite tear down, such as cleanup karmada environment.
}, TestSuiteTeardownTimeOut.Seconds())

View File

@ -0,0 +1,29 @@
package integration
import (
"testing"
"time"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
)
const (
// TestSuiteSetupTimeOut defines the time after which the suite setup times out.
TestSuiteSetupTimeOut = 300 * time.Second
// TestSuiteTeardownTimeOut defines the time after which the suite tear down times out.
TestSuiteTeardownTimeOut = 300 * time.Second
)
func TestIntegration(t *testing.T) {
gomega.RegisterFailHandler(ginkgo.Fail)
ginkgo.RunSpecs(t, "Integration Suite")
}
var _ = ginkgo.BeforeSuite(func() {
// suite set up, such as get karmada environment ready.
}, TestSuiteSetupTimeOut.Seconds())
var _ = ginkgo.AfterSuite(func() {
// suite tear down, such as cleanup karmada environment.
}, TestSuiteTeardownTimeOut.Seconds())

View File

@ -0,0 +1,9 @@
package integration
import "github.com/onsi/ginkgo"
var _ = ginkgo.Describe("Work", func() {
ginkgo.BeforeEach(func() {
// prepare work, such as initialize objects used by this test.
})
})