Skip to content

Refactor: Consolidate distributed test utilities into a shared test framework #2086

@LukeAVanDrie

Description

@LukeAVanDrie

What would you like to be added:

Consider consolidating the various test utility files currently scattered across test/integration/* and pkg/*/util into a structured, shared testing library (e.g., test/framework).

Current State:

  • test/integration/util.go: Contains mixed EPP and generic logic.
  • test/integration/epp/util.go: Contains EPP-specific DSLs.
  • test/integration/bbr/util.go: Contains BBR-specific DSLs.
  • Various other util.go files exist in leaf test packages.

The Problem:

  • Discoverability: New contributors often re-implement helper functions because they cannot find the existing ones hidden in specific folders.
  • Cyclic Dependencies: As we try to share logic between the EPP suite and the BBR suite, we run into import cycles if the utils are co-located with the tests.
  • Maintenance: Updates to the harness logic require touching multiple files across the repo.

Proposed Solution:

Create a dedicated package for test helpers that acts as a comprehensive DSL for the integration suite. This involves:

  • Moving generic Kubernetes helpers (Client creation, Object cleanup) to a root test/framework.
  • Moving domain-specific helpers (EPP Builders, BBR Builders) to subpackages (e.g. test/framework/epp).

Why is this needed:

  • To improve developer velocity by providing a discoverable, documented test DSL.
  • To prevent code duplication across the EPP and BBR test suites.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions