This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
/
tests_suite_test.go
45 lines (38 loc) · 1.26 KB
/
tests_suite_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package tests_test
import (
"testing"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
tests "kubevirt.io/kubevirt-ansible/tests/framework"
ktests "kubevirt.io/kubevirt/tests"
"kubevirt.io/qe-tools/pkg/ginkgo-reporters"
)
func CustomFailHandler(message string, callerSkip ...int) {
tests.CollectObjDescUsingTestDesc(CurrentGinkgoTestDescription())
ktests.KubevirtFailHandler(message, callerSkip...)
}
func TestTests(t *testing.T) {
RegisterFailHandler(CustomFailHandler)
reporters := make([]Reporter, 0)
if ginkgo_reporters.Polarion.Run {
reporters = append(reporters, &ginkgo_reporters.Polarion)
}
if ginkgo_reporters.JunitOutput != "" {
reporters = append(reporters, ginkgo_reporters.NewJunitReporter())
}
RunSpecsWithDefaultAndCustomReporters(t, "Tests Suite", reporters)
}
var _ = BeforeSuite(func() {
testNamespaces := []string{ktests.NamespaceTestDefault, ktests.NamespaceTestAlternative}
for _, v := range testNamespaces {
err := tests.CreateNamespaceWithParameter(v)
Expect(err).ToNot(HaveOccurred())
}
})
var _ = AfterSuite(func() {
testNamespaces := []string{ktests.NamespaceTestDefault, ktests.NamespaceTestAlternative}
for _, v := range testNamespaces {
err := tests.RemoveNamespaceWithParameter(v)
Expect(err).ToNot(HaveOccurred())
}
})