From ef913be234c3570c7d497d0992943697a6e298fe Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Mon, 27 Apr 2020 19:28:40 +0300 Subject: [PATCH] satellite/satellitedb/satellitedbtest: don't use subtest naming A/B indicates that B is a subtest of A, however in this case they represent a configuration of the test, not a subtest. Change-Id: I64eed5d5bcb12759e54fe4b5373f8e88488e50f7 --- private/testplanet/run.go | 2 +- satellite/satellitedb/satellitedbtest/run.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/private/testplanet/run.go b/private/testplanet/run.go index ee03fb8d8..7f175e84d 100644 --- a/private/testplanet/run.go +++ b/private/testplanet/run.go @@ -16,7 +16,7 @@ import ( func Run(t *testing.T, config Config, test func(t *testing.T, ctx *testcontext.Context, planet *Planet)) { for _, satelliteDB := range satellitedbtest.Databases() { satelliteDB := satelliteDB - t.Run(satelliteDB.MasterDB.Name, func(t *testing.T) { + t.Run(satelliteDB.Name, func(t *testing.T) { parallel := !config.NonParallel if parallel { t.Parallel() diff --git a/satellite/satellitedb/satellitedbtest/run.go b/satellite/satellitedb/satellitedbtest/run.go index 5cd531a82..603f031bf 100644 --- a/satellite/satellitedb/satellitedbtest/run.go +++ b/satellite/satellitedb/satellitedbtest/run.go @@ -29,6 +29,7 @@ import ( // SatelliteDatabases maybe name can be better type SatelliteDatabases struct { + Name string MasterDB Database PointerDB Database } @@ -44,10 +45,12 @@ type Database struct { func Databases() []SatelliteDatabases { return []SatelliteDatabases{ { + Name: "Postgres", MasterDB: Database{"Postgres", *pgtest.ConnStr, "Postgres flag missing, example: -postgres-test-db=" + pgtest.DefaultConnStr + " or use STORJ_POSTGRES_TEST environment variable."}, PointerDB: Database{"Postgres", *pgtest.ConnStr, ""}, }, { + Name: "Cockroach", MasterDB: Database{"Cockroach", *pgtest.CrdbConnStr, "Cockroach flag missing, example: -cockroach-test-db=" + pgtest.DefaultCrdbConnStr + " or use STORJ_COCKROACH_TEST environment variable."}, PointerDB: Database{"Cockroach", *pgtest.CrdbConnStr, ""}, }, @@ -162,7 +165,7 @@ func CreatePointerDBOnTopOf(ctx context.Context, log *zap.Logger, tempDB *dbutil func Run(t *testing.T, test func(ctx *testcontext.Context, t *testing.T, db satellite.DB)) { for _, dbInfo := range Databases() { dbInfo := dbInfo - t.Run(dbInfo.MasterDB.Name+"/"+dbInfo.PointerDB.Name, func(t *testing.T) { + t.Run(dbInfo.Name, func(t *testing.T) { t.Parallel() ctx := testcontext.New(t) @@ -198,7 +201,7 @@ func Run(t *testing.T, test func(ctx *testcontext.Context, t *testing.T, db sate func Bench(b *testing.B, bench func(b *testing.B, db satellite.DB)) { for _, dbInfo := range Databases() { dbInfo := dbInfo - b.Run(dbInfo.MasterDB.Name+"/"+dbInfo.PointerDB.Name, func(b *testing.B) { + b.Run(dbInfo.Name, func(b *testing.B) { if dbInfo.MasterDB.URL == "" { b.Skipf("Database %s connection string not provided. %s", dbInfo.MasterDB.Name, dbInfo.MasterDB.Message) }