stability: fill test coverage gaps in write-heavy modules #7
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Problem
Test files exist for
pull,issue,milestone,packages,search,wiki,repo (slim/tree),pkg/params,pkg/gitea (rest/redirect),pkg/slim, andoperationtop-level. But several write-heavy modules have no test file at all:operation/user/operation/label/operation/timetracking/operation/notification/operation/actions/(onlylogs_test.go—runs.goandconfig.gountested)operation/repo/write paths (branch.go,tag.go,file.go,release.go,commit.go,repo.go)These are exactly the surfaces where a silent regression (wrong field name, broken pagination, missing required param) is most expensive.
Suggested direction
Add table-driven tests with an
httptest.Serverstanding in for Gitea. One test per public tool method covering: happy path, missing required param, propagated SDK error. Theoperation/pull/pull_test.gopattern is a fine starting template.