Chromium Code Reviews| Index: golden/go/expstorage/expstorage_test.go |
| diff --git a/golden/go/expstorage/expstorage_test.go b/golden/go/expstorage/expstorage_test.go |
| index d67766f3a4dbc0343dd706041e5ed55aba13c807..18cfb77be04d3dbf4d682074637dc957b58dc03e 100644 |
| --- a/golden/go/expstorage/expstorage_test.go |
| +++ b/golden/go/expstorage/expstorage_test.go |
| @@ -14,41 +14,12 @@ import ( |
| "skia.googlesource.com/buildbot.git/golden/go/types" |
| ) |
| -func TestExpectationStores(t *testing.T) { |
| - // Test the memory store. |
| - memStore := NewMemExpectationsStore() |
| - testExpectationStore(t, memStore) |
| - |
| - // Initialize the DB to use a local SQLite instances. |
| - vdb := database.NewVersionedDB(&database.DatabaseConfig{ |
| - SQLiteFilePath: "correctness.db", |
| - MigrationSteps: db.MigrationSteps(), |
| - }) |
| - sqlStore := NewSQLExpectationStore(vdb) |
| - testExpectationStore(t, sqlStore) |
| -} |
| +func TestMySQLExpectationsStore(t *testing.T) { |
| + // Set up the test database. |
| + testDb := testutil.SetupMySQLTestDatabase(t, db.MigrationSteps()) |
| + defer testDb.Close() |
| -func TestMySQLExpecatationsStore(t *testing.T) { |
| - // Set up the database and make sure it's at the right version. |
| - conf := &database.DatabaseConfig{ |
| - MySQLString: testutil.GetTestMySQLConnStr(t, "root", "correctness"), |
| - MigrationSteps: db.MigrationSteps(), |
| - } |
| - |
| - // Lock to serialize DB tests |
| - lockVdb := testutil.GetMySQlLock(t, conf) |
| - defer func() { |
| - testutil.ReleaseMySQLLock(t, lockVdb) |
| - lockVdb.Close() |
| - }() |
| - |
| - rootVdb := database.NewVersionedDB(conf) |
| - rootVdb.Migrate(rootVdb.MaxDBVersion()) |
| - defer func() { |
| - rootVdb.Migrate(0) |
| - }() |
| - |
| - conf.MySQLString = testutil.GetTestMySQLConnStr(t, "readwrite", "correctness") |
| + conf := testutil.LocalTestDatabaseConfig(db.MigrationSteps()) |
| vdb := database.NewVersionedDB(conf) |
|
jcgregorio
2014/12/19 20:27:06
Why not make MySQLTestDatabase rootVdb public and
borenet
2014/12/19 20:39:15
That would work, but the test would be running as
|
| // Test the MySQL backed store |