Skip to content

Commit

Permalink
feat: clear all datas after each test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Alves committed Feb 16, 2024
1 parent 95edff3 commit 2c11c2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ func (suite *VoteOnPollControllerTestSuite) SetupTest() {
}

// Run this function after every test
// func (suite *VoteOnPollControllerTestSuite) TearDownTest() {
// test.TruncateTables()
// }
func (suite *VoteOnPollControllerTestSuite) TearDownTest() {
test.TruncateRedis()
test.TruncateTables()
}

func TestVoteOnPollControllerSuite(t *testing.T) {
// Register the test suite
Expand Down
2 changes: 1 addition & 1 deletion internal/infra/messaging/redis/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Connect() error {
r := redis.NewClient(&redis.Options{
Addr: addr,
Password: config.RedisPassword,
DB: 0, // use default DB
DB: config.RedisDb,
OnConnect: func(ctx context.Context, cn *redis.Conn) error {
logger.Info("connected with redis")
rdb = cn
Expand Down

0 comments on commit 2c11c2c

Please sign in to comment.