This commit is contained in:
Andy Arthur
2022-06-29 16:59:41 -07:00
parent c7f8f84ded
commit e9aa3a1b3a
2 changed files with 5 additions and 8 deletions

View File

@@ -36,14 +36,14 @@ const (
// function should generally be preferred over this method, especially when working
// with tests using multiple databases within a MultiRepoEnv.
func CreateTestEnv() *env.DoltEnv {
return CreateTestEnvWithNameAndNbf("test", types.Format_Default)
return CreateTestEnvWithName("test")
}
// CreateTestEnvWithNameAndNbf creates a new DoltEnv suitable for testing and uses
// CreateTestEnvWithName creates a new DoltEnv suitable for testing and uses
// the specified name to distinguish it from other test envs. This function
// should generally be preferred over CreateTestEnv, especially when working with
// tests using multiple databases within a MultiRepoEnv.
func CreateTestEnvWithNameAndNbf(envName string, nbf *types.NomsBinFormat) *env.DoltEnv {
func CreateTestEnvWithName(envName string) *env.DoltEnv {
const name = "billy bob"
const email = "bigbillieb@fake.horse"
initialDirs := []string{TestHomeDirPrefix + envName, WorkingDirPrefix + envName}
@@ -55,7 +55,7 @@ func CreateTestEnvWithNameAndNbf(envName string, nbf *types.NomsBinFormat) *env.
env.UserNameKey: name,
env.UserEmailKey: email,
})
err := dEnv.InitRepo(context.Background(), nbf, name, email, env.DefaultInitBranch)
err := dEnv.InitRepo(context.Background(), types.Format_Default, name, email, env.DefaultInitBranch)
if err != nil {
panic("Failed to initialize environment:" + err.Error())

View File

@@ -16,19 +16,16 @@ import (
"github.com/dolthub/dolt/go/cmd/dolt/commands/engine"
"github.com/dolthub/dolt/go/libraries/doltcore/dtestutils"
"github.com/dolthub/dolt/go/libraries/doltcore/env"
"github.com/dolthub/dolt/go/store/types"
)
const (
tableSize = 10_000
dbName = "sysbench"
)
var dEnv *env.DoltEnv
func init() {
nbf := types.Format_Default
dEnv = dtestutils.CreateTestEnvWithNameAndNbf(dbName, nbf)
dEnv = dtestutils.CreateTestEnv()
populateRepo(dEnv)
}