test: consolidate Go tests (#39962)

Consolidate all Go tests. Coverage is identical to before. Go tests are
around 5% faster while being 7% smaller. No non-test code is touched.
This commit is contained in:
silverwind authored and GitHub committed 2026-10-24 13:48:19 +00:00
1 parent ce7364e215
commit 8abda62312
388 files changed
+18410 -29561

No files matched your search

+6 -10
View File
@@ -34,17 +34,13 @@ func TestIsProjectTypeValid(t *testing.T) {
func TestGetProjects(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
projects, err := db.Find[Project](t.Context(), SearchOptions{RepoID: 1})
assert.NoError(t, err)
for _, repoID := range []int64{1, 3} {
projects, err := db.Find[Project](t.Context(), SearchOptions{RepoID: repoID})
assert.NoError(t, err)
// 1 value for this repo exists in the fixtures
assert.Len(t, projects, 1)
projects, err = db.Find[Project](t.Context(), SearchOptions{RepoID: 3})
assert.NoError(t, err)
// 1 value for this repo exists in the fixtures
assert.Len(t, projects, 1)
// 1 value for this repo exists in the fixtures
assert.Len(t, projects, 1)
}
}
func TestProject(t *testing.T) {