docs(design): unified Go/Ginkgo E2E test suite#346
docs(design): unified Go/Ginkgo E2E test suite#346xgerman wants to merge 10 commits intodocumentdb:mainfrom
Conversation
|
Suggestion: Remove internal version references (v4/v5) from the design doc The "v4" and "v5" labels are internal drafting artifacts that have no meaning to a new reviewer. Specific issues:
Suggested changes:
The spike findings section already tells the story clearly: "we investigated CNPG's test utils, found ~20 packages reusable, so we chose Go." That's all a reviewer needs. The iteration history belongs in commit messages, not the design doc. |
|
Thanks for the feedback @WentingWu666666 — applied in 100b583:
No remaining v4/v5 references in the doc. Ready for further feedback. |
Replaces the four legacy end-to-end workflows (test-integration.yml, test-E2E.yml, test-backup-and-restore.yml, test-upgrade-and-rollback.yml) and their bash/mongosh/pymongo glue with a single Go/Ginkgo v2/Gomega suite under test/e2e/. Highlights: - test/e2e/ Go module with pkg/e2eutils/ helpers (testenv, namespaces, portforward, fixtures, mongo, seed, assertions, timeouts, tlscerts) - specs organised by CRD area: lifecycle, scale, data, performance, backup, tls, feature-gates, exposure, status, upgrade - labels in test/e2e/labels.go (areas + smoke/basic/destructive/ disruptive/slow + needs-* capability labels) - TEST_DEPTH=0..4 (Highest..Lowest) selects spec density - fixtures pipeline: renderDocumentDB preprocesses templates with documentdb.DropEmptyVarLines before envsubst to tolerate empty vars (CNPG's envsubst treats empty as missing) - image architecture preserved: CNPG pg18 base + DocumentDB extension via image-library + independent gateway sidecar — harness leaves image env vars empty so operator composes layered defaults - upgrade/image spec requires explicit old/new env vars for both extension and (optionally) gateway — never conflates the two - lifecycle/update_image spec skips unless E2E_DOCUMENTDB_IMAGE_NEXT is a genuinely different tag from DOCUMENTDB_IMAGE (no silent no-op) - new .github/workflows/test-e2e.yml is the single PR-level gate - three release_*.yml workflows no longer reference the deleted legacy test workflows; dead run_tests inputs removed from release_operator.yml / release_images.yml Design: docs/designs/e2e-test-suite.md Runbook: test/e2e/README.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ager renewal Rationale from PR documentdb#346 gate: 'Ready=true' + a bare reconcile success alone can mask a broken gateway sidecar or a cert chain that only validates at issue-time. Add two minimal data-plane probes: 1. lifecycle/deploy: after the 1-instance cluster reaches Ready and owner-refs are verified, open a mongo-driver v2 client via the existing NewFromDocumentDB helper (port-forward + credentials) and Ping. Covers the 'the gateway actually answers' invariant during the most common bring-up path. 2. tls/cert-manager: after the initial CA-verified ping succeeds, trigger a reissue by deleting the cert-manager-generated Secret, wait for a new tls.crt to land, and reconnect with the freshly extracted CA. With the self-signed Issuer used here this exercises a full leaf+CA rotation, so a passing re-ping proves the gateway remounted the renewed material rather than serving a pinned copy. Both use mongohelper.Ping — the canonical 'hello' probe — so the existing connect retry + TLS verification paths are reused without introducing bespoke command builders. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds design doc for consolidating the four existing E2E workflows (test-integration, test-E2E, test-backup-and-restore, test-upgrade-and-rollback) into a single Ginkgo v2 + Gomega + go.mongodb.org/mongo-driver/v2 suite that reuses ~20 CNPG tests/utils packages. Key decisions for discussion: - Go + Ginkgo over Python + pytest (spike found large CNPG util reuse) - Per-area package layout under test/e2e/tests/ - Shared session cluster for read-only tests (data/perf/status) with per-spec Mongo DB isolation - Fresh DocumentDB per spec for mutating tests (lifecycle/tls/backup/upgrade) - Lazy MinIO session fixture, imported directly from CNPG - Operator-health gate auto-skips non-disruptive specs on operator churn - Label + imported-level (TEST_DEPTH) selection See doc for full fixture tiers, parallelism strategy, CI layout, and 28-item implementation plan. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address review feedback: the design doc should read as a current-state proposal, not a diff log. Remove version labels from headings and drop the 'v5 changes vs v4' section since the Spike Findings section already tells the story. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replaces the four legacy end-to-end workflows (test-integration.yml, test-E2E.yml, test-backup-and-restore.yml, test-upgrade-and-rollback.yml) and their bash/mongosh/pymongo glue with a single Go/Ginkgo v2/Gomega suite under test/e2e/. Highlights: - test/e2e/ Go module with pkg/e2eutils/ helpers (testenv, namespaces, portforward, fixtures, mongo, seed, assertions, timeouts, tlscerts) - specs organised by CRD area: lifecycle, scale, data, performance, backup, tls, feature-gates, exposure, status, upgrade - labels in test/e2e/labels.go (areas + smoke/basic/destructive/ disruptive/slow + needs-* capability labels) - TEST_DEPTH=0..4 (Highest..Lowest) selects spec density - fixtures pipeline: renderDocumentDB preprocesses templates with documentdb.DropEmptyVarLines before envsubst to tolerate empty vars (CNPG's envsubst treats empty as missing) - image architecture preserved: CNPG pg18 base + DocumentDB extension via image-library + independent gateway sidecar — harness leaves image env vars empty so operator composes layered defaults - upgrade/image spec requires explicit old/new env vars for both extension and (optionally) gateway — never conflates the two - lifecycle/update_image spec skips unless E2E_DOCUMENTDB_IMAGE_NEXT is a genuinely different tag from DOCUMENTDB_IMAGE (no silent no-op) - new .github/workflows/test-e2e.yml is the single PR-level gate - three release_*.yml workflows no longer reference the deleted legacy test workflows; dead run_tests inputs removed from release_operator.yml / release_images.yml Design: docs/designs/e2e-test-suite.md Runbook: test/e2e/README.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ager renewal Rationale from PR documentdb#346 gate: 'Ready=true' + a bare reconcile success alone can mask a broken gateway sidecar or a cert chain that only validates at issue-time. Add two minimal data-plane probes: 1. lifecycle/deploy: after the 1-instance cluster reaches Ready and owner-refs are verified, open a mongo-driver v2 client via the existing NewFromDocumentDB helper (port-forward + credentials) and Ping. Covers the 'the gateway actually answers' invariant during the most common bring-up path. 2. tls/cert-manager: after the initial CA-verified ping succeeds, trigger a reissue by deleting the cert-manager-generated Secret, wait for a new tls.crt to land, and reconnect with the freshly extracted CA. With the self-signed Issuer used here this exercises a full leaf+CA rotation, so a passing re-ping proves the gateway remounted the renewed material rather than serving a pinned copy. Both use mongohelper.Ping — the canonical 'hello' probe — so the existing connect retry + TLS verification paths are reused without introducing bespoke command builders. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…olish Addresses code-review-agent findings on 07fec09: - critical: shared renewCtx in the Eventually closure could exhaust the MongoConnect budget on the first iteration, starving later retries. Use per-iteration attemptCtx and widen the outer poll window to DocumentDBReady so cert-manager + gateway remount have real time to converge. - bytes.Clone replaces the ad-hoc make+append pattern for origCrt. - extra By(...) markers around reissue/reconnect make the failure narrative obvious. - clarifying comment on the explicit Ping in lifecycle/deploy documenting why we keep it despite NewFromDocumentDB pinging internally. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ChangeStreams is an experimental DocumentDB feature that requires the -changestream image variant, which is not part of the default e2e image set. Running the wal_level-translation assertion on the default image implied support the shipped pipeline cannot honour, so this change: - removes tests/feature_gates/changestreams_test.go - removes manifests/mixins/feature_changestreams.yaml.template - removes the corresponding render check in pkg/e2eutils/fixtures/fixtures_test.go - leaves a TODO in feature_gates_suite_test.go and at the fixtures deletion site explaining status and the steps to re-enable (capability label + preflight + best-effort mongo Watch on top). Operator API (previewv1.FeatureGateChangeStreams) and the operator's wal_level=logical translation are untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e Ping
Strengthen connection_string_test with a four-layer assertion:
1. Shape (existing AssertConnectionStringMatches helper).
2. Template: assert the secret name in the $(kubectl get secret …)
userinfo matches the CR's credentials secret, catching drift
between the status template and the actual secret.
3. Semantic: regex-split userinfo from the URI (url.Parse can't handle
the shell subshell in userinfo) and assert host, port, and query
params (tls, replicaSet, optional tlsAllowInvalidCertificates)
against the published Service and status.TLS state.
4. Live: open a port-forward to the gateway Service and Ping via
mongo.NewFromDocumentDB, proving the advertised string is not just
well-formed but actually usable.
Covers the failure mode where status.connectionString parses but points
at the wrong host/port/params, which the previous shape-only check
silently allowed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: German <geeichbe@microsoft.com>
The documentdb org tracks issue priority via the single-select 'Priority' field on project boards documentdb#6 and documentdb#4 (options P0/P1/P2), not via repo labels. Record the project/field/option IDs and the gh CLI workflow so future assistants don't invent P0 labels that drift from the actual triage signal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: German <geeichbe@microsoft.com>
Record the DCO requirement and the rebase-exec recipe for retrofitting Signed-off-by trailers, so future assistants don't ship commits that the DCO bot will block on the PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: German <geeichbe@microsoft.com>
6fc1356 to
de201de
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces (and documents) a unified Go/Ginkgo-based E2E test suite under test/e2e/, replacing the legacy multi-workflow + bash/JS/Python E2E approach across the repository’s CI and contributor docs.
Changes:
- Add a new
test/e2e/Go/Ginkgo suite with per-area test packages (lifecycle/scale/data/performance/tls/status/exposure/feature-gates/upgrade), shared fixtures, and reusable helper utilities. - Add embedded and templated manifests (
test/e2e/manifests) plus helper packages (timeouts, port-forwarding, TLS cert generation, namespaces, operator health gating, etc.). - Remove legacy integration workflow and python glue; update docs/changelog and adjust release workflows to assume the unified E2E workflow gate.
Reviewed changes
Copilot reviewed 115 out of 127 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/tests/upgrade/upgrade_suite_test.go | Upgrade area Ginkgo suite bootstrap/teardown. |
| test/e2e/tests/upgrade/upgrade_control_plane_test.go | Upgrade control-plane E2E scenario (helm uninstall/install/upgrade + data retention check). |
| test/e2e/tests/upgrade/rollback_test.go | Placeholder/pending rollback spec to document future intent. |
| test/e2e/tests/upgrade/helpers_test.go | Upgrade-area env gating and helper utilities (helm presence, manifests path, namespace/secret helpers). |
| test/e2e/tests/tls/tls_suite_test.go | TLS area Ginkgo suite + operator-unchanged gate. |
| test/e2e/tests/tls/tls_selfsigned_test.go | TLS self-signed mode E2E coverage. |
| test/e2e/tests/tls/tls_provided_test.go | TLS provided-secret mode E2E coverage (custom CA + hostname verification). |
| test/e2e/tests/tls/tls_disabled_test.go | TLS disabled mode E2E coverage. |
| test/e2e/tests/status/status_suite_test.go | Status area Ginkgo suite + operator-unchanged gate. |
| test/e2e/tests/status/pv_name_test.go | Status validation for PVC discovery via CNPG labels (CRD discrepancy handling). |
| test/e2e/tests/status/mount_options_test.go | Status validation for PGDATA mount presence on CNPG pods (CRD discrepancy handling). |
| test/e2e/tests/scale/scale_up_test.go | Scale-up scenarios using shared scale fixture + CNPG primary checks. |
| test/e2e/tests/scale/scale_suite_test.go | Scale area Ginkgo suite + operator-unchanged gate. |
| test/e2e/tests/scale/scale_down_test.go | Scale-down scenarios including primary re-election health assertion. |
| test/e2e/tests/performance/performance_suite_test.go | Performance area Ginkgo suite + operator-unchanged gate. |
| test/e2e/tests/performance/perf_update_test.go | Bulk update performance tripwire spec. |
| test/e2e/tests/performance/perf_sort_test.go | Indexed sort performance tripwire spec. |
| test/e2e/tests/performance/perf_insert_test.go | Bulk insert performance tripwire spec. |
| test/e2e/tests/performance/perf_helpers_test.go | Shared RO connection + per-spec DB + latency logging helpers for perf specs. |
| test/e2e/tests/performance/perf_delete_drop_test.go | Bulk delete + drop performance tripwire spec. |
| test/e2e/tests/performance/perf_count_range_test.go | Indexed range count performance tripwire spec. |
| test/e2e/tests/performance/perf_aggregation_test.go | Aggregation pipeline performance tripwire spec. |
| test/e2e/tests/lifecycle/update_storage_test.go | Lifecycle storage resize spec (with storageclass capability probe). |
| test/e2e/tests/lifecycle/update_loglevel_test.go | Lifecycle logLevel patch propagation spec. |
| test/e2e/tests/lifecycle/update_image_test.go | Lifecycle documentDBImage rollout spec. |
| test/e2e/tests/lifecycle/lifecycle_suite_test.go | Lifecycle area Ginkgo suite + operator-unchanged gate. |
| test/e2e/tests/lifecycle/helpers_test.go | Lifecycle helper utilities (vars, namespace/secret creation, refetch helper). |
| test/e2e/tests/lifecycle/deploy_test.go | Lifecycle deploy smoke + ownerRef check + mongo connectivity smoke. |
| test/e2e/tests/lifecycle/delete_reclaim_test.go | Lifecycle reclaim-policy Retain behavior validation. |
| test/e2e/tests/feature_gates/helpers_test.go | Feature-gates area helpers for fresh clusters + manifests wiring. |
| test/e2e/tests/feature_gates/feature_gates_suite_test.go | Feature-gates suite bootstrap + operator-unchanged gate + roadmap comments. |
| test/e2e/tests/exposure/loadbalancer_test.go | Exposure LoadBalancer spec with controller probe/skip behavior. |
| test/e2e/tests/exposure/helpers_test.go | Exposure area helpers for fresh clusters + vars/credentials wiring. |
| test/e2e/tests/exposure/exposure_suite_test.go | Exposure suite bootstrap + operator-unchanged gate. |
| test/e2e/tests/exposure/clusterip_test.go | Exposure ClusterIP spec (service type + port-forward ping). |
| test/e2e/tests/data/update_ops_test.go | Data-plane update operator coverage ($set/$inc/$unset/$push). |
| test/e2e/tests/data/sort_limit_skip_test.go | Data-plane sort/limit/skip coverage using deterministic dataset. |
| test/e2e/tests/data/query_test.go | Data-plane query filter coverage ($eq/$gt/$in/$and/$or/$regex). |
| test/e2e/tests/data/pipeline_test.go | Data-plane aggregation pipeline coverage ($lookup/$unwind/$group). |
| test/e2e/tests/data/helpers_test.go | Data area shared RO connect helper. |
| test/e2e/tests/data/delete_ops_test.go | Data-plane delete operator coverage (DeleteOne/DeleteMany). |
| test/e2e/tests/data/data_suite_test.go | Data suite bootstrap + operator-unchanged gate. |
| test/e2e/tests/data/crud_test.go | Basic CRUD coverage using shared RO fixture with per-spec DB. |
| test/e2e/tests/data/aggregation_test.go | Basic aggregation coverage using deterministic dataset. |
| test/e2e/suite_test.go | Root E2E suite bootstrap/teardown + logging (depth/run-id guidance). |
| test/e2e/runid_test.go | Unit tests for RunID env override + generation behavior. |
| test/e2e/runid.go | RunID implementation for fixture namespacing across processes/binaries. |
| test/e2e/pkg/e2eutils/tlscerts/tlscerts_test.go | Unit tests for generated TLS bundle correctness/validity. |
| test/e2e/pkg/e2eutils/tlscerts/tlscerts.go | Test-only CA/server cert generator for TLS “Provided” specs. |
| test/e2e/pkg/e2eutils/timeouts/timeouts_test.go | Unit tests asserting timeout coverage and poll interval sanity. |
| test/e2e/pkg/e2eutils/timeouts/timeouts.go | Central timeout registry with CNPG timeout aliasing + defaults. |
| test/e2e/pkg/e2eutils/timeouts/.keep | Keeps empty dir in VCS. |
| test/e2e/pkg/e2eutils/testenv/env_test.go | Unit tests for scheme registration + default constants. |
| test/e2e/pkg/e2eutils/testenv/env.go | CNPG TestingEnvironment constructor with DocumentDB/CNPG/client-go schemes + POSTGRES_IMG defaulting. |
| test/e2e/pkg/e2eutils/testenv/.keep | Keeps empty dir in VCS. |
| test/e2e/pkg/e2eutils/seed/datasets_test.go | Unit tests for deterministic dataset generators. |
| test/e2e/pkg/e2eutils/seed/datasets.go | Deterministic datasets for data/perf tests (Small/Medium/Sort/Agg). |
| test/e2e/pkg/e2eutils/seed/.keep | Keeps empty dir in VCS. |
| test/e2e/pkg/e2eutils/portforward/portforward_test.go | Unit tests for gateway service naming + nil-guard behavior. |
| test/e2e/pkg/e2eutils/portforward/portforward.go | CNPG forwardconnection wrapper specialized for DocumentDB gateway Service. |
| test/e2e/pkg/e2eutils/portforward/.keep | Keeps empty dir in VCS. |
| test/e2e/pkg/e2eutils/operatorhealth/gate_test.go | Unit tests for operator health gate drift detection + sentinel. |
| test/e2e/pkg/e2eutils/operatorhealth/.keep | Keeps empty dir in VCS. |
| test/e2e/pkg/e2eutils/namespaces/namespaces_test.go | Unit tests for deterministic DNS-safe per-spec namespace naming. |
| test/e2e/pkg/e2eutils/namespaces/namespaces.go | Deterministic per-spec namespace naming keyed by area/run-id/proc/spec hash. |
| test/e2e/pkg/e2eutils/mongo/.keep | Keeps empty dir in VCS. |
| test/e2e/pkg/e2eutils/helmop/helmop_test.go | Unit tests for helmop arg validation + deterministic flag ordering. |
| test/e2e/pkg/e2eutils/fixtures/teardown_test.go | Unit tests for fixture teardown selection by run-id + collision handling. |
| test/e2e/pkg/e2eutils/fixtures/shared_scale.go | Shared “scale” fixture creation/reset + CNPG readyInstances convergence checks. |
| test/e2e/pkg/e2eutils/fixtures/shared_ro.go | Shared “read-only CR” fixture creation and accessor-only handle. |
| test/e2e/pkg/e2eutils/fixtures/.keep | Keeps empty dir in VCS. |
| test/e2e/pkg/e2eutils/documentdb/.keep | Keeps empty dir in VCS. |
| test/e2e/pkg/e2eutils/assertions/.keep | Keeps empty dir in VCS. |
| test/e2e/manifests/mixins/tls_selfsigned.yaml.template | TLS SelfSigned manifest mixin template. |
| test/e2e/manifests/mixins/tls_provided.yaml.template | TLS Provided manifest mixin template. |
| test/e2e/manifests/mixins/tls_disabled.yaml.template | TLS Disabled manifest mixin template. |
| test/e2e/manifests/mixins/tls_certmanager.yaml.template | TLS CertManager manifest mixin template. |
| test/e2e/manifests/mixins/storage_custom.yaml.template | Storage override mixin template. |
| test/e2e/manifests/mixins/reclaim_retain.yaml.template | Retain reclaim policy mixin template. |
| test/e2e/manifests/mixins/exposure_loadbalancer.yaml.template | LoadBalancer exposure mixin template. |
| test/e2e/manifests/mixins/exposure_clusterip.yaml.template | ClusterIP exposure mixin template. |
| test/e2e/manifests/mixins/.keep | Keeps empty dir in VCS. |
| test/e2e/manifests/embed.go | Embeds manifest templates via embed.FS. |
| test/e2e/manifests/base/documentdb.yaml.template | Base DocumentDB CR template used across suites. |
| test/e2e/manifests/base/.keep | Keeps empty dir in VCS. |
| test/e2e/levels_test.go | Unit tests for TEST_DEPTH parsing/defaults + ordering semantics. |
| test/e2e/levels.go | Runtime depth gating (SkipUnlessLevel) and level label utilities. |
| test/e2e/labels.go | Area/cross-cutting/capability/level label definitions. |
| operator/src/scripts/test-scripts/mongo-python-data-pusher.py | Removed legacy python pymongo test helper script. |
| CHANGELOG.md | Adds release notes describing the unified E2E suite migration and contributor breaking change. |
| AGENTS.md | Adds contributor documentation on running the new E2E suite and labels/depth model. |
| .github/workflows/test-integration.yml | Removed legacy integration workflow (python-based). |
| .github/workflows/release_operator.yml | Removes pre-release legacy test gates; documents reliance on unified E2E workflow. |
| .github/workflows/release_images.yml | Removes pre-release legacy test gates; documents reliance on unified E2E workflow. |
| .github/workflows/release_documentdb_images.yml | Removes sed updates for deleted legacy workflows; updates comments accordingly. |
| .github/copilot-instructions.md | Adds repo process guidance (priority via projects, DCO sign-off requirement). |
| _ = client.ObjectKeyFromObject(dd) | ||
| }) |
There was a problem hiding this comment.
The final line _ = client.ObjectKeyFromObject(dd) appears to exist only to silence the unused controller-runtime/pkg/client import. This makes the spec harder to maintain and can hide real unused-import issues. Please remove the unused import and this no-op line (or use the client package for a real assertion/lookup if needed).
There was a problem hiding this comment.
Fixed in b7803d5. Removed the no-op and dropped the now-unused controller-runtime client import.
| docs := seed.SortDataset() | ||
| any := make([]any, len(docs)) | ||
| for i := range docs { | ||
| any[i] = docs[i] | ||
| } |
There was a problem hiding this comment.
any is used as a local variable name here (any := make([]any, len(docs))), which shadows Go's predeclared any identifier (alias for interface{}). This is legal but confusing and can lead to harder-to-read code; rename the slice variable to something like docsAny/payload to avoid shadowing.
There was a problem hiding this comment.
Fixed in b7803d5. Renamed to docsAny to avoid shadowing the predeclared any.
| // DocumentDB-specific operations. When adding an entry here, also | ||
| // extend the switch in For and PollInterval. | ||
| const ( |
There was a problem hiding this comment.
The comment says "extend the switch in For" but For is implemented via cnpgAlias/documentDBDefaults maps (there is no switch). This is likely stale and can mislead future contributors; update the comment to reflect the current implementation (e.g., "extend documentDBDefaults/cnpgAlias and PollInterval").
There was a problem hiding this comment.
Fixed in b7803d5. Updated the comment to point at documentDBDefaults/cnpgAlias.
| ### Running E2E tests | ||
|
|
||
| The end-to-end suite lives in [`test/e2e/`](test/e2e/) as a separate Go module | ||
| and replaces the legacy `test-integration.yml`, `test-E2E.yml`, | ||
| `test-backup-and-restore.yml`, and `test-upgrade-and-rollback.yml` workflows | ||
| (and their bash / JavaScript / Python glue). It is a Go / Ginkgo v2 / Gomega | ||
| suite that drives the operator end-to-end and speaks the Mongo wire protocol | ||
| via `go.mongodb.org/mongo-driver/v2`. | ||
|
|
||
| **Prereqs:** kind + the DocumentDB operator already installed in the target | ||
| cluster. In CI, the `.github/actions/setup-test-environment` composite action | ||
| handles cluster creation and operator install (via `make deploy`). Locally, | ||
| `operator/src/scripts/development/deploy.sh` is the equivalent entry point. |
There was a problem hiding this comment.
PR description says this is a draft design-doc-only proposal with "no implementation yet", but this change set adds a substantial Go/Ginkgo E2E implementation and removes legacy CI workflows/scripts. Please align the PR metadata/description with the actual scope (or split design vs implementation into separate PRs) so reviewers and release notes consumers have an accurate expectation.
There was a problem hiding this comment.
Fixed in b7803d5. Acknowledged — the PR description is stale from an earlier design-only iteration; I'll refresh it. Scope is correctly implementation + docs + legacy workflow removal as reviewed.
- tests/exposure/clusterip: remove no-op client.ObjectKeyFromObject(dd) and drop the now-unused controller-runtime client import. - tests/data/sort_limit_skip: rename the local slice that shadowed the predeclared 'any' identifier to docsAny. - pkg/e2eutils/timeouts: refresh the 'when adding an op' comment to point at documentDBDefaults/cnpgAlias (there is no switch). - test/e2e/go.mod: bump go directive to 1.25.9 to match operator/src after rebase onto upstream/main. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: German <geeichbe@microsoft.com>
Summary
Replaces the four legacy E2E workflows with a single Go + Ginkgo v2 + Gomega + mongo-driver test suite that reuses CloudNative-PG's
tests/utils/packages as a library.This PR ships both the design rationale (
docs/designs/e2e-test-suite.md) and the full implementation undertest/e2e/, and removes the legacy workflows + bash/JS/Python glue. (Originally opened as a design-only draft; scope has since grown to cover implementation.)What this replaces
.github/workflows/test-integration.yml.github/workflows/test-E2E.yml.github/workflows/test-backup-and-restore.yml.github/workflows/test-upgrade-and-rollback.yml.github/actions/setup-port-forwarding/operator/src/scripts/test-scripts/{test-mongodb-connection.sh,test-python-pymongo.sh,mongo-python-data-pusher.py,comprehensive_mongosh_tests.js,performance_test.js}Key design decisions
tests/utils/found ~20 packages directly reusable (DocumentDB wrapsapiv1.Cluster/apiv1.Backup— same types CNPG uses). A Python rewrite would have re-implemented all of it.test/e2e/tests/{lifecycle,scale,data,performance,backup,tls,feature_gates,exposure,status,upgrade}/— each area grows independently.SharedROCluster(1 instance, session) fordata/,performance/,status/— saves ~24 min of cluster creation. Read-only contract enforced via proxy.SharedScaleCluster(2 instances, session) forscale/.FreshDocumentDBper-spec only for genuinely mutating tests.Miniolazy session fixture, imported as-is from CNPG.BeforeEach/AfterEach) auto-skips non-disruptive/non-upgradespecs if the operator pod churns — adapted from CNPG's pattern, retargeted to thedocumentdb-operatornamespace.comprehensive_mongosh_tests.jssplit into 7 files;performance_test.jsinto 6; upgrade workflow into 3.ginkgo -p(process per package) + label-grouped GitHub Actions jobs. Performance + upgrade jobs forced serial.test/e2e/as a separate Go module so test deps (Ginkgo, CNPG utils, mongo-driver) don't pollute the operator's runtime deps.Running locally
See
test/e2e/README.mdfor the full env-var table and troubleshooting.