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
This commit is contained in:
Egon Elbre 2020-04-27 19:28:40 +03:00
parent db0371703f
commit ef913be234
2 changed files with 6 additions and 3 deletions

View File

@ -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()

View File

@ -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)
}