-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem
Some tests depend on actual Claude Code history existing on the machine, causing them to skip in CI environments.
Evidence
conversation_test.go:9-40
func TestScanConversationMeta(t *testing.T) {
projectsDir := DefaultProjectsDir() // ~/.claude/projects
projects, err := ListProjects(projectsDir)
if err != nil {
t.Skipf("No projects found: %v", err)
}
if len(projects) == 0 {
t.Skip("No projects available")
}
// ...
}This test:
- Requires actual Claude Code history in
~/.claude/projects - Skips in CI (no Claude data)
- Skips on fresh dev machines
- Skips on machines without Claude Code installed
Impact
Tests that skip provide no value in CI - you can't verify the code works correctly in automated pipelines.
Suggested Fix
- Create test fixtures - Sample JSONL files with realistic conversation data
- Use a testdata directory - Standard Go convention for test fixtures
- Mock the filesystem or use temp directories with fixture data
- Keep existing tests but add parallel fixture-based tests that always run
Example structure:
internal/history/testdata/
projects/
-Users-test-project/
session-abc123.jsonl
agent-def456.jsonl
Files: internal/history/conversation_test.go:9-40
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels