stability: fill test coverage gaps in write-heavy modules #7

Open
opened 2026-05-23 18:30:35 +00:00 by Klaus · 0 comments
Owner

Problem

Test files exist for pull, issue, milestone, packages, search, wiki, repo (slim/tree), pkg/params, pkg/gitea (rest/redirect), pkg/slim, and operation top-level. But several write-heavy modules have no test file at all:

  • operation/user/
  • operation/label/
  • operation/timetracking/
  • operation/notification/
  • operation/actions/ (only logs_test.goruns.go and config.go untested)
  • 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.Server standing in for Gitea. One test per public tool method covering: happy path, missing required param, propagated SDK error. The operation/pull/pull_test.go pattern is a fine starting template.

## Problem Test files exist for `pull`, `issue`, `milestone`, `packages`, `search`, `wiki`, `repo (slim/tree)`, `pkg/params`, `pkg/gitea (rest/redirect)`, `pkg/slim`, and `operation` top-level. But several write-heavy modules have **no** test file at all: - `operation/user/` - `operation/label/` - `operation/timetracking/` - `operation/notification/` - `operation/actions/` (only `logs_test.go` — `runs.go` and `config.go` untested) - `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.Server` standing in for Gitea. One test per public tool method covering: happy path, missing required param, propagated SDK error. The `operation/pull/pull_test.go` pattern is a fine starting template.
Klaus referenced this issue from a commit 2026-05-23 18:47:28 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Klaus/gitea-mcp#7