Skip to content

test: organize unit, integration, and E2E suites - #414

Open
amuraru wants to merge 7 commits into
mainfrom
refactor/test-architecture
Open

amuraru wants to merge 7 commits into
mainfrom
refactor/test-architecture

Conversation

@amuraru

@amuraru amuraru commented Dec 2, 2026

Copy link
Copy Markdown

Description

CI currently repeats the unit tests on both Kubernetes versions, and the integration suites live in several directories. Separate the jobs by what they need to run:

  • Keep Go unit tests next to their packages. make test-unit runs them once in CI, including the local dependency modules and E2E helper tests.
  • Move the four Koperator integration suites to tests/integration/. Keep them and the downstream reconciler suite on both supported Kubernetes versions. Preserve the root coverage report and the license-header checks.
  • Use one list of named E2E scenarios for both individual runs and the full suite. For example, make test-e2e E2E_SCENARIO=batched-broker-removal runs that scenario with its own setup and teardown. See Testing Koperator.

The Cluster Registry tests now observe the correct controller and verify that owned objects do not trigger reconciliation. The broker-removal scenario checks that one Cruise Control operation completes for both brokers, the removed brokers' volume claims disappear, and the remaining brokers are ready. The alert validator also stores all failures under a named error detail so callers can read them.

Type of Change

  • Bug Fix
  • Refactor
  • Documentation

Validation

  • make check license-header-check passed.
  • make test-unit passed without Kubernetes binaries.
  • make test-integration passed on Kubernetes 1.35.0 and 1.37.0.
  • The Cluster Registry suite passed with the race detector. The ownership test failed when the Cruise Control watch filter was deliberately removed.
  • The full E2E suite and all five individual selections passed dry runs. Batched broker removal passed all 44 specs on live Kind with Kubernetes 1.35.0, including teardown. The full live E2E matrix is left to CI.

Checklist

  • I have read the contributing guidelines
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests

Store validation messages under a named key and test that the validator
reports failures from more than one alert check.
Group envtest suites under tests/integration and run cluster-free tests
separately in CI, including the local dependency modules. Exercise the
correct Cluster Registry watch and retain coverage and license checks.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant