test: unit tests for ListOrgsAndRepos, CreateIssue, ListAllIssues, ListAllPullRequests #123

Merged
AI-Manager merged 1 commits from feature/unit-tests-122-121 into master 2026-03-28 12:02:35 +00:00
Owner

Summary

  • Add TestListOrgsAndRepos and TestListOrgsAndRepos_Cached covering map result, caching, and concurrent fan-out
  • Add TestCreateIssue, TestCreateIssue_WithLabels covering successful creation, label passthrough, RepoOwner/RepoName population, and cache invalidation
  • Add TestListAllIssues_Sorting, TestListAllIssues_StateFilter, TestListAllIssues_DefaultState, TestListAllIssues_RepoFilter, TestListAllIssues_Pagination covering sorting by UpdatedAt desc, state filter passthrough, default state, repo narrowing, and page offset
  • Add TestListAllPullRequests_Sorting, TestListAllPullRequests_StateFilter, TestListAllPullRequests_Pagination with equivalent coverage for PRs

All tests use httptest.Server mock servers with no external network calls.

Closes #122
Closes #121

Test plan

  • go test -v ./internal/gitea/... -- all 27 tests pass
  • go test -race ./internal/gitea/... -- requires gcc (not available in this container); should be validated in CI

🤖 Generated with Claude Code

## Summary - Add `TestListOrgsAndRepos` and `TestListOrgsAndRepos_Cached` covering map result, caching, and concurrent fan-out - Add `TestCreateIssue`, `TestCreateIssue_WithLabels` covering successful creation, label passthrough, RepoOwner/RepoName population, and cache invalidation - Add `TestListAllIssues_Sorting`, `TestListAllIssues_StateFilter`, `TestListAllIssues_DefaultState`, `TestListAllIssues_RepoFilter`, `TestListAllIssues_Pagination` covering sorting by UpdatedAt desc, state filter passthrough, default state, repo narrowing, and page offset - Add `TestListAllPullRequests_Sorting`, `TestListAllPullRequests_StateFilter`, `TestListAllPullRequests_Pagination` with equivalent coverage for PRs All tests use `httptest.Server` mock servers with no external network calls. Closes #122 Closes #121 ## Test plan - [x] `go test -v ./internal/gitea/...` -- all 27 tests pass - [ ] `go test -race ./internal/gitea/...` -- requires gcc (not available in this container); should be validated in CI 🤖 Generated with [Claude Code](https://claude.com/claude-code)
AI-Manager added 1 commit 2026-03-28 11:05:55 +00:00
Add comprehensive unit tests using mock HTTP servers for four key
aggregation methods in the Gitea client. Tests cover correct API
integration, caching behavior, sorting, state filtering, repo
filtering, pagination, and label handling.

Closes leeworks-agents/gitea-mobile#122
Closes leeworks-agents/gitea-mobile#121

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager merged commit 417104c617 into master 2026-03-28 12:02:35 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#123