Skip to content

[Code Quality] Create missing test file for compiler_yaml_main_job.go #14229

@github-actions

Description

@github-actions

Description

The compiler_yaml_main_job.go file (612 lines) lacks a dedicated test file, making it harder to validate edge cases and regression test specific behaviors. Main job generation is a critical path in workflow compilation and needs direct unit tests.

Current State

  • File: pkg/workflow/compiler_yaml_main_job.go (612 lines)
  • Test File: Missing - currently tested only indirectly via integration tests
  • Impact: Harder to validate edge cases, regression testing relies on slow integration tests

Suggested Changes

  1. Create test file: pkg/workflow/compiler_yaml_main_job_test.go
  2. Test repository import checkout generation
    • Test parsing of owner/repo@ref format
    • Test multiple repository imports
    • Test invalid import specifications
  3. Test runtime deduplication logic
    • Test duplicate runtime detection
    • Test runtime version merging
  4. Test custom steps insertion
    • Test steps are inserted at correct positions
    • Test custom step ordering

Files Affected

  • pkg/workflow/compiler_yaml_main_job_test.go (new file, ~200-300 lines)

Success Criteria

  • Test file created with at least 5-7 test functions
  • Test coverage ratio ≥0.8:1 (target: ~500 test lines for 612 source lines)
  • All existing tests continue to pass
  • Tests use table-driven pattern with t.Run()
  • Tests include both success and error cases

Priority

High - Main job generation is critical path, needs direct testing

Estimated Effort

2-4 hours

Source

Extracted from:

Mentioned as high-priority recommendation in both compiler quality reports.

AI generated by Discussion Task Miner - Code Quality Improvement Agent

  • expires on Feb 7, 2026, 9:07 PM UTC

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions