storage/kubernetes: run transactional conformance tests

This commit is contained in:
Eric Chiang
2016-10-26 13:08:03 -07:00
parent 5720ecf412
commit 4ab78d0ded
2 changed files with 35 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
package kubernetes
import (
"fmt"
"os"
"testing"
@@ -78,7 +79,7 @@ func TestURLFor(t *testing.T) {
func TestStorage(t *testing.T) {
client := loadClient(t)
conformance.RunTests(t, func() storage.Storage {
newStorage := func() storage.Storage {
for _, resource := range []string{
resourceAuthCode,
resourceAuthRequest,
@@ -88,9 +89,14 @@ func TestStorage(t *testing.T) {
resourcePassword,
} {
if err := client.deleteAll(resource); err != nil {
// Fatalf sometimes doesn't print the error message.
fmt.Fprintf(os.Stderr, "delete all %q failed: %v\n", resource, err)
t.Fatalf("delete all %q failed: %v", resource, err)
}
}
return client
})
}
conformance.RunTests(t, newStorage)
conformance.RunTransactionTests(t, newStorage)
}