CLOUDSTACK-8656: tests ignoring exceptions#850
Conversation
|
cloudstack-pull-rats #654 SUCCESS |
|
cloudstack-pull-analysis #603 SUCCESS |
|
LGTM |
|
@DaanHoogland Why log when an exception is thrown? In a test when an exception is thrown it should either fail, or when @test(expected = --exception.class--) is defined succeed. Right? |
|
@borisroman the expeted attribute is not there and as I understand with reason. The exceptions are part of the contract and need to be handled by the client. The test needs to verify the result irrespectively. @koushik-das Do I formulate this correct? |
|
@DaanHoogland @borisroman The test needs to invoke a protected method from a class and so is done using reflection. The test case already asserts for the method not being null. Now reflection methods throws some standard exceptions which either needs to be handled or thrown as per Java method contract. Since the null check is already there, the exceptions can be safely ignored. |
25f4dd1 to
429e98c
Compare
|
LGTM |
|
Do you guys really think that is a good idea to log exceptions in a test case? |
|
the reason for ignoring should be made more explicit in one way or the other. I'm not hellbound on logging but I see no problem in it. A caught and ignored exception without any action is a bad code snippit I want to be dealt with, even in tests. |
|
If an exception occurs, is the test still going to pass? |
|
not "throws Exception" but a more specific throws. In this case the exceptions are silently ignored as part of a happy flow. I don't like that but I'm not going to waste much more time on it |
|
Sure, I think that a more specific “throws” clause has to be used. Throws exception, was just an expression. |
429e98c to
52037e8
Compare
CLOUDSTACK-8656: tests ignoring exceptionsfinal few ignored exceptions supplied with log messages. * pr/850: CLOUDSTACK-8656: tests ignoring exceptions Signed-off-by: Daan Hoogland <daan@onecht.net>
* Adding message to deleteKubernetesSupportedVersion * Apply suggestions from code review Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com> Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com> Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
…les' into '4.16.0.0-scclouds' Suporte ao parametro `cidrlist` adicionado à UI de criação de regras de _load balancer_ Closes apache#850 See merge request scclouds/scclouds!357
final few ignored exceptions supplied with log messages.