Skip to content

Commit

Permalink
feat: sso user test
Browse files Browse the repository at this point in the history
  • Loading branch information
kitanoyoru committed Mar 25, 2024
1 parent 46d5a2a commit fcbce7f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ tasks:
- go work sync
- go work vendor


build-images:
desc: "Build MS images (buider and production)"
cmds:
- docker buildx build --file .docker/builder/Dockerfile . --build-arg "GITHUB_USERNAME=$GITLAB_USERNAME" --build-arg "GITHULAB_PAT=$GITLAB_PAT" --tag "kitanoyoru/kitadrivebot.v1.builder:latest"
- docker buildx build --file apps/sso/Dockerfile . --tag "kitanoyoru/kitadrivebot.v1.sso:latest"
docker buildx build --file apps/sso/Dockerfile . --tag "kitanoyoru/kitadrivebot.v1.sso:latest"
37 changes: 37 additions & 0 deletions apps/sso/internal/app/gateway/api/v1/user/user_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package user

import (
"testing"

"github.com/jackc/pgx/v5/pgxpool"
"github.com/stretchr/testify/suite"

"github.com/kitanoyoru/kitaDriveBot/apps/sso/internal/internal/migrator"
"github.com/kitanoyoru/kitaDriveBot/libs/test"
)

func TestIntegrationUserServiceSuite(t *testing.T) {
testSuite := &integrationUserServiceSuite{}
suite.Run(t, testSuite)
}

type integrationUserServiceSuite struct {
suite.Suite
test.DBTest

dbPool *pgxpool.Pool
}

func (s *integrationUserServiceSuite) SetupTest() {
var err error
s.dbPool, err = s.CreateDB(s.T(), test.WithMigrator(migrator.Migrator))
s.Require().NoError(err)

s.Require().NoError(err)
}

func (s *integrationUserServiceSuite) TearDownTest() {
if s.dbPool != nil {
s.dbPool.Close()
}
}
5 changes: 5 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mods=$(go list -f '{{.Dir}}' -m | xargs)

for mod in $mods; do
(cd "$mod"; go test ./...)
done

0 comments on commit fcbce7f

Please sign in to comment.