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

test: fix TestGetDockerConfig #1413

Conversation

AlexanderYastrebov
Copy link
Contributor

What does this PR do?

Do not assume non-empty auths section in local config file but test that getDockerConfig returns default config when DOCKER_CONFIG env variable is not set.

Also remove t.Cleanup calls that restore env variables because t.Setenv restores them itself.

Why is it important?

Fixes failing test that depends on local environment.

Related issues

@AlexanderYastrebov AlexanderYastrebov requested a review from a team as a code owner August 2, 2023 11:20
@netlify
Copy link

netlify bot commented Aug 2, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 5ab94b8
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/64ca3cfb9d125e000851f3f7
😎 Deploy Preview https://deploy-preview-1413--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.

Do not assume non-empty auths section in local config file but test that
getDockerConfig returns default config when DOCKER_CONFIG env variable
is not set.

Also remove t.Cleanup calls that restore env variables because t.Setenv
restores them itself.
@sonarcloud
Copy link

sonarcloud bot commented Aug 2, 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
0.0% 0.0% Duplication

@mdelapenya mdelapenya self-assigned this Aug 2, 2023
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Aug 2, 2023
Copy link
Member

@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!!!

@mdelapenya mdelapenya merged commit 9b14c53 into testcontainers:main Aug 2, 2023
58 checks passed
@AlexanderYastrebov AlexanderYastrebov deleted the test/fix-get-docker-config branch August 2, 2023 12:36
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Aug 3, 2023
* main:
  chore(deps): bump github.com/hashicorp/consul/api in /examples/consul (testcontainers#1381)
  chore(deps): bump github.com/twmb/franz-go in /modules/redpanda (testcontainers#1387)
  chore(deps): bump github.com/nats-io/nats.go in /examples/nats (testcontainers#1389)
  feat(redpanda): Add option to enable topic auto-creation (testcontainers#1360)
  chore(deps): bump golang.org/x/text from 0.9.0 to 0.11.0 in /modulegen (testcontainers#1388)
  chore(deps): bump google.golang.org/api from 0.125.0 to 0.134.0 in /examples (testcontainers#1412)
  chore(deps): bump golang.org/x/mod and github.com/aws/aws-sdk-go-v2/config in /modules/localstack (testcontainers#1410)
  test: fix TestGetDockerConfig (testcontainers#1413)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes that do not impact the existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants