From 41f56ad05d12520bb90f91889fa979465d0b3d6b Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Sat, 11 Apr 2020 20:18:05 +0800 Subject: login_source: migrate to GORM and add tests (#6090) * Use GORM in all write paths * Migrate to GORM * Fix lint errors * Use GORM to init table * dbutil: make writer detect error * Add more tests * Rename to clearTables * db: finish adding tests * osutil: add tests * Fix load source files path --- internal/db/lfs_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/db/lfs_test.go') diff --git a/internal/db/lfs_test.go b/internal/db/lfs_test.go index 6eb14019..29c7d665 100644 --- a/internal/db/lfs_test.go +++ b/internal/db/lfs_test.go @@ -22,8 +22,9 @@ func Test_lfs(t *testing.T) { t.Parallel() + tables := []interface{}{new(LFSObject)} db := &lfs{ - DB: initTestDB(t, "lfs", new(LFSObject)), + DB: initTestDB(t, "lfs", tables...), } for _, tc := range []struct { @@ -36,7 +37,7 @@ func Test_lfs(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { t.Cleanup(func() { - err := deleteTables(db.DB, new(LFSObject)) + err := clearTables(db.DB, tables...) if err != nil { t.Fatal(err) } -- cgit v1.2.3