Skip to content

Commit

Permalink
test: fixed broken test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Wil Simpson committed Apr 5, 2024
1 parent dc978e3 commit cde0182
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 90 deletions.
121 changes: 57 additions & 64 deletions coverage.out
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,36 @@ github.com/ShatteredRealms/go-backend/pkg/auth/validation.go:32.16,35.3 2 0
github.com/ShatteredRealms/go-backend/pkg/auth/validation.go:37.2,37.18 1 0
github.com/ShatteredRealms/go-backend/pkg/auth/validation.go:37.18,40.3 2 0
github.com/ShatteredRealms/go-backend/pkg/auth/validation.go:42.2,48.28 3 0
github.com/ShatteredRealms/go-backend/pkg/config/db.go:20.37,29.2 1 1
github.com/ShatteredRealms/go-backend/pkg/config/db.go:31.40,40.2 1 1
github.com/ShatteredRealms/go-backend/pkg/config/db.go:42.37,50.2 1 1
github.com/ShatteredRealms/go-backend/pkg/config/global.go:87.66,213.45 7 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:213.45,214.48 1 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:214.48,217.4 2 0
github.com/ShatteredRealms/go-backend/pkg/config/global.go:217.9,217.62 1 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:217.62,219.4 1 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:219.9,222.4 2 0
github.com/ShatteredRealms/go-backend/pkg/config/global.go:225.2,230.49 3 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:230.49,233.3 2 0
github.com/ShatteredRealms/go-backend/pkg/config/global.go:235.2,235.20 1 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:238.40,242.55 3 11
github.com/ShatteredRealms/go-backend/pkg/config/global.go:242.55,244.3 1 8
github.com/ShatteredRealms/go-backend/pkg/config/global.go:246.2,246.38 1 11
github.com/ShatteredRealms/go-backend/pkg/config/global.go:246.38,249.22 3 53
github.com/ShatteredRealms/go-backend/pkg/config/global.go:249.22,251.4 1 6
github.com/ShatteredRealms/go-backend/pkg/config/global.go:252.3,252.35 1 53
github.com/ShatteredRealms/go-backend/pkg/config/global.go:256.51,257.34 1 485
github.com/ShatteredRealms/go-backend/pkg/config/global.go:257.34,261.3 3 333
github.com/ShatteredRealms/go-backend/pkg/config/global.go:263.2,263.38 1 152
github.com/ShatteredRealms/go-backend/pkg/config/global.go:263.38,266.22 3 432
github.com/ShatteredRealms/go-backend/pkg/config/global.go:266.22,268.4 1 15
github.com/ShatteredRealms/go-backend/pkg/config/global.go:268.9,268.23 1 417
github.com/ShatteredRealms/go-backend/pkg/config/global.go:268.23,270.4 1 411
github.com/ShatteredRealms/go-backend/pkg/config/global.go:272.3,272.42 1 432
github.com/ShatteredRealms/go-backend/pkg/config/global.go:276.42,278.2 1 2
github.com/ShatteredRealms/go-backend/pkg/config/db.go:19.37,28.2 1 1
github.com/ShatteredRealms/go-backend/pkg/config/db.go:30.40,39.2 1 1
github.com/ShatteredRealms/go-backend/pkg/config/db.go:41.37,49.2 1 1
github.com/ShatteredRealms/go-backend/pkg/config/db.go:51.44,53.36 2 0
github.com/ShatteredRealms/go-backend/pkg/config/db.go:53.36,55.3 1 0
github.com/ShatteredRealms/go-backend/pkg/config/db.go:57.2,57.14 1 0
github.com/ShatteredRealms/go-backend/pkg/config/global.go:88.66,262.45 7 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:262.45,263.48 1 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:263.48,266.4 2 0
github.com/ShatteredRealms/go-backend/pkg/config/global.go:266.9,266.62 1 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:266.62,268.4 1 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:268.9,271.4 2 0
github.com/ShatteredRealms/go-backend/pkg/config/global.go:274.2,279.49 3 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:279.49,282.3 2 0
github.com/ShatteredRealms/go-backend/pkg/config/global.go:284.2,284.20 1 5
github.com/ShatteredRealms/go-backend/pkg/config/global.go:287.40,291.55 3 11
github.com/ShatteredRealms/go-backend/pkg/config/global.go:291.55,293.3 1 8
github.com/ShatteredRealms/go-backend/pkg/config/global.go:295.2,295.38 1 11
github.com/ShatteredRealms/go-backend/pkg/config/global.go:295.38,298.22 3 58
github.com/ShatteredRealms/go-backend/pkg/config/global.go:298.22,300.4 1 6
github.com/ShatteredRealms/go-backend/pkg/config/global.go:301.3,301.35 1 58
github.com/ShatteredRealms/go-backend/pkg/config/global.go:305.51,306.34 1 550
github.com/ShatteredRealms/go-backend/pkg/config/global.go:306.34,310.3 3 363
github.com/ShatteredRealms/go-backend/pkg/config/global.go:312.2,312.38 1 187
github.com/ShatteredRealms/go-backend/pkg/config/global.go:312.38,315.22 3 492
github.com/ShatteredRealms/go-backend/pkg/config/global.go:315.22,317.4 1 40
github.com/ShatteredRealms/go-backend/pkg/config/global.go:317.9,317.23 1 452
github.com/ShatteredRealms/go-backend/pkg/config/global.go:317.23,319.4 1 446
github.com/ShatteredRealms/go-backend/pkg/config/global.go:321.3,321.42 1 492
github.com/ShatteredRealms/go-backend/pkg/config/global.go:325.42,327.2 1 2
github.com/ShatteredRealms/go-backend/pkg/config/server.go:29.80,30.67 1 0
github.com/ShatteredRealms/go-backend/pkg/config/server.go:30.67,32.3 1 0
github.com/ShatteredRealms/go-backend/pkg/config/server.go:34.2,34.32 1 0
Expand All @@ -74,12 +77,12 @@ github.com/ShatteredRealms/go-backend/pkg/config/server.go:61.95,63.16 2 0
github.com/ShatteredRealms/go-backend/pkg/config/server.go:63.16,65.3 1 0
github.com/ShatteredRealms/go-backend/pkg/config/server.go:67.2,70.8 1 0
github.com/ShatteredRealms/go-backend/pkg/helpers/conversions.go:9.48,11.28 2 1
github.com/ShatteredRealms/go-backend/pkg/helpers/conversions.go:11.28,13.3 1 12
github.com/ShatteredRealms/go-backend/pkg/helpers/conversions.go:11.28,13.3 1 43
github.com/ShatteredRealms/go-backend/pkg/helpers/conversions.go:15.2,15.13 1 1
github.com/ShatteredRealms/go-backend/pkg/helpers/conversions.go:18.59,20.39 2 3
github.com/ShatteredRealms/go-backend/pkg/helpers/conversions.go:20.39,22.17 2 47
github.com/ShatteredRealms/go-backend/pkg/helpers/conversions.go:20.39,22.17 2 48
github.com/ShatteredRealms/go-backend/pkg/helpers/conversions.go:22.17,24.4 1 2
github.com/ShatteredRealms/go-backend/pkg/helpers/conversions.go:25.3,25.17 1 45
github.com/ShatteredRealms/go-backend/pkg/helpers/conversions.go:25.3,25.17 1 46
github.com/ShatteredRealms/go-backend/pkg/helpers/conversions.go:28.2,28.17 1 1
github.com/ShatteredRealms/go-backend/pkg/helpers/grpc.go:18.87,19.86 1 4
github.com/ShatteredRealms/go-backend/pkg/helpers/grpc.go:19.86,20.94 1 4
Expand Down Expand Up @@ -186,18 +189,6 @@ github.com/ShatteredRealms/go-backend/pkg/model/game/map.go:29.35,31.27 2 12
github.com/ShatteredRealms/go-backend/pkg/model/game/map.go:31.27,33.3 1 21
github.com/ShatteredRealms/go-backend/pkg/model/game/map.go:35.2,35.12 1 12
github.com/ShatteredRealms/go-backend/pkg/model/model.go:17.34,19.2 1 2
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:14.31,15.20 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:15.20,17.3 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:20.38,24.2 3 1
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:26.111,29.9 3 0
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:29.9,31.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:33.2,33.50 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:33.50,35.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:37.2,37.15 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:40.93,43.16 3 0
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:43.16,45.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:47.2,48.12 2 0
github.com/ShatteredRealms/go-backend/pkg/repository/cacher.go:51.62,54.2 2 0
github.com/ShatteredRealms/go-backend/pkg/repository/character_r.go:42.80,50.2 3 32
github.com/ShatteredRealms/go-backend/pkg/repository/character_r.go:52.105,55.25 3 4
github.com/ShatteredRealms/go-backend/pkg/repository/character_r.go:55.25,58.3 2 0
Expand Down Expand Up @@ -248,20 +239,22 @@ github.com/ShatteredRealms/go-backend/pkg/repository/chat_r.go:125.2,125.30 1 3
github.com/ShatteredRealms/go-backend/pkg/repository/chat_r.go:125.30,127.3 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/chat_r.go:129.2,130.21 2 2
github.com/ShatteredRealms/go-backend/pkg/repository/chat_r.go:133.52,135.2 1 32
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:21.60,23.16 2 2
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:23.16,25.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:26.2,45.16 6 2
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:45.16,47.3 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:49.2,49.26 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:49.26,51.37 2 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:51.37,53.4 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:55.3,60.17 2 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:60.17,62.4 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:65.2,65.90 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:65.90,67.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:69.2,75.45 2 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:75.45,77.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:79.2,79.16 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:22.93,24.16 2 2
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:24.16,26.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:27.2,46.16 6 2
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:46.16,48.3 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:50.2,50.28 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:50.28,52.39 2 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:52.39,54.4 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:56.3,61.17 2 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:61.17,63.4 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:66.2,66.92 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:66.92,68.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:70.2,71.16 2 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:71.16,73.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:74.2,80.45 2 1
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:80.45,82.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/db.go:84.2,84.16 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/gamebackend_r.go:69.66,73.2 1 32
github.com/ShatteredRealms/go-backend/pkg/repository/gamebackend_r.go:80.43,81.21 1 26
github.com/ShatteredRealms/go-backend/pkg/repository/gamebackend_r.go:81.21,83.3 1 1
Expand Down Expand Up @@ -345,7 +338,7 @@ github.com/ShatteredRealms/go-backend/pkg/repository/kafka.go:22.24,24.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/kafka.go:25.2,25.27 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/kafka.go:25.27,27.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/kafka.go:28.2,30.27 2 1
github.com/ShatteredRealms/go-backend/pkg/repository/kafka.go:30.27,33.3 2 2
github.com/ShatteredRealms/go-backend/pkg/repository/kafka.go:30.27,33.3 2 1
github.com/ShatteredRealms/go-backend/pkg/repository/kafka.go:34.2,34.16 1 1
github.com/ShatteredRealms/go-backend/pkg/repository/kafka.go:34.16,36.3 1 0
github.com/ShatteredRealms/go-backend/pkg/repository/kafka.go:38.2,39.16 2 1
Expand Down Expand Up @@ -416,9 +409,9 @@ github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:100.100,113.2 5 1
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:114.122,118.23 3 3
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:118.23,120.3 1 1
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:122.2,129.3 2 2
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:132.133,136.23 3 9
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:132.133,136.23 3 6
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:136.23,138.3 1 1
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:139.2,146.3 2 8
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:139.2,146.3 2 5
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:149.82,151.2 1 3
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:153.111,155.16 2 2
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:155.16,157.3 1 1
Expand All @@ -437,17 +430,17 @@ github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:202.37,204.3 1 2
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:206.2,207.16 2 1
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:207.16,209.3 1 0
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:211.2,211.21 1 1
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:215.99,217.2 1 7
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:215.99,217.2 1 4
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:219.80,225.2 1 3
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:227.68,233.2 1 7
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:227.68,233.2 1 4
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:235.50,237.2 1 6
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:239.49,241.2 1 10
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:239.49,241.2 1 7
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:243.97,247.47 3 2
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:247.47,254.3 1 1
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:256.2,256.43 1 2
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:259.96,263.41 3 8
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:259.96,263.41 3 5
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:263.41,270.3 1 2
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:272.2,272.37 1 8
github.com/ShatteredRealms/go-backend/pkg/service/chat_s.go:272.2,272.37 1 5
github.com/ShatteredRealms/go-backend/pkg/service/gamebackend_s.go:77.118,78.35 1 14
github.com/ShatteredRealms/go-backend/pkg/service/gamebackend_s.go:79.32,80.60 1 8
github.com/ShatteredRealms/go-backend/pkg/service/gamebackend_s.go:82.30,84.17 2 5
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ var _ = Describe("Server config", func() {
config, err := config.NewGlobalConfig(context.TODO())
Expect(err).NotTo(HaveOccurred())
Expect(config).NotTo(BeNil())
Expect(config.Character.Local.Address()).To(Equal(fmt.Sprintf("%s:%d", config.Character.Local.Host, config.Character.Local.Port)))
Expect(config.Character.Local.Address()).To(Equal(fmt.Sprintf("%s:%s", config.Character.Local.Host, config.Character.Local.Port)))
config.Character.Local.Host = faker.Username()
Expect(config.Character.Local.Address()).To(Equal(fmt.Sprintf("%s:%d", config.Character.Local.Host, config.Character.Local.Port)))
Expect(config.Character.Local.Address()).To(Equal(fmt.Sprintf("%s:%s", config.Character.Local.Host, config.Character.Local.Port)))
})
})
})
8 changes: 4 additions & 4 deletions pkg/repository/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ var _ = Describe("Db repository", func() {
BeforeEach(func() {
log.Logger, _ = test.NewNullLogger()
pool = config.DBPoolConfig{
Master: data.gormConfig,
Slaves: []config.DBConfig{data.gormConfig},
Master: data.GormConfig,
Slaves: []config.DBConfig{data.GormConfig},
}
})
Describe("ConnectDb", func() {
When("given valid input", func() {
It("should work", func() {
out, err := repository.ConnectDB(pool, data.redisConfig)
out, err := repository.ConnectDB(pool, data.RedisConfig)
Expect(err).NotTo(HaveOccurred())
Expect(out).NotTo(BeNil())
})
Expand All @@ -32,7 +32,7 @@ var _ = Describe("Db repository", func() {
When("given invalid input", func() {
It("should error", func() {
pool.Master.Host = "a"
out, err := repository.ConnectDB(pool, data.redisConfig)
out, err := repository.ConnectDB(pool, data.RedisConfig)
Expect(err).To(HaveOccurred())
Expect(out).To(BeNil())
})
Expand Down
35 changes: 19 additions & 16 deletions pkg/repository/repository_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ import (
)

type initializeData struct {
gormConfig config.DBConfig
mdbConnStr string
redisConfig config.DBPoolConfig
GormConfig config.DBConfig
MdbConnStr string
RedisConfig config.DBPoolConfig
}

var (
hook *test.Hook

gdb *gorm.DB
gdbCloseFunc func()
mdb *mongo.Database
mdbCloseFunc func()
gdb *gorm.DB
gdbCloseFunc func()
mdb *mongo.Database
mdbCloseFunc func()
redisCloseFunc func()

data initializeData

Expand All @@ -47,10 +48,12 @@ func TestRepository(t *testing.T) {
gdbCloseFunc, gormPort = testdb.SetupGormWithDocker()
Expect(gdbCloseFunc).NotTo(BeNil())

mdbCloseFunc, data.mdbConnStr = testdb.SetupMongoWithDocker()
mdbCloseFunc, data.MdbConnStr = testdb.SetupMongoWithDocker()
Expect(mdbCloseFunc).NotTo(BeNil())

data.gormConfig = config.DBConfig{
redisCloseFunc, data.RedisConfig = testdb.SetupRedisWithDocker()

data.GormConfig = config.DBConfig{
ServerAddress: config.ServerAddress{
Port: gormPort,
Host: "localhost",
Expand All @@ -59,9 +62,9 @@ func TestRepository(t *testing.T) {
Username: testdb.Username,
Password: testdb.Password,
}
gdb = testdb.ConnectGormDocker(data.gormConfig.PostgresDSN())
gdb = testdb.ConnectGormDocker(data.GormConfig.PostgresDSN())
Expect(gdb).NotTo(BeNil())
mdb = testdb.ConnectMongoDocker(data.mdbConnStr)
mdb = testdb.ConnectMongoDocker(data.MdbConnStr)
Expect(mdb).NotTo(BeNil())

var err error
Expand All @@ -86,13 +89,12 @@ func TestRepository(t *testing.T) {
}, func(inBytes []byte) {
log.Logger, hook = test.NewNullLogger()

var buf bytes.Buffer
dec := gob.NewDecoder(&buf)
Expect(dec.Decode(inBytes)).To(Succeed())
dec := gob.NewDecoder(bytes.NewBuffer(inBytes))
Expect(dec.Decode(&data)).To(Succeed())

gdb = testdb.ConnectGormDocker(data.gormConfig.PostgresDSN())
gdb = testdb.ConnectGormDocker(data.GormConfig.PostgresDSN())
Expect(gdb).NotTo(BeNil())
mdb = testdb.ConnectMongoDocker(data.mdbConnStr)
mdb = testdb.ConnectMongoDocker(data.MdbConnStr)
Expect(mdb).NotTo(BeNil())

var err error
Expand All @@ -115,6 +117,7 @@ func TestRepository(t *testing.T) {
}, func() {
gdbCloseFunc()
mdbCloseFunc()
redisCloseFunc()
})

RegisterFailHandler(Fail)
Expand Down
2 changes: 1 addition & 1 deletion pkg/srv/chat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ var _ = Describe("Chat", func() {
}
Expect(kafkaConn).NotTo(BeNil())

readerConfig.Brokers = []string{fmt.Sprintf("127.0.0.1:%d", kafkaPort)}
readerConfig.Brokers = []string{fmt.Sprintf("127.0.0.1:%s", kafkaPort)}
kafkaWriter = &kafka.Writer{
Addr: kafkaConn.RemoteAddr(),
Topic: topicName,
Expand Down
2 changes: 1 addition & 1 deletion pkg/srv/srv_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func TestSrv(t *testing.T) {

kafkaCloseFunc, kafkaPort = testdb.SetupKafkaWithDocker()

out := fmt.Sprintf("%s\n%d", host, kafkaPort)
out := fmt.Sprintf("%s\n%s", host, kafkaPort)

return []byte(out)
}, func(data []byte) {
Expand Down
4 changes: 2 additions & 2 deletions test/db/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func ConnectGormDocker(connStr string) *gorm.DB {
return gdb
}

func SetupRedisWithDocker() (fnCleanup func(), redisPoolConfig *config.DBPoolConfig) {
func SetupRedisWithDocker() (fnCleanup func(), redisPoolConfig config.DBPoolConfig) {
pool, err := dockertest.NewPool("")
chk(err)

Expand Down Expand Up @@ -300,7 +300,7 @@ func SetupRedisWithDocker() (fnCleanup func(), redisPoolConfig *config.DBPoolCon
}

// container is ready, return *gorm.Db for testing
return fnCleanup, &config.DBPoolConfig{
return fnCleanup, config.DBPoolConfig{
Master: config.DBConfig{
ServerAddress: config.ServerAddress{
Port: resource.GetPort("7000/tcp"),
Expand Down

0 comments on commit cde0182

Please sign in to comment.