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 username and password functions to mongodb #1910

Conversation

ugrkm
Copy link
Contributor

@ugrkm ugrkm commented Nov 10, 2023

What does this PR do?

This will add username and password functions to mongodb module. I removed mongodb_test module and put the tests in mongodb module. Because this was the pattern for other modules like postgres and mariadb.

Why is it important?

This enables users to be able to configure username and password. Also, it creates feature parity with other modules.

Related issues

How to test this PR

I already created a test for the change in mongodb_test.go file.

@ugrkm ugrkm requested a review from a team as a code owner November 10, 2023 18:07
Copy link

netlify bot commented Nov 10, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 04886f1
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/65663480fe51ca0007e76c85
😎 Deploy Preview https://deploy-preview-1910--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.

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.

Hi @ugrkm thanks for this! I added some comments before accepting the PR.

Could you take a look at them 🙏 ?

modules/mongodb/mongodb_test.go Outdated Show resolved Hide resolved
modules/mongodb/mongodb.go Outdated Show resolved Hide resolved
modules/mongodb/mongodb.go Show resolved Hide resolved
@ugrkm ugrkm force-pushed the ugrkm-1908-add-username-and-password-funcs-mongodb branch from 0775e95 to 3482d48 Compare November 13, 2023 18:42
modules/mongodb/mongodb_test.go Show resolved Hide resolved
modules/mongodb/mongodb_test.go Show resolved Hide resolved
modules/mongodb/mongodb_test.go Show resolved Hide resolved
@ugrkm ugrkm force-pushed the ugrkm-1908-add-username-and-password-funcs-mongodb branch from 3482d48 to 905ec81 Compare November 15, 2023 19:15
@mdelapenya mdelapenya self-assigned this Nov 21, 2023
@mdelapenya mdelapenya added the feature New functionality or new behaviors on the existing one label Nov 21, 2023
@ugrkm ugrkm force-pushed the ugrkm-1908-add-username-and-password-funcs-mongodb branch from 905ec81 to 91e7872 Compare November 27, 2023 20:15
@ugrkm ugrkm force-pushed the ugrkm-1908-add-username-and-password-funcs-mongodb branch from 91e7872 to 04886f1 Compare November 28, 2023 18:42
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, thanks for contributing to the MongoDB module!

I'll add a follow-up PR including docs for the functions, so we see this merged and you see how to contribute to the docs (not very well documented yet).

Thanks!

@mdelapenya mdelapenya merged commit 0fcd0cd into testcontainers:main Nov 28, 2023
112 checks passed
@mdelapenya
Copy link
Collaborator

@ugrkm PTAL at #1930, thanks!

mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Nov 30, 2023
* main: (100 commits)
  fix: fallback matching of registry authentication config (testcontainers#1927)
  feat: support customizing the Docker build command (testcontainers#1931)
  docs: include MongoDB's username and password options into the docs (testcontainers#1930)
  feat: support for custom registry prefixes at the configuration level (testcontainers#1928)
  Add username and password functions to mongodb (testcontainers#1910)
  chore: skip TestContainerLogWithErrClosed as flaky on rootless docker (testcontainers#1925)
  docs: add some Vault module examples (testcontainers#1825)
  feat: support for executing commands in a container with user, workDir and env (testcontainers#1914)
  fix(modules.kafka): Switch to MaxInt for 32-bit support (testcontainers#1923)
  docs: fix code snippet for image substitution (testcontainers#1918)
  Add database driver note to SQL Wait strategy docs (testcontainers#1916)
  Reduce flakiness in ClickHouse tests (testcontainers#1902)
  lint: enable nonamedreturns (testcontainers#1909)
  chore: deprecate BindMount APIs (testcontainers#1907)
  fix(reaper): fix race condition when reusing reapers (testcontainers#1904)
  feat: Allow the container working directory to be specified (testcontainers#1899)
  chore: make rabbitmq examples more readable (testcontainers#1905)
  chore(deps): bump github.com/twmb/franz-go and github.com/twmb/franz-go/pkg/kadm in /modules/redpanda (testcontainers#1896)
  Fix - respect ContainerCustomizer in neo4j module (testcontainers#1903)
  chore(deps): bump github.com/nats-io/nkeys and github.com/nats-io/nats.go in /modules/nats (testcontainers#1897)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or new behaviors on the existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: adding more customization capability to MongoDB module
2 participants