Skip to content

[Code Quality] Add unit tests for compiler_pre_activation_job.go (956 lines, 0 tests) #46755

Description

@github-actions

Description

compiler_pre_activation_job.go is a 956-line file with 40 functions and zero test coverage. This is the largest coverage gap in the compiler package, flagged in the Daily Compiler Code Quality report with a score of 68/100 — the lowest in the package primarily due to missing tests.

Suggested Changes

  • Create compiler_pre_activation_job_test.go
  • Prioritize tests for the highest-risk exported and internally-coupled functions:
    • buildPreActivationJob
    • injectPreActivationOnSteps
    • extractPreActivationCustomFields
  • Achieve ≥ 60% line coverage as a baseline, targeting 80%+
  • Use table-driven tests consistent with the rest of the compiler package

Files Affected

  • pkg/compiler/compiler_pre_activation_job.go (956 lines, 40 functions — no test file)
  • pkg/compiler/compiler_pre_activation_job_test.go (new file)

Success Criteria

  • compiler_pre_activation_job_test.go exists and passes make test
  • Line coverage ≥ 60% for the file
  • No regressions in existing tests
  • Quality score for the file improves from 68 → 80+

Source

Extracted from [daily-compiler-quality] Daily Compiler Code Quality Report - 2026-07-20

Priority

High — 956-line file with zero tests is the highest-risk coverage gap in the compiler package

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 44.8 AIC · ⌖ 7.87 AIC · ⊞ 7K ·

  • expires on Jul 20, 2026, 11:50 PM UTC-08:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions