fix: reset config in tests#1516
Merged
mdelapenya merged 2 commits intotestcontainers:mainfrom Aug 23, 2023
Merged
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
kiview
previously approved these changes
Aug 23, 2023
|
Kudos, SonarCloud Quality Gate passed!
|
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) ...
This file contains hidden or 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
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.Oncethat 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.