-
Notifications
You must be signed in to change notification settings - Fork 1k
Simplify integration tests #1181
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
Simplify integration tests #1181
Conversation
After writing some integration tests I've realized that we do quite a lot of boilerplate code in each of them. In this PR, I've tried to simplify and hide all the complexity of an integration test set-up to a single class What is more important is that this touched integration tests only, no other code. It does not change the logical flow of them, just makes it simpler. I know there are many files to look at, but imho, this is needed. The more tests we add, the more complex each of them becomes, and it should not be like that at all. I honestly hoped that for the fabric8 cases, things would be even simple and nicer since we upgraded to 6.2 and they have some neat features for integration tests. But after trying a few of them, they are limited (at least for the time being) and do not fit our needs. I'll raise a defect on their side and ask a few questions and see where it goes. |
private static void deleteManifests() { | ||
private static void manifests(Phase phase) { | ||
|
||
try { |
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.
@ryanjbaxter here is the idea of my PR, for example. In almost all of our integration tests, we create a deployment,service,ingress (and may be configmaps and secrets), and they do the exact same thing. First create them, do the testing, then deleted them. So why can't we simplify this and hide all the complexity of waiting for the resources to be created and deleted via proper methods? In such a case, reading the code of the integration test becomes far simpler to reason about. I've done this in all the tests + did some clean-up here and there.
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.
Why is the kubernetes java client catalog watch implementation included in this PR?
hey, welcome back. It's a simple reason, I hoped that the k8s watcher implementation would go in first, before this one |
Ah OK, I missed that other PR. I just merged it, so you should now be able to resolve the conflicts here |
@ryanjbaxter ready to be looked at. thank you |
This is great! Thank you! |
No description provided.