From 6e1b183f798be6718db09ba8a269ca5c6b5340ed Mon Sep 17 00:00:00 2001 From: swayne275 Date: Fri, 12 Feb 2021 13:04:48 -0700 Subject: [PATCH] Shutdown Test Cores when Tests Complete (#10912) * Shutdown Test Cores when Tests Complete * go mod vendor --- command/command_test.go | 7 +- go.mod | 2 +- go.sum | 2 + http/logical_test.go | 22 ++-- .../consul_service_registration_test.go | 1 + vault/audit_test.go | 3 + vault/auth_test.go | 3 + vault/cluster_test.go | 1 + vault/core_test.go | 11 ++ vault/init_test.go | 9 ++ vault/mount_test.go | 4 + vault/rekey_test.go | 2 + vault/testing.go | 26 +++++ .../hashicorp/vault/sdk/framework/openapi.go | 3 + .../mitchellh/go-testing-interface/README.md | 8 ++ .../mitchellh/go-testing-interface/go.mod | 2 + .../mitchellh/go-testing-interface/testing.go | 65 +++++++---- .../go-testing-interface/testing_go19.go | 108 ------------------ vendor/modules.txt | 2 +- 19 files changed, 139 insertions(+), 142 deletions(-) delete mode 100644 vendor/github.com/mitchellh/go-testing-interface/testing_go19.go diff --git a/command/command_test.go b/command/command_test.go index 32426fd83..8de036e40 100644 --- a/command/command_test.go +++ b/command/command_test.go @@ -181,7 +181,12 @@ func testVaultServerUninit(tb testing.TB) (*api.Client, func()) { tb.Fatal(err) } - return client, func() { ln.Close() } + closer := func() { + core.Shutdown() + ln.Close() + } + + return client, closer } // testVaultServerBad creates an http server that returns a 500 on each request diff --git a/go.mod b/go.mod index 04a2e350a..44b58446f 100644 --- a/go.mod +++ b/go.mod @@ -113,7 +113,7 @@ require ( github.com/mitchellh/cli v1.1.1 github.com/mitchellh/copystructure v1.0.0 github.com/mitchellh/go-homedir v1.1.0 - github.com/mitchellh/go-testing-interface v1.0.0 + github.com/mitchellh/go-testing-interface v1.14.0 github.com/mitchellh/gox v1.0.1 github.com/mitchellh/mapstructure v1.3.3 github.com/mitchellh/reflectwalk v1.0.1 diff --git a/go.sum b/go.sum index 9e76a9609..063d48f50 100644 --- a/go.sum +++ b/go.sum @@ -834,6 +834,8 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.0 h1:/x0XQ6h+3U3nAyk1yx+bHPURrKa9sVVvYbuqZ7pIAtI= +github.com/mitchellh/go-testing-interface v1.14.0/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI= diff --git a/http/logical_test.go b/http/logical_test.go index b6c733e03..ce6d32bf4 100644 --- a/http/logical_test.go +++ b/http/logical_test.go @@ -4,12 +4,6 @@ import ( "bytes" "context" "encoding/json" - "github.com/hashicorp/vault/internalshared/configutil" - "github.com/hashicorp/vault/sdk/helper/consts" - "github.com/hashicorp/vault/sdk/helper/logging" - "github.com/hashicorp/vault/sdk/logical" - "github.com/hashicorp/vault/sdk/physical" - "github.com/hashicorp/vault/sdk/physical/inmem" "io" "io/ioutil" "net/http" @@ -20,6 +14,13 @@ import ( "testing" "time" + "github.com/hashicorp/vault/internalshared/configutil" + "github.com/hashicorp/vault/sdk/helper/consts" + "github.com/hashicorp/vault/sdk/helper/logging" + "github.com/hashicorp/vault/sdk/logical" + "github.com/hashicorp/vault/sdk/physical" + "github.com/hashicorp/vault/sdk/physical/inmem" + "github.com/go-test/deep" log "github.com/hashicorp/go-hclog" @@ -107,6 +108,7 @@ func TestLogical_StandbyRedirect(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer core1.Shutdown() keys, root := vault.TestCoreInit(t, core1) for _, key := range keys { if _, err := core1.Unseal(vault.TestKeyCopy(key)); err != nil { @@ -129,6 +131,7 @@ func TestLogical_StandbyRedirect(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer core2.Shutdown() for _, key := range keys { if _, err := core2.Unseal(vault.TestKeyCopy(key)); err != nil { t.Fatalf("unseal err: %s", err) @@ -283,8 +286,8 @@ func TestLogical_RequestSizeDisableLimit(t *testing.T) { Core: core, ListenerConfig: &configutil.Listener{ MaxRequestSize: -1, - Address: "127.0.0.1", - TLSDisable: true, + Address: "127.0.0.1", + TLSDisable: true, }, } TestServerWithListenerAndProperties(t, ln, addr, core, props) @@ -297,10 +300,9 @@ func TestLogical_RequestSizeDisableLimit(t *testing.T) { resp := testHttpPut(t, token, addr+"/v1/secret/foo", map[string]interface{}{ "data": make([]byte, DefaultMaxRequestSize), }) - testResponseStatus(t, resp,http.StatusNoContent) + testResponseStatus(t, resp, http.StatusNoContent) } - func TestLogical_ListSuffix(t *testing.T) { core, _, rootToken := vault.TestCoreUnsealed(t) req, _ := http.NewRequest("GET", "http://127.0.0.1:8200/v1/secret/foo", nil) diff --git a/serviceregistration/consul/consul_service_registration_test.go b/serviceregistration/consul/consul_service_registration_test.go index cc3181038..5f065818b 100644 --- a/serviceregistration/consul/consul_service_registration_test.go +++ b/serviceregistration/consul/consul_service_registration_test.go @@ -118,6 +118,7 @@ func TestConsul_ServiceRegistration(t *testing.T) { if err != nil { t.Fatal(err) } + defer core.Shutdown() waitForServices(t, map[string][]string{ "consul": []string{}, diff --git a/vault/audit_test.go b/vault/audit_test.go index c0d1f4149..9287a3428 100644 --- a/vault/audit_test.go +++ b/vault/audit_test.go @@ -81,6 +81,7 @@ func TestCore_EnableAudit(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer c2.Shutdown() for i, key := range keys { unseal, err := TestCoreUnseal(c2, key) if err != nil { @@ -288,6 +289,7 @@ func TestCore_DisableAudit(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer c2.Shutdown() for i, key := range keys { unseal, err := TestCoreUnseal(c2, key) if err != nil { @@ -322,6 +324,7 @@ func TestCore_DefaultAuditTable(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer c2.Shutdown() for i, key := range keys { unseal, err := TestCoreUnseal(c2, key) if err != nil { diff --git a/vault/auth_test.go b/vault/auth_test.go index 78629633c..28b69057e 100644 --- a/vault/auth_test.go +++ b/vault/auth_test.go @@ -124,6 +124,7 @@ func TestCore_DefaultAuthTable(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer c2.Shutdown() for i, key := range keys { unseal, err := TestCoreUnseal(c2, key) if err != nil { @@ -175,6 +176,7 @@ func TestCore_EnableCredential(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer c2.Shutdown() c2.credentialBackends["noop"] = func(context.Context, *logical.BackendConfig) (logical.Backend, error) { return &NoopBackend{ BackendType: logical.TypeCredential, @@ -376,6 +378,7 @@ func TestCore_DisableCredential(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer c2.Shutdown() for i, key := range keys { unseal, err := TestCoreUnseal(c2, key) if err != nil { diff --git a/vault/cluster_test.go b/vault/cluster_test.go index 8d298e6ac..e4cea0b90 100644 --- a/vault/cluster_test.go +++ b/vault/cluster_test.go @@ -62,6 +62,7 @@ func TestClusterHAFetching(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer c.Shutdown() keys, _ := TestCoreInit(t, c) for _, key := range keys { if _, err := TestCoreUnseal(c, TestKeyCopy(key)); err != nil { diff --git a/vault/core_test.go b/vault/core_test.go index 5867522a2..7b05a3356 100644 --- a/vault/core_test.go +++ b/vault/core_test.go @@ -1161,6 +1161,7 @@ func TestCore_Standby_Seal(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer core.Shutdown() keys, root := TestCoreInit(t, core) for _, key := range keys { if _, err := TestCoreUnseal(core, TestKeyCopy(key)); err != nil { @@ -1199,6 +1200,7 @@ func TestCore_Standby_Seal(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer core2.Shutdown() for _, key := range keys { if _, err := TestCoreUnseal(core2, TestKeyCopy(key)); err != nil { t.Fatalf("unseal err: %s", err) @@ -1272,6 +1274,7 @@ func TestCore_StepDown(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer core.Shutdown() keys, root := TestCoreInit(t, core) for _, key := range keys { if _, err := TestCoreUnseal(core, TestKeyCopy(key)); err != nil { @@ -1308,6 +1311,7 @@ func TestCore_StepDown(t *testing.T) { DisableMlock: true, Logger: logger.Named("core2"), }) + defer core2.Shutdown() if err != nil { t.Fatalf("err: %v", err) } @@ -1463,6 +1467,7 @@ func TestCore_CleanLeaderPrefix(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer core.Shutdown() keys, root := TestCoreInit(t, core) for _, key := range keys { if _, err := TestCoreUnseal(core, TestKeyCopy(key)); err != nil { @@ -1528,6 +1533,7 @@ func TestCore_CleanLeaderPrefix(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer core2.Shutdown() for _, key := range keys { if _, err := TestCoreUnseal(core2, TestKeyCopy(key)); err != nil { t.Fatalf("unseal err: %s", err) @@ -1640,6 +1646,7 @@ func testCore_Standby_Common(t *testing.T, inm physical.Backend, inmha physical. if err != nil { t.Fatalf("err: %v", err) } + defer core.Shutdown() keys, root := TestCoreInit(t, core) for _, key := range keys { if _, err := TestCoreUnseal(core, TestKeyCopy(key)); err != nil { @@ -1694,6 +1701,7 @@ func testCore_Standby_Common(t *testing.T, inm physical.Backend, inmha physical. if err != nil { t.Fatalf("err: %v", err) } + defer core2.Shutdown() for _, key := range keys { if _, err := TestCoreUnseal(core2, TestKeyCopy(key)); err != nil { t.Fatalf("unseal err: %s", err) @@ -2214,6 +2222,7 @@ func TestCore_Standby_Rotate(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer core.Shutdown() keys, root := TestCoreInit(t, core) for _, key := range keys { if _, err := TestCoreUnseal(core, TestKeyCopy(key)); err != nil { @@ -2235,6 +2244,7 @@ func TestCore_Standby_Rotate(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer core2.Shutdown() for _, key := range keys { if _, err := TestCoreUnseal(core2, TestKeyCopy(key)); err != nil { t.Fatalf("unseal err: %s", err) @@ -2530,6 +2540,7 @@ func TestCore_ServiceRegistration(t *testing.T) { if err != nil { t.Fatal(err) } + defer core.Shutdown() // Vault should not yet be registered if diff := deep.Equal(sr, &mockServiceRegistration{}); diff != nil { diff --git a/vault/init_test.go b/vault/init_test.go index cb2ebe9a7..99a9fc57c 100644 --- a/vault/init_test.go +++ b/vault/init_test.go @@ -41,6 +41,15 @@ func testCore_NewTestCoreLicensing(t *testing.T, seal Seal, licensingConfig *Lic if err != nil { t.Fatalf("err: %v", err) } + + t.Cleanup(func() { + defer func() { + if r := recover(); r != nil { + t.Log("panic closing core during cleanup", "panic", r) + } + }() + c.Shutdown() + }) return c, conf } diff --git a/vault/mount_test.go b/vault/mount_test.go index b1193de64..f35069529 100644 --- a/vault/mount_test.go +++ b/vault/mount_test.go @@ -126,6 +126,7 @@ func TestCore_DefaultMountTable(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer c2.Shutdown() for i, key := range keys { unseal, err := TestCoreUnseal(c2, key) if err != nil { @@ -170,6 +171,7 @@ func TestCore_Mount(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer c2.Shutdown() for i, key := range keys { unseal, err := TestCoreUnseal(c2, key) if err != nil { @@ -312,6 +314,7 @@ func TestCore_Unmount(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer c2.Shutdown() for i, key := range keys { unseal, err := TestCoreUnseal(c2, key) if err != nil { @@ -539,6 +542,7 @@ func TestCore_Remount(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer c2.Shutdown() for i, key := range keys { unseal, err := TestCoreUnseal(c2, key) if err != nil { diff --git a/vault/rekey_test.go b/vault/rekey_test.go index e5661cbe7..4e84e7f83 100644 --- a/vault/rekey_test.go +++ b/vault/rekey_test.go @@ -415,6 +415,7 @@ func TestCore_Rekey_Standby(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer core.Shutdown() keys, root := TestCoreInit(t, core) for _, key := range keys { if _, err := TestCoreUnseal(core, TestKeyCopy(key)); err != nil { @@ -437,6 +438,7 @@ func TestCore_Rekey_Standby(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + defer core2.Shutdown() for _, key := range keys { if _, err := TestCoreUnseal(core2, TestKeyCopy(key)); err != nil { t.Fatalf("unseal err: %s", err) diff --git a/vault/testing.go b/vault/testing.go index 23e1f4271..51f87dceb 100644 --- a/vault/testing.go +++ b/vault/testing.go @@ -178,6 +178,15 @@ func TestCoreWithSealAndUI(t testing.T, opts *CoreConfig) *Core { t.Fatalf("err: %s", err) } + t.Cleanup(func() { + defer func() { + if r := recover(); r != nil { + t.Log("panic closing core during cleanup", "panic", r) + } + }() + c.Shutdown() + }) + return c } @@ -346,6 +355,14 @@ func testCoreUnsealed(t testing.T, core *Core) (*Core, [][]byte, string) { testCoreAddSecretMount(t, core, token) + t.Cleanup(func() { + defer func() { + if r := recover(); r != nil { + t.Log("panic closing core during cleanup", "panic", r) + } + }() + core.Shutdown() + }) return core, keys, token } @@ -399,6 +416,15 @@ func TestCoreUnsealedBackend(t testing.T, backend physical.Backend) (*Core, [][] t.Fatal("should not be sealed") } + t.Cleanup(func() { + defer func() { + if r := recover(); r != nil { + t.Log("panic closing core during cleanup", "panic", r) + } + }() + core.Shutdown() + }) + return core, keys, token } diff --git a/vendor/github.com/hashicorp/vault/sdk/framework/openapi.go b/vendor/github.com/hashicorp/vault/sdk/framework/openapi.go index d723d38f9..282d06d59 100644 --- a/vendor/github.com/hashicorp/vault/sdk/framework/openapi.go +++ b/vendor/github.com/hashicorp/vault/sdk/framework/openapi.go @@ -575,6 +575,9 @@ func convertType(t FieldType) schemaType { case TypeTime: ret.baseType = "string" ret.format = "date-time" + case TypeFloat: + ret.baseType = "number" + ret.format = "float" default: log.L().Warn("error parsing field type", "type", t) ret.format = "unknown" diff --git a/vendor/github.com/mitchellh/go-testing-interface/README.md b/vendor/github.com/mitchellh/go-testing-interface/README.md index 26781bbae..ee435adc5 100644 --- a/vendor/github.com/mitchellh/go-testing-interface/README.md +++ b/vendor/github.com/mitchellh/go-testing-interface/README.md @@ -38,6 +38,14 @@ You can also call the test helper at runtime if needed: TestHelper(&testing.RuntimeT{}) } +## Versioning + +The tagged version matches the version of Go that the interface is +compatible with. For example, the version "1.14.0" is for Go 1.14 and +introduced the `Cleanup` function. The patch version (the ".0" in the +prior example) is used to fix any bugs found in this library and has no +correlation to the supported Go version. + ## Why?! **Why would I call a test helper that takes a *testing.T at runtime?** diff --git a/vendor/github.com/mitchellh/go-testing-interface/go.mod b/vendor/github.com/mitchellh/go-testing-interface/go.mod index 062796de7..acc65c4e5 100644 --- a/vendor/github.com/mitchellh/go-testing-interface/go.mod +++ b/vendor/github.com/mitchellh/go-testing-interface/go.mod @@ -1 +1,3 @@ module github.com/mitchellh/go-testing-interface + +go 1.14 diff --git a/vendor/github.com/mitchellh/go-testing-interface/testing.go b/vendor/github.com/mitchellh/go-testing-interface/testing.go index 204afb420..f7090934b 100644 --- a/vendor/github.com/mitchellh/go-testing-interface/testing.go +++ b/vendor/github.com/mitchellh/go-testing-interface/testing.go @@ -1,5 +1,3 @@ -// +build !go1.9 - package testing import ( @@ -12,6 +10,7 @@ import ( // In unit tests you can just pass a *testing.T struct. At runtime, outside // of tests, you can pass in a RuntimeT struct from this package. type T interface { + Cleanup(func()) Error(args ...interface{}) Errorf(format string, args ...interface{}) Fail() @@ -19,6 +18,7 @@ type T interface { Failed() bool Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) + Helper() Log(args ...interface{}) Logf(format string, args ...interface{}) Name() string @@ -31,10 +31,13 @@ type T interface { // RuntimeT implements T and can be instantiated and run at runtime to // mimic *testing.T behavior. Unlike *testing.T, this will simply panic // for calls to Fatal. For calls to Error, you'll have to check the errors -// list to determine whether to exit yourself. Name and Skip methods are -// unimplemented noops. +// list to determine whether to exit yourself. +// +// Cleanup does NOT work, so if you're using a helper that uses Cleanup, +// there may be dangling resources. type RuntimeT struct { - failed bool + skipped bool + failed bool } func (t *RuntimeT) Error(args ...interface{}) { @@ -43,20 +46,10 @@ func (t *RuntimeT) Error(args ...interface{}) { } func (t *RuntimeT) Errorf(format string, args ...interface{}) { - log.Println(fmt.Sprintf(format, args...)) + log.Printf(format, args...) t.Fail() } -func (t *RuntimeT) Fatal(args ...interface{}) { - log.Println(fmt.Sprintln(args...)) - t.FailNow() -} - -func (t *RuntimeT) Fatalf(format string, args ...interface{}) { - log.Println(fmt.Sprintf(format, args...)) - t.FailNow() -} - func (t *RuntimeT) Fail() { t.failed = true } @@ -69,6 +62,16 @@ func (t *RuntimeT) Failed() bool { return t.failed } +func (t *RuntimeT) Fatal(args ...interface{}) { + log.Print(args...) + t.FailNow() +} + +func (t *RuntimeT) Fatalf(format string, args ...interface{}) { + log.Printf(format, args...) + t.FailNow() +} + func (t *RuntimeT) Log(args ...interface{}) { log.Println(fmt.Sprintln(args...)) } @@ -77,8 +80,28 @@ func (t *RuntimeT) Logf(format string, args ...interface{}) { log.Println(fmt.Sprintf(format, args...)) } -func (t *RuntimeT) Name() string { return "" } -func (t *RuntimeT) Skip(args ...interface{}) {} -func (t *RuntimeT) SkipNow() {} -func (t *RuntimeT) Skipf(format string, args ...interface{}) {} -func (t *RuntimeT) Skipped() bool { return false } +func (t *RuntimeT) Name() string { + return "" +} + +func (t *RuntimeT) Skip(args ...interface{}) { + log.Print(args...) + t.SkipNow() +} + +func (t *RuntimeT) SkipNow() { + t.skipped = true +} + +func (t *RuntimeT) Skipf(format string, args ...interface{}) { + log.Printf(format, args...) + t.SkipNow() +} + +func (t *RuntimeT) Skipped() bool { + return t.skipped +} + +func (t *RuntimeT) Helper() {} + +func (t *RuntimeT) Cleanup(func()) {} diff --git a/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go b/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go deleted file mode 100644 index 31b42cadf..000000000 --- a/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go +++ /dev/null @@ -1,108 +0,0 @@ -// +build go1.9 - -// NOTE: This is a temporary copy of testing.go for Go 1.9 with the addition -// of "Helper" to the T interface. Go 1.9 at the time of typing is in RC -// and is set for release shortly. We'll support this on master as the default -// as soon as 1.9 is released. - -package testing - -import ( - "fmt" - "log" -) - -// T is the interface that mimics the standard library *testing.T. -// -// In unit tests you can just pass a *testing.T struct. At runtime, outside -// of tests, you can pass in a RuntimeT struct from this package. -type T interface { - Error(args ...interface{}) - Errorf(format string, args ...interface{}) - Fail() - FailNow() - Failed() bool - Fatal(args ...interface{}) - Fatalf(format string, args ...interface{}) - Log(args ...interface{}) - Logf(format string, args ...interface{}) - Name() string - Skip(args ...interface{}) - SkipNow() - Skipf(format string, args ...interface{}) - Skipped() bool - Helper() -} - -// RuntimeT implements T and can be instantiated and run at runtime to -// mimic *testing.T behavior. Unlike *testing.T, this will simply panic -// for calls to Fatal. For calls to Error, you'll have to check the errors -// list to determine whether to exit yourself. -type RuntimeT struct { - skipped bool - failed bool -} - -func (t *RuntimeT) Error(args ...interface{}) { - log.Println(fmt.Sprintln(args...)) - t.Fail() -} - -func (t *RuntimeT) Errorf(format string, args ...interface{}) { - log.Printf(format, args...) - t.Fail() -} - -func (t *RuntimeT) Fail() { - t.failed = true -} - -func (t *RuntimeT) FailNow() { - panic("testing.T failed, see logs for output (if any)") -} - -func (t *RuntimeT) Failed() bool { - return t.failed -} - -func (t *RuntimeT) Fatal(args ...interface{}) { - log.Print(args...) - t.FailNow() -} - -func (t *RuntimeT) Fatalf(format string, args ...interface{}) { - log.Printf(format, args...) - t.FailNow() -} - -func (t *RuntimeT) Log(args ...interface{}) { - log.Println(fmt.Sprintln(args...)) -} - -func (t *RuntimeT) Logf(format string, args ...interface{}) { - log.Println(fmt.Sprintf(format, args...)) -} - -func (t *RuntimeT) Name() string { - return "" -} - -func (t *RuntimeT) Skip(args ...interface{}) { - log.Print(args...) - t.SkipNow() -} - -func (t *RuntimeT) SkipNow() { - t.skipped = true -} - -func (t *RuntimeT) Skipf(format string, args ...interface{}) { - log.Printf(format, args...) - t.SkipNow() -} - -func (t *RuntimeT) Skipped() bool { - return t.skipped -} - -func (t *RuntimeT) Helper() {} diff --git a/vendor/modules.txt b/vendor/modules.txt index 69cb6f873..5232f82fb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -779,7 +779,7 @@ github.com/mitchellh/cli github.com/mitchellh/copystructure # github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir -# github.com/mitchellh/go-testing-interface v1.0.0 +# github.com/mitchellh/go-testing-interface v1.14.0 github.com/mitchellh/go-testing-interface # github.com/mitchellh/gox v1.0.1 github.com/mitchellh/gox