Skip to content

Commit

Permalink
Fix api test; log level.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel committed Jul 10, 2024
1 parent 18705ee commit 5146700
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions database/pk.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/konveyor/tackle2-hub/model"
"gorm.io/gorm"
"gorm.io/gorm/clause"
"gorm.io/gorm/logger"
)

// PK singleton pk sequence.
Expand Down Expand Up @@ -75,6 +76,7 @@ func (r *PkSequence) session(in *gorm.DB) (out *gorm.DB) {
out = &gorm.DB{
Config: in.Config,
}
out.Config.Logger.LogMode(logger.Warn)
out.Statement = &gorm.Statement{
DB: out,
ConnPool: in.Statement.ConnPool,
Expand Down
8 changes: 8 additions & 0 deletions test/api/ticket/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func TestTicketCRUD(t *testing.T) {
Name: r.Application.Name,
}
assert.Must(t, Application.Create(&app))
r.Application.ID = app.ID

createdIdentities := []api.Identity{}
createdTrackers := []api.Tracker{}
Expand All @@ -27,8 +28,11 @@ func TestTicketCRUD(t *testing.T) {
Kind: tracker.Kind,
}
assert.Must(t, Identity.Create(&identity))
tracker.Identity.ID = identity.ID
createdIdentities = append(createdIdentities, identity)
assert.Must(t, Tracker.Create(&tracker))
r.Tracker.ID = tracker.ID
r.Tracker.Name = tracker.Name
createdTrackers = append(createdTrackers, tracker)
}

Expand Down Expand Up @@ -72,6 +76,7 @@ func TestTicketList(t *testing.T) {
Name: r.Application.Name,
}
assert.Must(t, Application.Create(&app))
r.Application.ID = app.ID

createdIdentities := []api.Identity{}
createdTrackers := []api.Tracker{}
Expand All @@ -82,8 +87,11 @@ func TestTicketList(t *testing.T) {
Kind: tracker.Kind,
}
assert.Must(t, Identity.Create(&identity))
tracker.Identity.ID = identity.ID
createdIdentities = append(createdIdentities, identity)
assert.Must(t, Tracker.Create(&tracker))
r.Tracker.ID = tracker.ID
r.Tracker.Name = tracker.Name
createdTrackers = append(createdTrackers, tracker)
}

Expand Down

0 comments on commit 5146700

Please sign in to comment.