Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sesposito committed Jan 15, 2025
1 parent e15e753 commit 7b49340
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions server/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ func NewConsoleLogger(output *os.File, verbose bool) *zap.Logger {
}

func NewDB(t *testing.T) *sql.DB {
//dbUrl := "postgresql://[email protected]:5432/nakama?sslmode=disable"
dbUrl := "postgresql://[email protected]:26257/nakama?sslmode=disable"
dbUrl := "postgresql://[email protected]:5432/nakama?sslmode=disable"
// dbUrl := "postgresql://[email protected]:26257/nakama?sslmode=disable"
if dbUrlEnv := os.Getenv("TEST_DB_URL"); len(dbUrlEnv) > 0 {
dbUrl = dbUrlEnv
}
Expand Down
28 changes: 14 additions & 14 deletions server/core_friend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,48 +50,48 @@ func TestServer_ListFriendsOfFriends(t *testing.T) {
t.Fatal(err)
}

if _, err := addFriend(ctx, logger, tx, uid, uidA1.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uid, uidA1.String(), ""); err != nil {
t.Fatal(err)
}
if _, err := addFriend(ctx, logger, tx, uidA1, uid.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uidA1, uid.String(), ""); err != nil {
t.Fatal(err)
}
if _, err := addFriend(ctx, logger, tx, uidA1, uidA2.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uidA1, uidA2.String(), ""); err != nil {
t.Fatal(err)
}
if _, err := addFriend(ctx, logger, tx, uidA2, uidA1.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uidA2, uidA1.String(), ""); err != nil {
t.Fatal(err)
}
if _, err := addFriend(ctx, logger, tx, uidA1, uidA3.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uidA1, uidA3.String(), ""); err != nil {
t.Fatal(err)
}
if _, err := addFriend(ctx, logger, tx, uidA3, uidA1.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uidA3, uidA1.String(), ""); err != nil {
t.Fatal(err)
}

if _, err := addFriend(ctx, logger, tx, uid, uidB1.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uid, uidB1.String(), ""); err != nil {
t.Fatal(err)
}
if _, err := addFriend(ctx, logger, tx, uidB1, uid.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uidB1, uid.String(), ""); err != nil {
t.Fatal(err)
}
if _, err := addFriend(ctx, logger, tx, uidB1, uidB2.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uidB1, uidB2.String(), ""); err != nil {
t.Fatal(err)
}
if _, err := addFriend(ctx, logger, tx, uidB2, uidB1.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uidB2, uidB1.String(), ""); err != nil {
t.Fatal(err)
}
if _, err := addFriend(ctx, logger, tx, uidB1, uidB3.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uidB1, uidB3.String(), ""); err != nil {
t.Fatal(err)
}
if _, err := addFriend(ctx, logger, tx, uidB3, uidB1.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uidB3, uidB1.String(), ""); err != nil {
t.Fatal(err)
}

if _, err := addFriend(ctx, logger, tx, uid, uidB3.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uid, uidB3.String(), ""); err != nil {
t.Fatal(err)
}
if _, err := addFriend(ctx, logger, tx, uidB3, uid.String()); err != nil {
if _, err := addFriend(ctx, logger, tx, uidB3, uid.String(), ""); err != nil {
t.Fatal(err)
}

Expand Down

0 comments on commit 7b49340

Please sign in to comment.