Open alinabuzachis opened 9 months ago
I would add that we should also try to come up with some guidelines for when to use unit tests and when to use integration tests, and document that.
The problem I have with saying "whenever possible", is that historically a lot of our code hasn't been written in such a way that unit tests are "useful". We probably need to take a step back and think about how we recommend modules are written, such that writing unit tests doesn't involve placebo recordings. (And preferably doesn't necessitate mocking up AnsibleModule and Boto3 Client's)
Summary
We have many integration tests in the amazon.aws repository, even for very small plugin features. Integration testing is slow, and the need to create new resources to test even some small features results in a lot of overhead, which makes integration testing even slower. Some features can be easily tested without integration testing by simply writing some units. The idea would be to identify these cases and, instead of covering them with integration tests, add some unit tests. I would probably consider integration tests only for the main operations (create, idempotency checks, update, delete) with some relevant plugin options, and unit tests when testing the other functionalities.
Issue Type
Feature Idea
Component Name
Several
Additional Information
No response
Code of Conduct