Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MongoDB testing module #1447

Merged
merged 16 commits into from
Aug 10, 2023

Conversation

ravilushqa
Copy link
Contributor

This commit introduces functionalities for MongoDB testing, achieving 3 main goals:

  1. Added mongodb module, github.com/testcontainers/testcontainers-go/modules/mongodb, in dependabot.yml with a monthly update cycle.

  2. Created new .md documentation file for this module, providing details on how to add MongoDB to the Go dependencies, how to use this module, the MongoDB module reference, and other related details.

  3. Implemented test files to verify MongoDB connection and integration, and added a Makefile for test execution.

Justification:
This helps users in testing their mongodb related go functionalities, effectively and efficiently.

What does this PR do?

Why is it important?

Related issues

This commit introduces functionalities for MongoDB testing, achieving 3 main goals:

1. Added mongodb module, `github.com/testcontainers/testcontainers-go/modules/mongodb`, in `dependabot.yml` with a monthly update cycle.

2. Created new `.md` documentation file for this module, providing details on how to add MongoDB to the Go dependencies, how to use this module, the MongoDB module reference, and other related details.

3. Implemented test files to verify MongoDB connection and integration, and added a `Makefile` for test execution.

Justification:
This helps users in testing their mongodb related go functionalities, effectively and efficiently.
@ravilushqa ravilushqa requested a review from a team as a code owner August 7, 2023 13:57
@netlify
Copy link

netlify bot commented Aug 7, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit c8b8d56
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/64d499a2b6c3ae0008dbd126
😎 Deploy Preview https://deploy-preview-1447--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mdelapenya
Copy link
Collaborator

Could you remove in this PR the MongoDB example, located in ./examples/mongodb?

@ravilushqa
Copy link
Contributor Author

Could you remove in this PR the MongoDB example, located in ./examples/mongodb?

sure :)

.github/workflows/ci.yml Outdated Show resolved Hide resolved
ravilushqa and others added 4 commits August 8, 2023 16:22
The error message was updated to clarify its meaning in modules/mongodb/mongodb_test.go. It now specifically states "failed to get connection string" instead of "failed to get endpoint", which enhances the readability and precision in case of a related error occurrence."
docs/modules/mongodb.md Outdated Show resolved Hide resolved
ravilushqa and others added 3 commits August 9, 2023 19:16
This update corrects the MongoDB usage example in our documentation in file docs/modules/mongodb.md and improves the corresponding test case in modules/mongodb/mongodb_test.go. Previously, the reference to 'Creating a MongoDB container' in documentation was missing the actual code block. The test has been modified to highlight the container setup steps visually within the code, which enhances test readability. This helps developers understand how to use the MongoDB module more effectively."
docs/modules/mongodb.md Outdated Show resolved Hide resolved
docs/modules/mongodb.md Outdated Show resolved Hide resolved
mdelapenya
mdelapenya previously approved these changes Aug 9, 2023
Copy link
Collaborator

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM! Will merge it right after the CI passes. Thank you so much!

* main:
  Support groups in dependabot updates (testcontainers#1459)
  chore: run modulegen tests on Windows (testcontainers#1478)
@sonarcloud
Copy link

sonarcloud bot commented Aug 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
5.0% 5.0% Duplication

@mdelapenya
Copy link
Collaborator

Because the mongo workflow passed, I'm merging this one now.

@ravilushqa thank you so much for converting the example into a module. I'm going to update the existing conversion guide, given we changed the CI workflow.

image

@mdelapenya mdelapenya merged commit f4d9b1d into testcontainers:main Aug 10, 2023
73 checks passed
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Aug 10, 2023
* main:
  Add support for MongoDB testing module (testcontainers#1447)
  Support groups in dependabot updates (testcontainers#1459)
  chore: run modulegen tests on Windows (testcontainers#1478)
  Add default labels when Ryuk is disabled (testcontainers#1339)
  feat: add clickhouse module (testcontainers#1372)
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Aug 10, 2023
* main: (29 commits)
  Add support for MongoDB testing module (testcontainers#1447)
  Support groups in dependabot updates (testcontainers#1459)
  chore: run modulegen tests on Windows (testcontainers#1478)
  Add default labels when Ryuk is disabled (testcontainers#1339)
  feat: add clickhouse module (testcontainers#1372)
  chore: increase timeout for go test and GH action steps (testcontainers#1475)
  chore: triple max timeout for the workflow run, which takes +10m (testcontainers#1474)
  chore(deps): bump github.com/aws dependencies in /modules/localstack (testcontainers#1472)
  chore(deps): bump Google emulators dependencies in /examples (testcontainers#1471)
  all: fix goroutine leaks (testcontainers#1358)
  chore(deps): bump github.com/neo4j/neo4j-go-driver/v5 in /modules/neo4j (testcontainers#1427)
  chore(deps): bump github.com/tidwall/gjson from 1.14.4 to 1.15.0 in /modules/vault (testcontainers#1428)
  chore: add a GH action for release drafter (testcontainers#1470)
  chore(deps): bump mkdocs-material from 3.2.0 to 8.2.7 (testcontainers#1468)
  Add global testcontainers header to docs (testcontainers#1308)
  Simplify dependabot updates sorting (testcontainers#1460)
  feat: use credential helper in docker config, even if auth is empty in .docker/config.json (testcontainers#1079)
  chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 (testcontainers#1457)
  Revert "chore: run Windows tests on a Linux container (testcontainers#1456)"
  chore: run Windows tests on a Linux container (testcontainers#1456)
  ...
@ravilushqa ravilushqa deleted the mongo-module branch August 12, 2023 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants