Skip to content

Commit

Permalink
fix(internal/database): fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jinghancc committed Nov 11, 2021
1 parent 084444f commit c6b2d0b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions internal/database/metadata/postgres/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func initDB(t *testing.T) {
opt := runtime_pg.PostgresDbopt
opt := runtime_pg.PostgresDbOpt
store, err := Open(&types.PostgresOpt{
Host: opt.Host,
Port: opt.Port,
Expand All @@ -28,15 +28,15 @@ func initDB(t *testing.T) {
}
store.Close()

if err := CreateDatabase(context.Background(), runtime_pg.PostgresDbopt); err != nil {
if err := CreateDatabase(context.Background(), runtime_pg.PostgresDbOpt); err != nil {
t.Fatal(err)
}
}

func initAndOpenDB(t *testing.T) *DB {
initDB(t)

db, err := Open(&runtime_pg.PostgresDbopt)
db, err := Open(&runtime_pg.PostgresDbOpt)
if err != nil {
t.Fatal(err)
}
Expand All @@ -45,11 +45,11 @@ func initAndOpenDB(t *testing.T) *DB {

func TestCreateDatabase(t *testing.T) {
ctx := context.Background()
if err := CreateDatabase(ctx, runtime_pg.PostgresDbopt); err != nil {
if err := CreateDatabase(ctx, runtime_pg.PostgresDbOpt); err != nil {
t.Fatal(err)
}

store, err := Open(&runtime_pg.PostgresDbopt)
store, err := Open(&runtime_pg.PostgresDbOpt)
if err != nil {
t.Fatal(err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/database/metadatav2/postgres/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func prepareStore(t *testing.T) (context.Context, *postgres.DB) {
ctx := context.Background()
opt := runtime_pg.PostgresDbopt
opt := runtime_pg.PostgresDbOpt
pg, err := postgres.OpenDB(
context.Background(),
opt.Host,
Expand All @@ -27,10 +27,10 @@ func prepareStore(t *testing.T) (context.Context, *postgres.DB) {
require.NoError(t, err)
pg.Close()

err = postgres.CreateDatabase(ctx, runtime_pg.PostgresDbopt)
err = postgres.CreateDatabase(ctx, runtime_pg.PostgresDbOpt)
require.NoError(t, err)

db, err := postgres.Open(context.Background(), &runtime_pg.PostgresDbopt)
db, err := postgres.Open(context.Background(), &runtime_pg.PostgresDbOpt)
require.NoError(t, err)

return ctx, db
Expand Down
4 changes: 2 additions & 2 deletions internal/database/offline/postgres/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func initDB(t *testing.T) {
opt := runtime_pg.PostgresDbopt
opt := runtime_pg.PostgresDbOpt
store, err := postgres.Open(&types.PostgresOpt{
Host: opt.Host,
Port: opt.Port,
Expand All @@ -36,7 +36,7 @@ func initDB(t *testing.T) {
func initAndOpenDB(t *testing.T) *postgres.DB {
initDB(t)

db, err := postgres.Open(&runtime_pg.PostgresDbopt)
db, err := postgres.Open(&runtime_pg.PostgresDbOpt)
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/database/online/postgres/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func prepareStore() (context.Context, online.Store) {
ctx := context.Background()
opt := runtime_pg.PostgresDbopt
opt := runtime_pg.PostgresDbOpt
store, err := Open(&types.PostgresOpt{
Host: opt.Host,
Port: opt.Port,
Expand Down
4 changes: 2 additions & 2 deletions internal/database/test/runtime_pg/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/orlangure/gnomock/preset/postgres"
)

var PostgresDbopt types.PostgresOpt
var PostgresDbOpt types.PostgresOpt

func init() {
postgresContainer, err := gnomock.Start(
Expand All @@ -26,7 +26,7 @@ func init() {
panic(err)
}

PostgresDbopt = types.PostgresOpt{
PostgresDbOpt = types.PostgresOpt{
Host: postgresContainer.Host,
Port: strconv.Itoa(postgresContainer.DefaultPort()),
User: "test",
Expand Down

0 comments on commit c6b2d0b

Please sign in to comment.