satellite/satellitedb: move tests near the interface (#2863)

This commit is contained in:
Egon Elbre 2019-08-26 13:19:02 +03:00 committed by GitHub
parent 4e16a5c598
commit 6ff94caf22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -1,7 +1,7 @@
// Copyright (C) 2019 Storj Labs, Inc. // Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information. // See LICENSE for copying information.
package satellitedb_test package console_test
import ( import (
"context" "context"
@ -19,7 +19,7 @@ import (
"storj.io/storj/satellite/satellitedb/satellitedbtest" "storj.io/storj/satellite/satellitedb/satellitedbtest"
) )
func TestUsercredits(t *testing.T) { func TestUserCredits(t *testing.T) {
satellitedbtest.Run(t, func(t *testing.T, db satellite.DB) { satellitedbtest.Run(t, func(t *testing.T, db satellite.DB) {
ctx := testcontext.New(t) ctx := testcontext.New(t)
defer ctx.Cleanup() defer ctx.Cleanup()

View File

@ -1,7 +1,7 @@
// Copyright (C) 2019 Storj Labs, Inc. // Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information. // See LICENSE for copying information.
package satellitedb_test package queue_test
import ( import (
"context" "context"
@ -21,7 +21,7 @@ import (
"storj.io/storj/storage" "storj.io/storj/storage"
) )
func TestRepairQueue(t *testing.T) { func TestUntilEmpty(t *testing.T) {
satellitedbtest.Run(t, func(t *testing.T, db satellite.DB) { satellitedbtest.Run(t, func(t *testing.T, db satellite.DB) {
ctx := testcontext.New(t) ctx := testcontext.New(t)
defer ctx.Cleanup() defer ctx.Cleanup()
@ -54,7 +54,7 @@ func TestRepairQueue(t *testing.T) {
}) })
} }
func TestRepairQueueOrder(t *testing.T) { func TestOrder(t *testing.T) {
satellitedbtest.Run(t, func(t *testing.T, db satellite.DB) { satellitedbtest.Run(t, func(t *testing.T, db satellite.DB) {
ctx := testcontext.New(t) ctx := testcontext.New(t)
defer ctx.Cleanup() defer ctx.Cleanup()
@ -72,6 +72,7 @@ func TestRepairQueueOrder(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
} }
// TODO: remove dependency on *dbx.DB
dbAccess := db.(interface{ TestDBAccess() *dbx.DB }).TestDBAccess() dbAccess := db.(interface{ TestDBAccess() *dbx.DB }).TestDBAccess()
var timeConvertPrefix string var timeConvertPrefix string
switch d := dbAccess.DB.Driver().(type) { switch d := dbAccess.DB.Driver().(type) {
@ -129,7 +130,7 @@ func TestRepairQueueOrder(t *testing.T) {
}) })
} }
func TestRepairQueueCount(t *testing.T) { func TestCount(t *testing.T) {
satellitedbtest.Run(t, func(t *testing.T, db satellite.DB) { satellitedbtest.Run(t, func(t *testing.T, db satellite.DB) {
ctx := testcontext.New(t) ctx := testcontext.New(t)
defer ctx.Cleanup() defer ctx.Cleanup()