pv controller test: use sub tests
This makes it possible to run individual tests.
This commit is contained in:
@@ -273,9 +273,7 @@ func TestControllerSync(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
klog.V(4).Infof("starting test %q", test.name)
|
||||
|
||||
doit := func(test controllerTest) {
|
||||
// Initialize the controller
|
||||
client := &fake.Clientset{}
|
||||
|
||||
@@ -353,6 +351,13 @@ func TestControllerSync(t *testing.T) {
|
||||
|
||||
evaluateTestResults(ctrl, reactor.VolumeReactor, test, t)
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
doit(test)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func storeVersion(t *testing.T, prefix string, c cache.Store, version string, expectedReturn bool) {
|
||||
|
Reference in New Issue
Block a user