Skip to content

[Code Quality] Add test coverage for compiler files (currently 0%) #10687

Closed

Description

@github-actions

Description

Three core compiler files totaling 2,291 lines have zero test coverage, including a critical 792-line function that is completely untested. This creates significant risk for regressions and makes refactoring dangerous.

Problem

Test files missing for:

  1. pkg/workflow/compiler_orchestrator.go (854 lines, 792-line untested function)
  2. pkg/workflow/compiler_activation_jobs.go (790 lines)
  3. pkg/workflow/compiler.go (647 lines)

Impact:

  • Cannot verify error handling paths
  • Refactoring is risky without tests
  • High risk of bugs during modifications
  • 2,291 lines of untested code

Files Affected

  • pkg/workflow/compiler_orchestrator.go:19-807 (ParseWorkflowFile function)
  • pkg/workflow/compiler_activation_jobs.go
  • pkg/workflow/compiler.go

Suggested Implementation

Phase 1: Create Test Files (Week 1)

touch pkg/workflow/compiler_test.go
touch pkg/workflow/compiler_orchestrator_test.go
touch pkg/workflow/compiler_activation_jobs_test.go

Phase 2: Priority Test Cases

compiler_orchestrator_test.go:

- TestParseWorkflowFile_ValidMainWorkflow
- TestParseWorkflowFile_SharedWorkflow
- TestParseWorkflowFile_MissingFrontmatter
- TestParseWorkflowFile_InvalidFrontmatter
- TestParseWorkflowFile_PathTraversal

compiler_test.go:

  • Expression validation tests
  • Lock file generation tests
  • Valid workflow compilation tests
  • Invalid frontmatter handling tests

compiler_activation_jobs_test.go:

  • Activation logic tests
  • Reaction handling tests
  • Permission calculation tests
  • Custom field extraction tests

Success Criteria

  • Create test files for all three compiler files
  • Achieve >50% test coverage for each file
  • Test all error paths (highest risk)
  • Add integration tests for common workflows
  • All new tests pass in CI
  • Document test patterns for future additions

Estimated Effort

2-3 weeks total:

  • Week 1: Create test infrastructure and basic tests
  • Week 2: Add comprehensive error path tests
  • Week 3: Integration tests and edge cases

Source

Extracted from Daily Compiler Code Quality Report discussion #10644

Priority

High - Required before any refactoring work can safely proceed

AI generated by Discussion Task Miner - Code Quality Improvement Agent

  • expires on Feb 2, 2026, 2:08 PM UTC

Activity

  1. github-actions commented on Jan 19, 2026

    @github-actions
    ContributorAuthor

    🍪 Issue Monster has assigned this to Copilot!

    I've identified this issue as a good candidate for automated resolution and assigned it to the Copilot agent.

    The Copilot agent will analyze the issue and create a pull request with the fix.

    Om nom nom! 🍪

    AI generated by Issue Monster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions