-
Notifications
You must be signed in to change notification settings - Fork 28
/
spoke_suite_test.go
52 lines (40 loc) · 1.33 KB
/
spoke_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
46
47
48
49
50
51
52
package spoke_test
import (
"testing"
"runtime"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/openshift-kni/eco-goinfra/pkg/reportxml"
. "github.com/openshift-kni/eco-gotests/tests/assisted/ztp/internal/ztpinittools"
"github.com/openshift-kni/eco-gotests/tests/assisted/ztp/spoke/internal/tsparams"
_ "github.com/openshift-kni/eco-gotests/tests/assisted/ztp/spoke/tests"
"github.com/openshift-kni/eco-gotests/tests/internal/reporter"
)
var _, currentFile, _, _ = runtime.Caller(0)
func TestSpoke(t *testing.T) {
_, reporterConfig := GinkgoConfiguration()
reporterConfig.JUnitReport = ZTPConfig.GetJunitReportPath(currentFile)
RegisterFailHandler(Fail)
RunSpecs(t, "Spoke Suite", Label(tsparams.Labels...), reporterConfig)
}
var _ = BeforeSuite(func() {
By("Check if hub has valid apiClient")
if HubAPIClient == nil {
Skip("Cannot run spoke suite when hub has nil api client")
}
By("Check if spoke has valid apiClient")
if SpokeAPIClient == nil {
Skip("Cannot run spoke suite when spoke has nil api client")
}
})
var _ = ReportAfterSuite("", func(report Report) {
reportxml.Create(
report, ZTPConfig.GetReportPath(), ZTPConfig.TCPrefix)
})
var _ = JustAfterEach(func() {
reporter.ReportIfFailed(
CurrentSpecReport(),
currentFile,
tsparams.ReporterNamespacesToDump,
tsparams.ReporterCRDsToDump)
})