fix: repair unit-test compile + vet failures (partial integration cleanup) #736
Reference in New Issue
Block a user
Delete Branch "fix/vet-test-suite-blockers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes pre-existing compile/vet failures found once a local Go toolchain (go1.26.3) let
go vet ./...actually run. None relate to #727 — all pre-existing onmain.Complete fixes (verified
go vetclean)modules/util/util_test.go—CryptoRandomInt/String/Bytesreturn(value, error); the tests used single-value assignments (5 sites). Now capture + assert the error.go vet ./modules/util→ clean.routers/web/repo/issue_comment.go— removed a redundant&& statusIDStr != ""duplicate condition (real code, not a test).Partial (integration suite)
tests/integration/auth_oauth2_test.go—newFakeOIDCServerwas declared twice with different signatures (build failure); renamed the config variant tonewFakeOIDCServerWithConfig+ updated its caller.tests/integration/api_license_keys_test.go— outdatedNewRequestWithBody([]byte)→strings.NewReader(...)(10 sites).⚠️
tests/integrationis broadly pre-existing-brokenFixing the above revealed the fork's integration-test suite has drifted out of compilation across multiple files (e.g.
api_packages_composer_test.gotype mismatch, and likely more) — API changes never propagated to the tests. This is why theProject CI / Testsjob never passes: the test tree doesn't compile. Fully repairing all 242 integration test files is a separate dedicated effort, out of scope here. This PR takes the isolated/complete wins and two integration files; the rest wants its own pass.Verified:
go build ./...clean;go veton the whole tree excepttests/integration— clean (see PR discussion).https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT