Skip to content

Regression 443 test: relax status-code check#2216

Merged
shin- merged 1 commit intodocker:masterfrom
thaJeztah:fix_status_code_check
Jan 9, 2019
Merged

Regression 443 test: relax status-code check#2216
shin- merged 1 commit intodocker:masterfrom
thaJeztah:fix_status_code_check

Conversation

@thaJeztah
Copy link
Member

This test was testing for a 500 status, but this status is actually a bug in the API (as it's due to an invalid request), and the API should actually return a 400 status.

To make this test handle both situations, relax the test to accept either a 4xx or 5xx status.

relates to moby/moby#38487 (comment)

@shin- @LinuxMercedes

for line in self.client.build(fileobj=dfile, tag="a/b/c"):
pass
assert exc.value.response.status_code == 500
assert exc.value.response.is_error
Copy link
Contributor

Choose a reason for hiding this comment

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

should be a func call()

Copy link
Contributor

Choose a reason for hiding this comment

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

specifically I think this should be assert exc.value.is_error()

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, dang; let me update 😅 - I'm really bad at python

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated; also happy to remove the new is_error if you think we should just inline it here

@thaJeztah thaJeztah force-pushed the fix_status_code_check branch from 9797959 to 9387c7d Compare January 8, 2019 23:42
for line in self.client.build(fileobj=dfile, tag="a/b/c"):
pass
assert exc.value.response.status_code == 500
assert exc.value.response.is_error()
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing .response should clear up the CI failure

Copy link
Member Author

Choose a reason for hiding this comment

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

🤦‍♂️ updated again; thanks for bearing with me 🤗

@shin-
Copy link
Contributor

shin- commented Jan 9, 2019

Failure on 2.7 is unrelated to this PR and probably needs some dependency wrangling, I'll have to take a closer look.

@thaJeztah thaJeztah force-pushed the fix_status_code_check branch from 9387c7d to 1992c23 Compare January 9, 2019 00:08
@shin- shin- added this to the 3.7.0 milestone Jan 9, 2019
This test was testing for a 500 status, but this status
is actually a bug in the API (as it's due to an invalid
request), and the API should actually return a 400 status.

To make this test handle both situations, relax the test
to accept either a 4xx or 5xx status.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the fix_status_code_check branch from 1992c23 to 219c521 Compare January 9, 2019 20:23
@thaJeztah
Copy link
Member Author

Is this expected? (https://jenkins.dockerproject.org/job/docker/job/docker-py/job/PR-2216/4/execution/node/25/log/)

20:23:39 [docker_docker-py_PR-2216-VUUIZLMALJLRQO2LIHC36PEUWVSMCGAOFNW2SQKYNEQKZ7MZMHEA] Running shell script
20:23:40 + docker pull dockerbuildbot/docker-py:py2-219c52141e3cd15db3348c5420220f640323499f
20:23:41 Error response from daemon: manifest for dockerbuildbot/docker-py:py2-219c52141e3cd15db3348c5420220f640323499f not found

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants