migrate TestAPIImageImportBadSrc to integration test#51553
migrate TestAPIImageImportBadSrc to integration test#51553robmry merged 1 commit intomoby:masterfrom
Conversation
7e7337b to
77d101c
Compare
robmry
left a comment
There was a problem hiding this comment.
Thank you @2003Aditya ...
integration/image/import_test.go
Outdated
| t.Logf("err = %#v", err) | ||
|
|
There was a problem hiding this comment.
There's no need to log here - if the assertion below fails, it'll show the error anyway.
integration/image/import_test.go
Outdated
| t.Run(tc.name, func(t *testing.T) { | ||
| _, err := apiClient.ImageImport(ctx, | ||
| client.ImageImportSource{ | ||
| Source: nil, |
There was a problem hiding this comment.
nit: there's no need to initialise Source to nil.
787f8fc to
df5bb82
Compare
integration/image/import_test.go
Outdated
| } | ||
| } | ||
|
|
||
| func TestAPIImageImportBadSrc(t *testing.T) { |
There was a problem hiding this comment.
One more comment, then I think we're good to merge ...
Speaking with @thaJeztah last week - he asks that we try to use a common prefix for tests within a file. I'm not sure how consistent we've been with that in the past, but it'll be TestImport... in this case.
| func TestAPIImageImportBadSrc(t *testing.T) { | |
| func TestImageImportBadSrc(t *testing.T) { |
df5bb82 to
e507a93
Compare
|
Oh, there's a merge conflict now (and, nit - a blank line at the end of the test). |
e507a93 to
2220ab6
Compare
|
Sorry for the delay ... looks like the rebase went wrong though - |
Signed-off-by: Aditya Mishra <mishraaditya675@gmail.com>
2220ab6 to
ae4c17f
Compare
robmry
left a comment
There was a problem hiding this comment.
A couple of nits - but they can be dealt with in a follow-up. Let's get this merged.
| ctx := setupTest(t) | ||
| apiClient := testEnv.APIClient() | ||
|
|
||
| skip.If(t, testEnv.IsRootless, "rootless daemon cannot access the test's HTTP server in the host's netns") |
There was a problem hiding this comment.
The skip should be before the test setup.
| assert.Check(t, tc.expectErr(err)) | ||
| }) | ||
| } | ||
|
|
integration-climigration #50159- What I did
Migrated the
TestAPIImageImportBadSrctest fromintegration-cli/docker_api_image_test.goto the new integration test framework underintegration/image/import_test.go.