Daily Test Coverage Improver #7
daily-test-improver.lock.yml
on: schedule
Annotations
4 errors and 2 warnings
|
agent
GetWorkflowDir()** | 0.0% | 100.0% | +100.0% |\n| **pkg/constants package** | 0.0% | 100.0% | +100.0% |\n\n**Note**: Overall coverage shows 65.9% (down from 66.1%) due to pre-existing test failures in `pkg/cli` package (unrelated to this PR). The failures are caused by missing `node` executable and permission issues with `/home/user` directory in the test environment.\n\nWhen those pre-existing failures are resolved, the overall coverage will reflect the improvements from this PR.\n\n## Replicating the Test Coverage Measurements\n\n```bash\ncd /home/runner/work/gh-aw/gh-aw\n\n# Before measurements (on main branch)\ngo test -coverprofile=coverage-before.out -covermode=atomic ./...\ngo tool cover -func=coverage-before.out | grep \"ci.go.*IsRunningInCI\"\n# Output: pkg/cli/ci.go:6: IsRunningInCI 0.0%\n\ngo tool cover -func=coverage-before.out | grep \"constants.go.*GetWorkflowDir\"\n# Output: pkg/constants/constants.go:329: GetWorkflowDir 0.0%\n\n# After measurements (with this PR)\ngo test -coverprofile=coverage-after.out -covermode=atomic ./...\ngo tool cover -func=coverage-after.out | grep \"ci.go.*IsRunningInCI\"\n# Output: pkg/cli/ci.go:6: IsRunningInCI 100.0%\n\ngo tool cover -func=coverage-after.out | grep \"constants.go.*GetWorkflowDir\"\n# Output: pkg/constants/constants.go:329: GetWorkflowDir 100.0%\n\n# Package-level coverage\ngo test -coverprofile=coverage-after.out -covermode=atomic ./pkg/constants\n# Output: ok github.com/githubnext/gh-aw/pkg/constants 0.004s coverage: 100.0% of statements\n```\n\n## Possible Other Areas for Future Improvement\n\nBased on my coverage analysis, here are the next high-value targets for test additions:\n\n**Zero-Coverage Pure Functions** (sorted by complexity):\n1. **`pkg/cli/shared_utils.go`** - 0% coverage\n - Likely contains utility functions\n - Worth investigating for simple testable logic\n\n2. **`pkg/cli/jq.go`** - 0% coverage\n - JSON query utilities\n - May require jq binary but logic can be tested\n\n3. **`pkg/cli/status.go`** - 0% coverage\n - Workflow status checking\n - Some functions may be pure logic\n\n**Low-Coverage Functions** (can be improved):\n4. **`pkg/cli/remove_command.go:RemoveWorkflows()`** - 5.3% coverage\n - Core command implementation\n - Some paths may be testable without full integration\n\n5. **`pkg/workflow/compiler_jobs.go:buildCustomJobs()`** - 7.1% coverage\n - Workflow compilation logic\n - May have testable edge cases\n\n6. **`pkg/cli/run_command.go:RunWorkflowOnGitHub()`** - 8.7% coverage\n - Command implementation\n - Error handling paths may be testable\n\nThese represent opportunities for incremental coverage improvements focusing on pure logic and error handling paths.\n\n## Verification\n\nAll new tests run successfully:\n```bash\ncd /home/runner/work/gh-aw/gh-aw\n\n# Run specific new tests\ngo test -v ./pkg/cli -run TestIsRunningInCI\n# PASS: All 7 test cases passed\n\ngo test -v ./pkg/constants\n# PASS: All test cases passed\n\n# Format code\nmake fmt\n```\n\n---\n\n<details>\n<summary>Bash Commands Run</summary>\n\n```bash\n# Created new branch\ngit checkout -b test-coverage-ci-and-constants-1761705498\n\n# Created test files\n# - pkg/cli/ci_test.go\n# - pkg/constants/constants_test.go\n\n# Ran tests\ngo test -v ./pkg/cli -run TestIsRunningInCI\ngo test -v ./pkg/constants\n\n# Generated coverage\ngo test -coverprofile=coverage-new.out -covermode=atomic ./...\n\n# Compared coverage\ngo tool cover -func=coverage.out | grep \"ci.go\"\ngo tool cover -func=coverage-new.out | grep \"ci.go\"\ngo tool cover -func=coverage.out | grep \"constants.go\"\ngo tool cover -func=coverage-new.out | grep \"constants.go\"\n\n# Formatted code\nmake fmt\n\n# Reset unrelated lock file changes\ngit checkout -- .github/workflows/*.lock.yml\n\n# Committed changes\ngit add pkg/cli/ci_test.go pkg/constants/constants_test.go\ngit commit -m \"Add unit tests for CI detection and constants...\"\n```\n</details>\n\n<details>\n<summary>Web Searches Performed</summary>\n\nNone - this work was based on static code analysis of the existing codeba
|
|
agent
Errors detected in agent logs - continuing workflow step (not failing for now)
|
|
agent
Line 5: Request to GitHub API at https://api.enterprise.githubcopilot.com/agents/swe/custom-agents/githubnext/gh-aw?exclude_invalid_config=true failed with status 404 (request ID: 6C20:1EAC42:451687A:51DFB57:69017DBC), body: Not Found (Pattern: Copilot CLI timestamped ERROR messages, Raw log: 2025-10-29T02:36:45.680Z [ERROR] Request to GitHub API at https://api.enterprise.githubcopilot.com/agents/swe/custom-age...)
|
|
agent
Process completed with exit code 2.
|
|
agent
Line 9: could not load remote agents for githubnext/gh-aw: server returned 404: (Pattern: Copilot CLI timestamped WARNING messages, Raw log: 2025-10-29T02:36:45.681Z [WARNING] could not load remote agents for githubnext/gh-aw: server returned 404:)
|
|
agent
Line 7: Failed to load custom agents for githubnext/gh-aw: Not Found (Pattern: Copilot CLI timestamped WARNING messages, Raw log: 2025-10-29T02:36:45.681Z [WARNING] Failed to load custom agents for githubnext/gh-aw: Not Found)
|