Chore: Remove x from annotation test (#46935)

This commit is contained in:
Kat Yang 2022-03-25 13:23:21 -04:00 committed by GitHub
parent 90f2233ea9
commit e6726681a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,9 +21,14 @@ func TestAnnotations(t *testing.T) {
t.Run("Testing annotation create, read, update and delete", func(t *testing.T) {
t.Cleanup(func() {
_, err := x.Exec("DELETE FROM annotation WHERE 1=1")
assert.NoError(t, err)
_, err = x.Exec("DELETE FROM annotation_tag WHERE 1=1")
err := repo.sql.WithDbSession(context.Background(), func(dbSession *DBSession) error {
_, err := dbSession.Exec("DELETE FROM annotation WHERE 1=1")
if err != nil {
return err
}
_, err = dbSession.Exec("DELETE FROM annotation_tag WHERE 1=1")
return err
})
assert.NoError(t, err)
})