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

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

Issue 813443002: Overhaul database package (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Assume the MySQL password is "" when running locally Created 5 years, 11 months 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
« no previous file with comments | « golden/go/db/db_test.go ('k') | golden/go/skiacorrectness/main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
// Test the MySQL backed store
« no previous file with comments | « golden/go/db/db_test.go ('k') | golden/go/skiacorrectness/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698