Skip to content

Fix test for Go 1.12.x - #1712

Merged
tiborvass merged 1 commit into
docker:masterfrom
thaJeztah:fix_test_for_go_1.12
Mar 13, 2019
Merged

Fix test for Go 1.12.x#1712
tiborvass merged 1 commit into
docker:masterfrom
thaJeztah:fix_test_for_go_1.12

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

After switching to Go 1.12, the format-string causes an error;

=== Errors
cli/config/config_test.go:154:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:217:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:253:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:288:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:435:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:448:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
DONE 1115 tests, 2 skipped, 6 errors in 215.984s
make: *** [Makefile:22: test-coverage] Error 2
Exited with code 2

After switching to Go 1.12, the format-string causes an error;
```
=== Errors
cli/config/config_test.go:154:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:217:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:253:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:288:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:435:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:448:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
DONE 1115 tests, 2 skipped, 6 errors in 215.984s
make: *** [Makefile:22: test-coverage] Error 2
Exited with code 2
```
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #1712 into master will not change coverage.
The diff coverage is n/a.

@@ Coverage Diff @@## master #1712 +/- ##
=======================================
Coverage 56.18% 56.18% =======================================
Files 306 306 Lines 21006 21006 =======================================
Hits 11803 11803 Misses 8349 8349 Partials 854 854

@vdemeestervdemeester left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯

t.Fatalf("Missing data from parsing:\n%q", config)
}
assert.Equal(t, ac.Username, "joejoe")
assert.Equal(t, ac.Password, "hello")

@tiborvasstiborvassMar 13, 2019

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we losing information here in case of a failure?. Previously we would have been able to see the config that fails the test (and the password with it jk :P)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tiborvass right, but that's not what we check at all 👼. We can still add a comment to these assert with the config if we want 😉

@silvin-lubeckisilvin-lubecki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@thaJeztah

Copy link
Copy Markdown
MemberAuthor

@tiborvass ready to go, or do you want me to update?

@tiborvass
tiborvass merged commit c3fc547 into docker:masterMar 13, 2019
@GordonTheTurtleGordonTheTurtle added this to the 19.03.0 milestone Mar 13, 2019
@thaJeztah
thaJeztah deleted the fix_test_for_go_1.12 branch March 13, 2019 21:09
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@thaJeztah@codecov-io@vdemeester@tiborvass@silvin-lubecki@GordonTheTurtle