test: add comprehensive unit tests and CI workflow#146
Merged
renato0307 merged 3 commits intomainfrom Feb 1, 2026
Merged
Conversation
Add unit tests for: - Branch name validation and sanitization (git adapter) - Session name sanitization (domain) - Git URL parsing and comparison (git adapter) - Notification service event handling and execution ID resolution - Token stats service caching and aggregation - Session service delete and rename operations - JSONL parser for token usage extraction Also includes: - GitHub Actions workflow for running tests on PRs - Updated mockery config with new interfaces - Updated testing.md with unit test guidelines
- Regenerate mocks to include UpdateExecutionID method - Use go-version-file instead of hardcoded version in workflow - Make lint job continue-on-error for Go version compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test Coverage
New Test Files
internal/adapters/git/sanitize_test.go- Branch name validation/sanitizationinternal/adapters/git/repo_test.go- Git URL parsing and comparisoninternal/domain/session_test.go- Session name sanitizationinternal/services/notification_test.go- Event handling, execution ID resolutioninternal/services/token_stats_test.go- Cache behavior, hourly aggregationinternal/services/session_test.go- Extended with delete/rename testsinternal/adapters/claude/session_parser_test.go- JSONL parsingCI Workflow
The new
.github/workflows/test.ymlruns on PRs to main:Test plan
go test ./internal/... -coverruns successfully