-
Notifications
You must be signed in to change notification settings - Fork 163
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
More public documentation/guidance on each contract test #527
Comments
+1 - As someone who is migrating resources at scale. From personal experience, we have come up with some notes like - But if the tests have suggestions and what has failed specifically, that would be very useful.
Similarly, most contract tests check for something specific like this. Hence, some documentation about what each test is checking for and a potential resolution would be very useful. It would save us a ton of time as well. In some cases, it is taking us more time to fix contract tests than write the handler code. |
Clearer contract test names themselves are needed. I fixed a |
Re-opening this issue. It looks like we missed the documentation release here |
Why should every
Again, if this always must be done, why rely on all these Handlers implementing this correctly anyway?
Again, why does every All seem better handled levels above individual resource providers |
Completely agree. These contract tests should be removed this logic should be handled by cloudformation.
In terms of checking whether the resource exists, I do think it should be handled by each handler. The error codes and exceptions thrown will be unique for whatever service it is. Providers will still need to make the translation so cfn understands. Cloudformation could use the read handler in order check before each action but the provider still needs to implement it correctly with the read handler.
I agree as well 👍 |
In general, I agree with this if a potentially valid |
Also, if Physical ID = Primary Identifier, then Updates and Deletes will always have an ID present when they are invoked? Why should this be checked at all? |
I agree. However, it does make sense to phrase it as "If the Update, Read and Delete Handlers are invoked for a not-existing primaryIdentifier, they should throw a NotFound Error Code." As opposed to:
|
I'll also just throw in the note that we also optionally include The intent here was to support cases where more than one identifier may exist - for example an |
So in theory there is a conflict with the contract, because these cannot be both true:
In practice it probably does not matter at this point (since the primaryIdentifier is always set). However the possibility to do a read of a resource by passing one of the additionalIdentifiers could have some very nice use cases. In any case, there is definitely some improvement of that contract test possible :) |
+1 to the tests having better information and details around them. Trying to trouble shoot failing tests requires a lot of code diving to figure out what they are looking for. The abbreviated errors you get are not very helpful at all and the debug/verbose logs are lacking the needed details. +1 additionally I keep running into a bunch of contracts that I think should be managed by the service. I'm not sure its good for my code to handle things that the schema should have handled (example: min/max on an integer). I can't tell if this is a code bug or as designed yet... |
I don't think this is expected from the handlers any more. Right now, the Contract test hit the Prod endpoint and this condition should be handled by the langugae specific plugin. If this is not handled by the languga eplugin please cut us an issue in the respective language plugin repo.e.g: Python Java
This check should not be performed on the handlers. Please cut us a ticket if this is the case for you resource
This the current ask on the handlers, because if the handler is not successful in deleting the resource we expect the resource to be returned. Please let me know if you have concerns about implementing this on the handlers. |
|
We provide a contract for handlers to follow in the docs, but it will be useful for providers to know what each individual test within the contract tests is trying to accomplish, what the inputs are for the test, and what the expected outcome is without having to read through the code of the test. Might also be useful to have more context on the test failures when we're reporting the results as well (ie why it's bad the test is failing, suggestions on how to fix it).
The text was updated successfully, but these errors were encountered: