Skip to content

Commit

Permalink
Changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriCtvrtka committed Jan 8, 2024
1 parent 36670b6 commit 018f341
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions managed/utils/clean/clean_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ func TestCleaner(t *testing.T) {
require.NoError(t, sqlDB.Close())
}()

setup := func(t *testing.T) (db *reform.DB, q *reform.Querier, teardown func(t *testing.T)) {
setup := func(t *testing.T) (*reform.DB, *reform.Querier, func(t *testing.T)) {
t.Helper()
db = reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf))
q = db.Querier
db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf))
q := db.Querier
now, origNowF := models.Now(), models.Now
models.Now = func() time.Time {
// fake "old" rows
Expand Down Expand Up @@ -71,11 +71,11 @@ func TestCleaner(t *testing.T) {
}
require.NoError(t, q.Insert(str))

teardown = func(t *testing.T) {
teardown := func(t *testing.T) {
t.Helper()
assert.NoError(t, models.CleanupOldActionResults(db.Querier, models.Now()))
}
return //nolint:nakedret
return db, q, teardown
}

t.Run("CheckActionResultByID", func(t *testing.T) {
Expand Down

0 comments on commit 018f341

Please sign in to comment.