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: check pull non-existent image response code #2913

Conversation

allencloud
Copy link
Collaborator

Signed-off-by: Allen Sun allensun.shl@alibaba-inc.com

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

test: check pull non-existent image response code

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

added

Ⅳ. Describe how to verify it

none

Ⅴ. Special notes for reviews

none

Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
@codecov
Copy link

codecov bot commented Jun 18, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@17a200f). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2913   +/-   ##
=========================================
  Coverage          ?   67.22%           
=========================================
  Files             ?      291           
  Lines             ?    18259           
  Branches          ?        0           
=========================================
  Hits              ?    12274           
  Misses            ?     4532           
  Partials          ?     1453
Flag Coverage Δ
#criv1alpha2_test 38.38% <ø> (?)
#integration_test_1 35.66% <ø> (?)
#integration_test_2 36.11% <ø> (?)
#integration_test_3 35.75% <ø> (?)
#node_e2e_test 34.28% <ø> (?)
#unittest 28.01% <ø> (?)

@allencloud
Copy link
Collaborator Author

This test case tests out a bug in code:

api_image_create_test.go:74:
    CheckRespStatus(c, resp, 500)
util_api.go:27:
    c.Assert(resp.StatusCode, check.Equals, status, check.Commentf("Response Body: %v", string(body)))
... obtained int = 200
... expected int = 500
... Response Body: {"errorDetail":{"code":500,"message":"there is no available image reference after trying [\"registry.hub.docker.com/library/qwefghjm:zxcvbn_efgh_nonexist\"]"},"error":"there is no available image reference after trying [\"registry.hub.docker.com/library/qwefghjm:zxcvbn_efgh_nonexist\"]","started_at":"0001-01-01T00:00:00Z","updated_at":"0001-01-01T00:00:00Z"}
OOPS: 0 passed, 1 FAILED
--- FAIL: Test (0.32s)

Pulling a non-existent image returns a status code of 200, which should be a 500.

@ZYecho
Copy link
Contributor

ZYecho commented Jun 18, 2019

@allencloud try to fix in #2914

@allencloud
Copy link
Collaborator Author

Thanks @ZYecho
Closing this now.

@allencloud allencloud closed this Jun 18, 2019
@allencloud allencloud deleted the test-pull-non-exist-image branch June 18, 2019 15:08
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