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

Unified Diff: golden/go/skiacorrectness/main.go

Issue 813443002: Overhaul database package (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Comments/readme cleanup 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/skiacorrectness/main.go
diff --git a/golden/go/skiacorrectness/main.go b/golden/go/skiacorrectness/main.go
index c1493e42438caec81896ca5519854c8422cbad1f..812adce329c4776ea4a8c8a64cc8a8dcc80df33d 100644
--- a/golden/go/skiacorrectness/main.go
+++ b/golden/go/skiacorrectness/main.go
@@ -35,8 +35,7 @@ var (
tileStoreDir = flag.String("tile_store_dir", "/tmp/tileStore", "What directory to look for tiles in.")
imageDir = flag.String("image_dir", "/tmp/imagedir", "What directory to store test and diff images in.")
gsBucketName = flag.String("gs_bucket", "chromium-skia-gm", "Name of the google storage bucket that holds uploaded images.")
- dbConnStr = flag.String("db_conn_string", defaultDbConnStr, "MySQL connection string for backend database. If 'local' is false the password in this string will be substituted via the metadata server.")
- sqlitePath = flag.String("sqlite_path", "./golden.db", "Filepath of the embedded SQLite database. Requires 'local' to be set to true and 'mysql_conn' to be empty to take effect.")
+ dbConnStr = flag.String("db_conn_string", "", fmt.Sprintf("MySQL connection string for backend database. If not provided, a default local MySQL database will be used if 'local' is true, otherwise the production database is used (requires access to metadata server). If db_conn_string contains '%%s', will prompt for password. Eg. %s", defaultDbConnStr))
doOauth = flag.Bool("oauth", true, "Run through the OAuth 2.0 flow on startup, otherwise use a GCE service account.")
oauthCacheFile = flag.String("oauth_cache_file", "/home/perf/google_storage_token.data", "Path to the file where to cache cache the oauth credentials.")
)
@@ -240,7 +239,11 @@ func main() {
// Get the expecations storage, the filediff storage and the tilestore.
diffStore := filediffstore.NewFileDiffStore(client, *imageDir, *gsBucketName, filediffstore.DEFAULT_GS_IMG_DIR_NAME, filediffstore.RECOMMENDED_WORKER_POOL_SIZE)
- vdb := database.NewVersionedDB(db.GetConfig(*dbConnStr, *sqlitePath, *local))
+ conf, err := db.DatabaseConfig(*dbConnStr, *local)
+ if err != nil {
+ glog.Fatal(err)
+ }
+ vdb := database.NewVersionedDB(conf)
expStore := expstorage.NewCachingExpectationStore(expstorage.NewSQLExpectationStore(vdb))
tileStore := filetilestore.NewFileTileStore(*tileStoreDir, "golden", -1)
« go/buildbot/db.go ('K') | « golden/go/expstorage/expstorage_test.go ('k') | perf/DESIGN.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698