Skip to content

test: Improve unit test coverage across packages #89

@Defilan

Description

@Defilan

Summary

Current unit test coverage is low across several packages. While E2E tests cover integration scenarios, improved unit test coverage would help catch regressions earlier and make the codebase more maintainable.

Current Coverage

From CI output:

Package Coverage
internal/controller 33.9%
pkg/cli 10.4%
api/v1alpha1 0%
cmd/* 0%
pkg/agent 0%

Proposed Improvements

  1. Establish baseline - Document current coverage and set realistic targets
  2. Prioritize critical paths - Focus on controller reconciliation and CLI commands
  3. Add coverage reporting - Consider Codecov or similar for PR coverage diffs
  4. Update CONTRIBUTING.md - Add guidance on test expectations for new code

Areas to Focus

  • Controller reconciliation logic (highest priority)
  • CLI command parsing and validation
  • Catalog loading and model lookup
  • CRD validation and defaulting
  • Error handling paths

Notes

For early-stage projects with heavy K8s integration, E2E tests often provide more value than unit test percentages. This issue is about improving coverage incrementally, not blocking PRs on arbitrary thresholds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions