Skip to content

[quality] Missing unit-tests CI workflow for Python helpers #177

@kubestellar-hive

Description

@kubestellar-hive

Finding

testing-lab has only a single CI workflow (lint.yaml) that validates Argo Workflow YAML files. There is no unit-tests CI workflow for the Python helpers.

Python modules with pure logic that could be unit tested without a live cluster or VM:

  • tests/service_catalog/shared/kube.py — env var defaults (TEST_NAMESPACE, TEST_APP_LABEL, etc.), run_kubectl argument construction, write_artifact path assembly, first_pod_name error path (no pods returned)
  • tests/shared/wait_for_shell.py — this is a script but the readiness loop logic and exit codes could be exercised

Without a unit-tests workflow:

  • Broken imports go undetected until a real pipeline run (slow feedback)
  • env var default logic is never validated
  • Syntax errors in step definitions only surface at runtime

Recommendation

Add .github/workflows/unit-tests.yml that:

  1. Runs on pull_request and push to main
  2. Installs pytest
  3. Runs pytest tests/ -v --ignore=tests/flatcar --ignore=tests/smoke --ignore=tests/software --ignore=tests/developer (skip suites requiring live infra)
  4. Add unit tests for service_catalog/shared/kube.py pure logic (env defaults, write_artifact, first_pod_name error path)

Priority

  • Impact: missing CI means test regressions are only caught in real pipeline runshigh
  • Effort: medium — requires new workflow file and a small test module

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