-
-
Notifications
You must be signed in to change notification settings - Fork 302
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
feat: Allow MongoDb module configuration without credentials #983
feat: Allow MongoDb module configuration without credentials #983
Conversation
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR 👍.
This addresses a regression on #547 as well as adding the ability to not use default credentials;
Oh, looks like I missed that requirement during the migration to dedicated modules, thanks.
We must ensure that the tests also pass ( testcontainers-dotnet/tests/Testcontainers.MongoDb.Tests/MongoDbContainerTest.cs Lines 36 to 49 in 27611d1
|
Co-authored-by: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
I don't have a Linux box (I'm assuming it only works on Linux because the test has a Linux trait), so I went with the best bet that not passing those options when username/password are null will certainly work as expected, and I'm not opposed to passing empty strings if that works |
I extended the tests and executed them against We can add something like |
I do know that I will check the other changes against replica set mode |
That's not what
If the username and password is empty it will not be included in the connection string. |
@the-avid-engineer have you had the chance to test the changes in replica set mode? I would like to prepare a new release, and ideal include the changes from this pull request. |
Sorry, I was preoccupied and not able to test yet. I will do so later tonight That is good that the connection string is correct, I only assumed it would not handle empty string the same as null |
@HofmeisterAn I can confirm the empty strings work fine with replica set mode :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time 🙏.
Hi everyone, hope this is the right place to ask this question: Would be highly appreciated, if it happens soon :) |
This has already been merged into the main branch and is released. testcontainers-dotnet/tests/Testcontainers.MongoDb.Tests/MongoDbContainerTest.cs Lines 61 to 67 in c0932f2
|
What does this PR do?
Why is it important?
This addresses a regression on #547 as well as adding the ability to not use default credentials; when using credentials in replica set mode, there are additional set up pieces that are tedious; it's 1000x easier to run in replica set mode without credentials. Replica set mode allows users to use transactions
Related issues
I would love to add a test to prevent another regression, but on my last PR I wasn't able to run the tests locally, and I suspect I still cannot run them