-
Notifications
You must be signed in to change notification settings - Fork 64
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
Allow annotations to be explicitly enabled via config #275
Conversation
Fixed elsewhere, no longer needed. |
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.
Can you add more tests to test each annotation?
Signed-off-by: Emily Jiang <[email protected]>
Signed-off-by: Andrew Rouse <[email protected]>
This is to allow TestException to be used in other tests. Also refactor how the metrics tests include util packages to simplify the Deployment methods. Signed-off-by: Andrew Rouse <[email protected]>
Signed-off-by: Andrew Rouse <[email protected]>
* Simplify existing tests. * Add new tests to check that method config overrides class config and class config overrides global config * Add tests for Bulkhead which were previously missing Also changes tests from throwing RuntimeException to throwing TestException. Some of the old tests would incorrectly catch FaultToleranceExceptions when the intent was to only catch the RuntimeException thrown by the test method. Signed-off-by: Andrew Rouse <[email protected]>
4eb7bd9
to
d7e99b0
Compare
This ended up being a fairly large change. There are several different ways that config parameters can override each other and testing them across all the annotations makes for a fairly large test matrix. Given that we want to run very similar tests in lots of different configurations, I've written a new "client" bean with behaviour designed to make it very easy to test whether or not the annotations are enabled. This allows the actual test methods to be a few lines in most cases. (The exception is the Bulkhead tests because bulkheads need several executions running in parallel and this takes a few more lines to set up.) The methods on the new client bean throw I've added bulkhead enablement tests which were previously missing. Note: I'm slightly unsure about the bulkhead tests. I'm not sure it's guaranteed that the ApplicationScoped context is active on the new thread, but I went with it since that's the approach we already use in I've refactored the way the config is declared to try to minimise copy paste errors since the meat of these tests is setting up different configurations. |
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.
LGTM! Thanks @Azquelt !
Allow annotations to be explicitly enabled via config as well as being disabled.
This allows a Fault Tolerance annotation to be disabled globally, but then enabled for a specific class or method.
Add TCKs to test this behaviour.
This is to address #266
This includes and completes the work that @Emily-Jiang started under #270