Consolidate all tests into functional_test.go — remove duplicate new_commands_test.go. Replace SDK-only tests with actual CLI binary invocations. Add missing coverage for: issue list, issue view, issue comment, issue create, issue edit title, repo view, repo list, release view, --json flag on issue list/view and pr list. All tests now use -R flag consistently. 35 pass, 0 fail, 3 expected skips (pr view/diff need PRs, clone needs auth). |
||
|---|---|---|
| .. | ||
| fixtures.go | ||
| functional_test.go | ||
| README.md | ||
Functional Tests
End-to-end tests that make real API calls to a Codeberg instance.
Running Tests
These tests require special setup and credentials.
Quick Start
export CODEBERG_TEST_TOKEN="your_token"
export CODEBERG_TEST_OWNER="test-account-username"
export CODEBERG_TEST_REPO="test-repo-name"
go test -v -race -tags=functional ./...
What They Test
- ✅ API authentication and connectivity
- ✅ Repository listing and details
- ✅ Issue creation, listing, retrieval
- ✅ Issue comments
- ✅ API error handling
- ✅ Repository secrets and actions (if available)
CI Integration
These tests run automatically in CI when configured:
- Only on
mainbranch and pull requests - Requires
CODEBERG_TEST_TOKENsecret and configuration variables - Uses a dedicated test account (not your personal account)
Files
functional_test.go- Test suite with all test casesfixtures.go- Helper functions and test environment setup