-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
fix: reset config in tests #1516
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
mdelapenya
added
chore
Changes that do not impact the existing functionality
and removed
bug
An issue with the library
labels
Aug 23, 2023
kiview
previously approved these changes
Aug 23, 2023
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
mdelapenya
added a commit
to mdelapenya/testcontainers-go
that referenced
this pull request
Aug 23, 2023
* main: fix: reset config in tests (testcontainers#1516)
mdelapenya
added a commit
to igribkov/testcontainers-go
that referenced
this pull request
Aug 28, 2023
* main: (26 commits) modulegen: create internal/make (testcontainers#1537) chore: fix workflow (testcontainers#1538) chore(deps): bump the all group in /examples/cockroachdb with 1 update (testcontainers#1522) chore(deps): bump the all group in /examples/bigtable with 1 update (testcontainers#1534) chore(deps): bump the all group in /modules/localstack with 4 updates (testcontainers#1535) chore(deps): bump the all group in /modules/k3s with 2 updates (testcontainers#1526) chore(deps): bump the all group in /examples/spanner with 2 updates (testcontainers#1532) chore(deps): bump the all group in /examples/firestore with 1 update (testcontainers#1523) chore(deps): bump the all group in /modules/redis with 1 update (testcontainers#1524) chore(deps): bump the all group in /modules/clickhouse with 1 update (testcontainers#1525) chore(deps): bump the all group in /examples/toxiproxy with 2 updates (testcontainers#1528) chore(deps): bump the all group in /examples/pubsub with 1 update (testcontainers#1531) chore(deps): bump the all group in /examples/datastore with 2 updates (testcontainers#1530) chore(deps): bump the all group in /modules/redpanda with 1 update (testcontainers#1527) chore: properly render mkdocs.yml (testcontainers#1521) modulegen: create internal/workflow (testcontainers#1520) modulegen: create internal/module (testcontainers#1505) modulegen: create internal/mkdocs (testcontainers#1504) fix: do not remove the file schema in docker.host property (testcontainers#1517) fix: reset config in tests (testcontainers#1516) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
It resets the config synchronisation (sync.Once) in order to not affect other tests.
Why is it important?
I found this issue as a side effect of debugging another thing, and it took me a couple of hours to understand that the testcontainers.properties file was empty because somebody in the test execution called the ReadConfig() method, initialising the
sync.Once
that protects from multiple reads of the config.I noticed the HOME variable was empty when reading the Docker Host, os.UserHomeDir returned an error, and that led me to identify the config as the culprit. Following the rabbot hole I found there were two tests reading the config but not resetting the original state (only available for internal use of the library), and this PR fixes that.