-
Notifications
You must be signed in to change notification settings - Fork 304
Closed
Labels
Description
Description
The compiler_jobs.go file has solid error handling (16/16 proper wraps) but below-target test coverage. With a test-to-source ratio of 0.47:1 (target: 0.8:1+), complex orchestration logic may have untested edge cases.
Current State
- File:
pkg/workflow/compiler_jobs.go(460 lines) - Test File:
compiler_jobs_test.go(215 lines, 7 test functions) - Current Ratio: 0.47:1 (215 test lines / 460 source lines)
- Target Ratio: 0.8:1+ (recommended for complex orchestration)
- Quality Score: 84/100 (good, but test coverage could improve)
Suggested Changes
Add table-driven tests focusing on:
-
Custom Job Dependency Resolution
- Test jobs depending on pre-activation
- Test jobs with multiple dependencies
- Test circular dependency prevention
-
Job Ordering Scenarios
- Test job execution order with various dependency chains
- Test push_repo_memory job dependency on detection
- Test cache_memory job positioning
-
Edge Cases
- Empty custom jobs array
- Jobs referencing custom job outputs
- Jobs with invalid dependencies
- Jobs with missing required fields
-
Job Manager State Validation
- Verify job manager state after complex builds
- Validate job.Needs relationships are correct
- Test permission calculations for different job types
Files Affected
pkg/workflow/compiler_jobs_test.go(expand from 215 to ~350-400 lines)
Success Criteria
- Test-to-source ratio increased to 0.8:1+ (350+ test lines)
- New tests cover dependency resolution logic
- New tests cover job ordering scenarios
- New tests cover edge cases
- All existing and new tests pass
- Tests follow table-driven pattern with
t.Run() - Run
make test-unitsuccessfully
Test Example Pattern
func TestCustomJobDependencyResolution(t *testing.T) {
tests := []struct {
name string
customJobs map[string]any
expectedOrder []string
expectedDeps map[string][]string
}{
{
name: "job depending on pre-activation",
customJobs: map[string]any{
"custom-job": map[string]any{
"needs": "pre-activation",
"steps": []any{...},
},
},
expectedOrder: []string{"pre-activation", "custom-job"},
expectedDeps: map[string][]string{
"custom-job": {"pre-activation"},
},
},
// More test cases...
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Test implementation
})
}
}Source
Extracted from Daily Compiler Code Quality Report:
- Discussion #14159 (2026-02-06)
Priority
Medium - Complex orchestration logic benefits from comprehensive tests. Estimated 2-4 hours of work.
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 7, 2026, 5:13 PM UTC
Reactions are currently unavailable
Metadata
Metadata
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.