Skip to content

test(e2e):Run controller in e2e tests process, dump namespace obejcts and pod logs on failure.#140

Merged
GrigoryPervakov merged 1 commit intomainfrom
e2e-chores
Mar 31, 2026
Merged

test(e2e):Run controller in e2e tests process, dump namespace obejcts and pod logs on failure.#140
GrigoryPervakov merged 1 commit intomainfrom
e2e-chores

Conversation

@GrigoryPervakov
Copy link
Copy Markdown
Member

@GrigoryPervakov GrigoryPervakov commented Mar 20, 2026

Why

Flaky CI runs are almost impossible to debug without additional details. These changes are intended to make it more stable and faster, and make logs less noisy.

What

  • Run controller in e2e process
  • Inject a custom Dialer to allow the controller to connect to pods from outside
  • Added post e2e fail dumps of logs and manifests
  • Refactored helm tests to deploy tests, and reused them instead of compatibility checks. Now it is a single test suite that verifies that different operator deployments correctly manage different CH versions.
  • Few logging enhancements

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make flaky CI e2e failures debuggable by running the controllers in-process during e2e tests, introducing a custom dialer for reaching pods via API-server port-forward streams, and dumping namespace resources/pod logs/events on test failure.

Changes:

  • Run controller-runtime manager/controllers inside the e2e test process and inject a custom DialContextFunc for pod connectivity.
  • Add failure-time diagnostics dumping (namespace resources, pod logs, events) into a report directory.
  • Replace/remove prior helm/compat-focused e2e coverage with a new deploy-focused Ginkgo suite (manifests/OLM/Helm deployment checks).

Reviewed changes

Copilot reviewed 41 out of 43 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
test/testutil/utils.go Adds namespace diagnostics dump helpers, CRD install/uninstall helpers, and namespace lifecycle utility.
test/testutil/keeper_client.go Switches Keeper test client to injected dialer + static host provider (no port-forward subprocess).
test/testutil/dialer.go Introduces SPDY port-forward based DialContextFunc for connecting to pod hostnames.
test/testutil/clickhouse_client.go Switches ClickHouse test client to injected dialer (removes port-forward subprocess dependency).
test/helm/helm_test.go Removes old helm Ginkgo suite.
test/e2e/keeper_e2e_test.go Updates keeper e2e to per-spec namespaces + in-process controller + dialer-based clients + updated rollout assertions.
test/e2e/e2e_suite_test.go Runs controller manager in-process, installs/uninstalls CRDs, and dumps diagnostics on spec failure.
test/e2e/compatibility_e2e_test.go Removes old compatibility e2e suite.
test/e2e/clickhouse_e2e_test.go Updates clickhouse e2e to per-spec namespaces + dialer-based clients + updated rollout assertions.
test/deploy/olm_manifests.yaml Adds OLM catalog/server manifests template for deploy tests.
test/deploy/deploy_test.go Adds new deployment test suite covering install.yaml, OLM, and Helm deployments across versions.
internal/upgrade/upgrade_test.go Updates tests to use exported channel constants.
internal/upgrade/fetcher.go Switches internal channel constant references to exported names.
internal/upgrade/checker.go Exposes ChannelStable/ChannelLTS constants and updates channel checks accordingly.
internal/controllerutil/dialer.go Adds DialContextFunc type for dependency injection.
internal/controller/testutil/suite.go Adjusts staticcheck lint suppression for dot-imports.
internal/controller/status.go Exports SetStatusCondition, refines conflict retry logic, and normalizes transition timestamps.
internal/controller/resources.go Adds comment clarifying non-fatal PVC update failures during reconcile.
internal/controller/reconcilerbase.go Extends controller interface to provide a dialer (GetDialer).
internal/controller/keeper/templates_test.go Updates tests away from ptr.To(...) usage.
internal/controller/keeper/templates.go Updates StatefulSet template pointer fields (replicas/revision history).
internal/controller/keeper/sync_test.go Injects a disabled dialer into keeper reconciler tests.
internal/controller/keeper/sync.go Uses injected dialer to query keeper status; skips status checks if STS not ready.
internal/controller/keeper/controller_test.go Injects a disabled dialer into keeper controller tests and updates pointer fields.
internal/controller/keeper/controller.go Threads dialer through controller setup and uses shared SetStatusCondition.
internal/controller/keeper/commands.go Adds dialer injection for keeper connections (TLS wrapping applied after dialing).
internal/controller/clickhouse/templates_test.go Updates tests away from ptr.To(...) usage.
internal/controller/clickhouse/templates.go Updates StatefulSet template pointer fields (replicas/revision history).
internal/controller/clickhouse/sync.go Uses injected dialer in commander and skips status probes when STS not ready; improves reconcile condition handling.
internal/controller/clickhouse/controller_test.go Injects a disabled dialer into clickhouse controller tests and updates pointer fields.
internal/controller/clickhouse/controller.go Threads dialer through controller setup and uses shared SetStatusCondition.
internal/controller/clickhouse/commands.go Wires dialer into clickhouse-go connection options for management port.
go.mod Moves golang.org/x/net to indirect; removes explicit websocket indirect entry.
go.sum Removes old websocket sums no longer referenced.
dev.Dockerfile Runs manager image as non-root user.
config/manifests/bases/clickhouse-operator.clusterserviceversion.yaml Improves CSV descriptor wording and adds Version status descriptors.
cmd/main.go Updates controller setup calls to pass dialer (nil in production).
bundle.Dockerfile Updates operator-sdk metrics builder label version.
Tiltfile Uses dev.Dockerfile for local image builds.
Makefile Replaces removed helm/compat test targets with deploy-based compatibility target; fixes catalog-render phony/typo.
.golangci.yml Configures staticcheck dot-import whitelist for Ginkgo/Gomega.
.gitignore Ignores generated dist/install.yaml.
.github/workflows/ci.yaml Removes helm test job steps; updates artifact collection paths to upload full report directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GrigoryPervakov GrigoryPervakov force-pushed the e2e-chores branch 10 times, most recently from d4c07f4 to 1be1d8d Compare March 31, 2026 13:22
@GrigoryPervakov GrigoryPervakov marked this pull request as ready for review March 31, 2026 14:08
@GrigoryPervakov GrigoryPervakov merged commit 544d4f5 into main Mar 31, 2026
16 checks passed
@GrigoryPervakov GrigoryPervakov deleted the e2e-chores branch March 31, 2026 14:09
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.

2 participants