Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: golden/go/expstorage/expstorage_test.go

Issue 813443002: Overhaul database package (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Add buildbot_migratedb Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..f9c59c7da64f2ccaa0a4ea504de299d6266f0bfc 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 := database.LocalTestDatabaseConfig(db.MigrationSteps())
vdb := database.NewVersionedDB(conf)
// Test the MySQL backed store

Powered by Google App Engine
This is Rietveld 408576698