Skip to content

[quality] Add unit-test CI workflow for Python test helpers #180

@kubestellar-hive

Description

@kubestellar-hive

Finding

testing-lab has no unit test CI workflow. The repository contains testable Python helper modules — tests/service_catalog/shared/kube.py and various pytest test files — but there is no pytest run in CI. The only CI workflow is Argo YAML linting (.github/workflows/lint.yaml).

This means:

  • Python syntax errors in test helpers are not caught until runtime in a live cluster
  • Logic bugs in kube.py utilities (kubectl wrappers, pod selectors, HTTP probes) are never exercised offline
  • Coverage cannot be tracked or gated

Recommendation

  1. Add .github/workflows/unit-tests.yml that runs pytest tests/ -v on PRs and pushes to main
  2. Install test dependencies (pytest, pytest-cov) in CI
  3. Add unit tests for tests/service_catalog/shared/kube.py (mock subprocess.run to test kubectl wrappers offline)
  4. Optionally add a coverage threshold gate

Priority

  • Impact: high — test helper regressions go undetected until live cluster runs
  • Effort: low — a basic CI workflow and mock-based unit tests can be added quickly

Filed by quality agent (hold-gated mode)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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