Our test helper packages were not possible to use with benchmarks. This refactor switches to testing.TB to allow both tests and benchmarks to use the helpers.
19 lines
510 B
Go
19 lines
510 B
Go
package vault
|
|
|
|
import "testing"
|
|
|
|
var (
|
|
newVaultServer func(t testing.TB, opt ...TestOption) *TestVaultServer = skipNewServer
|
|
mountDatabase func(t testing.TB, v *TestVaultServer, opt ...TestOption) *TestDatabase = skipMountDatabase
|
|
)
|
|
|
|
func skipNewServer(t testing.TB, opt ...TestOption) *TestVaultServer {
|
|
t.Skip("docker not available")
|
|
return nil
|
|
}
|
|
|
|
func skipMountDatabase(t testing.TB, v *TestVaultServer, opt ...TestOption) *TestDatabase {
|
|
t.Skip("docker not available")
|
|
return nil
|
|
}
|