aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/suite_veth_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'extras/hs-test/suite_veth_test.go')
-rw-r--r--extras/hs-test/suite_veth_test.go48
1 files changed, 26 insertions, 22 deletions
diff --git a/extras/hs-test/suite_veth_test.go b/extras/hs-test/suite_veth_test.go
index 13ef5ef268d..49a36cacb83 100644
--- a/extras/hs-test/suite_veth_test.go
+++ b/extras/hs-test/suite_veth_test.go
@@ -16,18 +16,18 @@ const (
clientInterfaceName = "cln"
)
-var vethTests = []func(s *VethsSuite){}
-var vethSoloTests = []func(s *VethsSuite){}
+var vethTests = map[string][]func(s *VethsSuite){}
+var vethSoloTests = map[string][]func(s *VethsSuite){}
type VethsSuite struct {
HstSuite
}
func registerVethTests(tests ...func(s *VethsSuite)) {
- vethTests = append(vethTests, tests...)
+ vethTests[getTestFilename()] = tests
}
func registerSoloVethTests(tests ...func(s *VethsSuite)) {
- vethSoloTests = append(vethSoloTests, tests...)
+ vethSoloTests[getTestFilename()] = tests
}
func (s *VethsSuite) SetupSuite() {
@@ -101,15 +101,17 @@ var _ = Describe("VethsSuite", Ordered, ContinueOnFailure, func() {
})
// https://onsi.github.io/ginkgo/#dynamically-generating-specs
- for _, test := range vethTests {
- test := test
- pc := reflect.ValueOf(test).Pointer()
- funcValue := runtime.FuncForPC(pc)
- testName := strings.Split(funcValue.Name(), ".")[2]
- It(testName, func(ctx SpecContext) {
- s.log(testName + ": BEGIN")
- test(&s)
- }, SpecTimeout(suiteTimeout))
+ for filename, tests := range vethTests {
+ for _, test := range tests {
+ test := test
+ pc := reflect.ValueOf(test).Pointer()
+ funcValue := runtime.FuncForPC(pc)
+ testName := filename + "/" + strings.Split(funcValue.Name(), ".")[2]
+ It(testName, func(ctx SpecContext) {
+ s.log(testName + ": BEGIN")
+ test(&s)
+ }, SpecTimeout(suiteTimeout))
+ }
}
})
@@ -129,14 +131,16 @@ var _ = Describe("VethsSuiteSolo", Ordered, ContinueOnFailure, Serial, func() {
})
// https://onsi.github.io/ginkgo/#dynamically-generating-specs
- for _, test := range vethSoloTests {
- test := test
- pc := reflect.ValueOf(test).Pointer()
- funcValue := runtime.FuncForPC(pc)
- testName := strings.Split(funcValue.Name(), ".")[2]
- It(testName, Label("SOLO"), func(ctx SpecContext) {
- s.log(testName + ": BEGIN")
- test(&s)
- }, SpecTimeout(suiteTimeout))
+ for filename, tests := range vethSoloTests {
+ for _, test := range tests {
+ test := test
+ pc := reflect.ValueOf(test).Pointer()
+ funcValue := runtime.FuncForPC(pc)
+ testName := filename + "/" + strings.Split(funcValue.Name(), ".")[2]
+ It(testName, Label("SOLO"), func(ctx SpecContext) {
+ s.log(testName + ": BEGIN")
+ test(&s)
+ }, SpecTimeout(suiteTimeout))
+ }
}
})