Skip to content

migrate TestAPIImagesSearchJSONContentType to integration test#51560

Open
2003Aditya wants to merge 1 commit intomoby:masterfrom
2003Aditya:TestAPIImagesSearchJSONContentType
Open

migrate TestAPIImagesSearchJSONContentType to integration test#51560
2003Aditya wants to merge 1 commit intomoby:masterfrom
2003Aditya:TestAPIImagesSearchJSONContentType

Conversation

@2003Aditya
Copy link
Contributor

- What I did
Migrated the TestAPIImagesSearchJSONContentType test from integration-cli/docker_api_image_test.go to the new integration test framework under integration/image/search_test.go.

Copy link
Contributor

@robmry robmry left a comment

Choose a reason for hiding this comment

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

Thank you @2003Aditya ...


assert.Equal(t, res.StatusCode, http.StatusOK)
assert.Equal(t, res.Header.Get("Content-type"), "application/json")

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extra blank line

Comment on lines +18 to +19
assert.Equal(t, res.StatusCode, http.StatusOK)
assert.Equal(t, res.Header.Get("Content-type"), "application/json")
Copy link
Contributor

Choose a reason for hiding this comment

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

Where possible, it's better to use assert.Check to let the test continue ...

Suggested change
assert.Equal(t, res.StatusCode, http.StatusOK)
assert.Equal(t, res.Header.Get("Content-type"), "application/json")
assert.Check(t, is.Equal(res.StatusCode, http.StatusOK))
assert.Check(t, is.Equal(res.Header.Get("Content-type"), "application/json"))

@2003Aditya 2003Aditya force-pushed the TestAPIImagesSearchJSONContentType branch from 20e2f6c to bb8c8fd Compare November 19, 2025 17:33
)

// https://github.com/moby/moby/issues/14846
func TestAPIImagesSearchJSONContentType(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably rename the test to TestImagesSearchJSONContentType.

@2003Aditya 2003Aditya force-pushed the TestAPIImagesSearchJSONContentType branch from bb8c8fd to ebc6c3f Compare November 28, 2025 12:03
@robmry robmry requested a review from vvoland November 28, 2025 15:38
@2003Aditya 2003Aditya force-pushed the TestAPIImagesSearchJSONContentType branch from ebc6c3f to 7260b9c Compare December 25, 2025 18:14
Signed-off-by: Aditya Mishra <mishraaditya675@gmail.com>
@2003Aditya 2003Aditya force-pushed the TestAPIImagesSearchJSONContentType branch from 7260b9c to f9c654c Compare December 25, 2025 18:22
@robmry
Copy link
Contributor

robmry commented Jan 5, 2026

I guess something went wrong with a rebase, the latest diff adds back TestAPIImagesSizeCompatibility (which you removed in #51564).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/images Image Distribution area/testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants