Skip to content

Conversation

@filipcirtog
Copy link

@filipcirtog filipcirtog commented Nov 17, 2025

Summary

This PR to the master branch focuses exclusively on the implementation of MongoDBMultiCluster using the shared library approach.

As part of the effort to replicate the end-to-end (E2E) test coverage from MongoDBMulti to MongoDB with a multicluster topology, we transition to a library-based approach.

Additionally, the following tests do not follow the library based approached since using the shared library would result in increased complexity. These tests are unique within their respective folders, unlike the multicluster folder, which contains 40 resource specific tests.

multicluster_om/multicluster_mongodbmulticluster_om_appdb_no_mesh.py
multicluster_appdb/multicluster_mongodbmulticluster_appdb_s3_based_backup_restore.py

Proof of Work

Shared library:

  • The shared library contains the actual test logic and can be reused. This library does not include fixtures, as fixtures are resource-specific (MongoDB vs MongoDBMulti).

Test implementation

  • For each test present in the shared library, a pytest is implemented in the MongoDBMultiCluster folder.

Naming convention for distinction:

  • Fixtures and evergreen tests related to MongoDBMultiCluster are prefixed/named mongodbmulticluster for differentiation.
  • Future implementations for the MongoDB resource follow the same pattern, replacing mongodbmulticluster with mongodb.

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

@github-actions
Copy link

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.6.1 Release Notes

@filipcirtog filipcirtog marked this pull request as ready for review November 18, 2025 14:56
@filipcirtog filipcirtog requested a review from a team as a code owner November 18, 2025 14:56

# this test is run, with an operator with race enabled
- name: e2e_om_reconcile_race_with_telemetry
- name: e2e_mongodbmulticluster_om_reconcile_race_with_telemetry
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should only modify tests that test MongoDBMultiCluster CRD. This one seems to be only about Ops Manager. I don't think we should touch this test.

Or am I missing something?

Copy link
Author

Choose a reason for hiding this comment

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

There are some tests which use MongoDBMulti in a different way. For example, they aren't centered on testing MongoDBMulti but rather as a supporting component. These tests use MongoDBMulti as a resource to test functionalities such as backup and restore workflows, Ops Manager integration, or multi-cluster configurations without focusing on MongoDBMulti itself. I’ve attached such tests below (description using AI) :

multicluster/multi_cluster_reconcile_races.py - This test validates the MongoDB Kubernetes Operator's ability to reconcile resources reliably across multi-cluster environments while detecting data races and ensuring telemetry correctness.

multicluster_om/multicluster_om_appdb_no_mesh.py - This test validates the Multi-Cluster MongoDB Kubernetes Operator when deployed without Service Mesh, focusing on its ability to manage MongoDBMulti resources with TLS security, S3 backups, external app database monitoring, external connectivity, data restoration via restores, and telemetry validation.

multicluster_appdb/multicluster_appdb_s3_based_backup_restore.py - This test validates the MongoDB Kubernetes Operator in a multi-cluster environment with S3-backed backups and restores, ensuring Ops Manager is properly configured with cluster-level TLS, external connectivity, and custom DNS settings while verifying metadata stores, restore functionality, and backup consistency for MongoDBMulti resources.

While leaving them alone and just replacing MongoDBMultiCluster with MongoDB once the feature branch is merged is one possibility, I would consider replicating them as well in order to be on the safe side. As a result, it’s safer to leave these tests untouched (aside from changes such as renaming and library inclusion for multicluster/multi_cluster_reconcile_races.py) while creating new, identical tests for MongoDB. This approach also makes it easier to delete them once the resource is deprecated.

Additionally, multicluster_om/multicluster_om_appdb_no_mesh.py and multicluster_appdb/multicluster_appdb_s3_based_backup_restore.py will not adopt the library-based approach, as these tests are unique within their respective folders (being the only tests utilizing MongoDBMulti) and will simply be replicated as is.

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.

3 participants