Skip to content

Commit

Permalink
Refactor integration test (#66)
Browse files Browse the repository at this point in the history
Co-authored-by: James Kwon <[email protected]>
  • Loading branch information
james03160927 and james03160927 authored Jul 9, 2024
1 parent e4671e2 commit 69a3bf1
Show file tree
Hide file tree
Showing 4 changed files with 692 additions and 792 deletions.
10 changes: 2 additions & 8 deletions integration-tests/ban_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,15 @@ import (
"google.golang.org/protobuf/proto"

"github.com/labstack/echo/v4"
"github.com/rs/zerolog/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
)

func TestBan(t *testing.T) {
clientCtx := context.Background()
client, postgresContainer := setupDB(t, clientCtx)
// Cleanup
defer func() {
if err := postgresContainer.Terminate(clientCtx); err != nil {
log.Ctx(clientCtx).Error().Msgf("failed to terminate container: %s", err)
}
}()
client, cleanup := setupDB(t, clientCtx)
defer cleanup()

// Initialize the Service
mockStorageService := new(gateways.MockStorageService)
Expand Down
10 changes: 2 additions & 8 deletions integration-tests/ci_cd_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"time"

"github.com/google/uuid"
"github.com/rs/zerolog/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
Expand All @@ -21,13 +20,8 @@ import (

func TestCICD(t *testing.T) {
clientCtx := context.Background()
client, postgresContainer := setupDB(t, clientCtx)
// Cleanup
defer func() {
if err := postgresContainer.Terminate(clientCtx); err != nil {
log.Ctx(clientCtx).Error().Msgf("failed to terminate container: %s", err)
}
}()
client, cleanup := setupDB(t, clientCtx)
defer cleanup()

// Initialize the Service
mockStorageService := new(gateways.MockStorageService)
Expand Down
Loading

0 comments on commit 69a3bf1

Please sign in to comment.