-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
Fog mock does not mimmick real behaviour for some Excon errors #341
Comments
Thanks for the detailed bug report. Would you be willing to help us improve the mocks to better reflect what you have described? Thanks! |
@geemus I'll have a look this week and see if I can get a PR in. I'll try and follow existing patterns but do you have any up-front recommendations? |
@ac-astuartkregor nothing in particular jumps to mind. There should be many examples though and hopefully the changes to accommodate these particular fixes won't be too crazy. Certainly happy to discuss and provide guidance as needed along the way. Thanks! |
Thanks @geemus !! Put a PR in for the very basics and am looking for feedback when you're ready. |
@easkay awesome. I'm going to close this in favor of consolidating discussion on the PR, will try to get you feedback there soon. |
Notes
Apologies if this has already been raised, I tried to look but didn't see much.
Scenario
Using GET and HEAD on S3 objects with an 'If-Match' constraint and supplying an ETag. The file already exists in the bucket but the content on disk has changed. In order to test functionality that depends on these requests, tests have been written which use Fog's mock ability.
Expected behaviour
When Fog mocking is turned on, just like real mode an Excon::Error::PreconditionFailed exception should raised which must be handled in application code. The S3 API returned a status code of 412 because the supplied ETag did not match with the object's ETag.
The below example demonstrates what happens when Fog mocking is turned off.
Actual behaviour
When Fog mocking is turned on, no exception is raised, but the response status code is set to 412 as in the following example.
Implications
As a result, Fog's mock feature is not replicating the real behaviour when using the 'If-Match' constraint, and as such it is not possible to test the real behaviour accurately.
The text was updated successfully, but these errors were encountered: