Refactor fixture loading for testing (#33024)

To help binary size and testing performance
This commit is contained in:
wxiaoguang 2024-12-30 12:06:57 +08:00 committed by GitHub
parent f4ccbd38dc
commit dafadf0028
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 377 additions and 248 deletions

View file

@ -13,9 +13,7 @@ import (
)
func TestMain(m *testing.M) {
unittest.MainTest(m, &unittest.TestOptions{
FixtureFiles: []string{""}, // load nothing
})
unittest.MainTest(m, &unittest.TestOptions{FixtureFiles: []string{ /* load nothing */ }})
}
type testItem1 struct {
@ -36,8 +34,6 @@ func (*testItem2) Name() string {
}
func TestAppStateDB(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
as := &DBStore{}
item1 := new(testItem1)