-
Notifications
You must be signed in to change notification settings - Fork 53
Refactor e2e tests to use assertion helper class #41
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
Conversation
test/e2e/tests/test_dhcp_options.py
Outdated
ec2_validator = Ec2Validator(ec2_client) | ||
ec2_validator.assert_dhcp_options(resource_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I think checking for existence is useful, I believe we can harden our tests by checking their spec matches. Especially for code with custom hooks. Perhaps, we should have methods in the EC2Validator
that get the resources, and then we can just check assert dhcp_options is not None
(and all of our spec assertions as well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with raising the quality of these tests, but should be addressed in a separate PR/issue. Do you know of an issue (or parent issue) to improve e2e testing or should I open one for this controller?
Once this is merged, my plan is to open a follow-up PR with a resource-reference e2e test modeled after ApiGatewayV2 (checks existence of referenced resources) so we can get some coverage on the feature. Then, I can work on improving e2e tests to check resources at a more granular level across the entire suite. Lmk if you have any other context (i.e. if some automated test-gen in the works, you prefer to finish vpc enhancements before e2e test improvements, etc.) or if you think it can be approached better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know of an issue (or parent issue) to improve e2e testing or should I open one for this controller?
This is on a per-controller basis. So if there isn't one for EC2, you can create one. No automated test-gen in the works atm :(
TransitGateway test failed because the resource still exists, but in the 'deleting' state. I checked the account and it has been deleted. This also happened to me when I tested locally, but was hoping it was transient. Not sure why it's occurring now, so will deep dive and improve the test in next revision. Logs
|
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only merging this because you promised me better tests in the near future haha. Counting on it!
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brycahta, RedbackThomson The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Issue #, if available: N/A
Description of changes:
Ec2Validator
, to assert resource data/state against aws apis more easilyBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.