Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# MongoDB Atlas Operator

[![MongoDB Atlas Operator](https://github.com/mongodb/mongodb-atlas-kubernetes/workflows/Test/badge.svg)](https://github.com/mongodb/mongodb-atlas-kubernetes/actions/workflows/test.yml?query=branch%3Amain)
[![MongoDB Atlas Go Client](https://img.shields.io/badge/Powered%20by%20-go--client--mongodb--atlas-%2313AA52)](https://github.com/mongodb/go-client-mongodb-atlas)

The MongoDB Atlas Operator provides a native integration between the Kubernetes orchestration platform and MongoDB Atlas
— the only multi-cloud document database service that gives you the versatility you need to build sophisticated and
Expand Down
2 changes: 1 addition & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ For Kubernetes, the [operator-runtime library has a fake package](https://pkg.go

### Atlas

For Atlas, the operator currently uses the [go-client-mongodb-atlas](https://github.com/mongodb/go-client-mongodb-atlas#go-client-mongodb-atlas). This [client main struct is composed of a set of interfaces](https://pkg.go.dev/go.mongodb.org/atlas@v0.31.0/mongodbatlas#Client), one per Service behind Atlas. A simple way to mock such a client for unit tests, that will probably only call a couple of API endpoints from Atlas at a time, is to replace those service implementations by the mock:
For Atlas, the operator currently uses the [Atlas Go SDK](https://github.com/mongodb/atlas-sdk-go). This [client main struct is composed of a set of interfaces](https://pkg.go.dev/go.mongodb.org/atlas@v0.31.0/mongodbatlas#Client), one per Service behind Atlas. A simple way to mock such a client for unit tests, that will probably only call a couple of API endpoints from Atlas at a time, is to replace those service implementations by the mock:

- The mock is an struct that implements the Service interface by calling methods set in that struct for each of the interface methods defined. [See sample below](#sample-snippets).
- Under `test/atlas` you should find all mocked services already being unit tested using this approach.
Expand Down
2 changes: 0 additions & 2 deletions test/int/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ var _ = Describe("AtlasDeployment", Label("int", "AtlasDeployment", "deployment-
checkAtlasState(func(c *admin.ClusterDescription20240805) {
// Expect(*c.DiskSizeGB).To(BeEquivalentTo(prevDiskSize)) // todo: find out if this should still work for advanced clusters

// check whether https://github.com/mongodb/go-client-mongodb-atlas/issues/140 is fixed
Expect(c.GetReplicationSpecs()[0].GetRegionConfigs()[0].ElectableSpecs.DiskSizeGB).To(BeAssignableToTypeOf(pointer.MakePtr[float64](0)), "DiskSizeGB is no longer a *float64, please check the spec!")
})
})
Expand Down Expand Up @@ -691,7 +690,6 @@ var _ = Describe("AtlasDeployment", Label("int", "AtlasDeployment", "deployment-
checkAtlasState(func(c *admin.ClusterDescription20240805) {
Expect(int(c.GetReplicationSpecs()[0].GetRegionConfigs()[0].ElectableSpecs.GetDiskSizeGB())).To(BeEquivalentTo(*createdDeployment.Spec.DeploymentSpec.DiskSizeGB))

// check whether https://github.com/mongodb/go-client-mongodb-atlas/issues/140 is fixed
Expect(c.GetReplicationSpecs()[0].GetRegionConfigs()[0].ElectableSpecs.DiskSizeGB).To(BeAssignableToTypeOf(pointer.MakePtr[float64](0)), "DiskSizeGB is no longer a *float64, please check the spec!")
})
})
Expand Down