test(e2e):Run controller in e2e tests process, dump namespace obejcts and pod logs on failure.#140
Merged
GrigoryPervakov merged 1 commit intomainfrom Mar 31, 2026
Merged
Conversation
6d4a5f4 to
919e171
Compare
919e171 to
3602ab0
Compare
There was a problem hiding this comment.
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
DialContextFuncfor 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.
d4c07f4 to
1be1d8d
Compare
… and pod logs on failure.
1be1d8d to
ea8b4ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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