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/cli: Use empty array as empty output of images/json #4050

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

vvoland
Copy link
Collaborator

@vvoland vvoland commented Feb 24, 2023

Tests mocking the output of GET images/json with fakeClient used an array with one empty element as an empty response. Change it to just an empty array.

See comment: #4046 (comment)

Looks like all of these were added as part of the same commit (e779309), that commit was migrated from the moby/moby repository; original one was moby/moby@b2551c6 (moby/moby#32248)

The only possible reasoning I could think of was if it was some attempt to match that the API returns always returns a slice (even if there's no images); the response of the API (tested on docker 17.06 to be sure) is;

curl --unix-socket /var/run/docker.sock 'http://foo/images/json'
[]

But that also doesn't match, because it doesn't return (e.g.) [{}] (single entry).

Other explanation could be to work with the assertion library used at the time; there's a mention that we switched libraries for that at the time; moby/moby#32248 (comment) so perhaps the old one had some issue?

by @thaJeztah

Tests mocking the output of GET images/json with fakeClient used an
array with one empty element as an empty response.
Change it to just an empty array.

Signed-off-by: Paweł Gronowski <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2023

Codecov Report

Merging #4050 (a1953e1) into master (dfb36ea) will increase coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4050      +/-   ##
==========================================
+ Coverage   59.16%   59.17%   +0.01%     
==========================================
  Files         287      287              
  Lines       24724    24725       +1     
==========================================
+ Hits        14627    14631       +4     
+ Misses       9212     9210       -2     
+ Partials      885      884       -1     

Copy link
Member

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

Sign up for free to 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.

3 participants