-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support class level config failure policy #2869
Support class level config failure policy #2869
Conversation
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.
Did you considere to add the new annotation and its behavior in a listener logic?
It will improve the feature coverage of the spi and reduce the complexity of the engine (kind of because supporting a generic behavior is maybe more complex).
The logic is powered by a marker annotation. I am not quite sure as to how I would be able to move it into a listener. Any samples or pseudo code that you can share to give me a better context around what you are hinting at? |
You can have a look at the listener that manages the ignore annotation. |
I have taken a look at the listener and I dont think its going to work in this case because:
No we cannot do that. Via IHookable, we can either have a config executed or maybe deal with the exceptions that it raised or change its result. In this PR, we are not doing any of this, but having TestNG ignore failures at a configuration method and have it move forward. |
ping @juherr |
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.
What do you think to add a failurePolicy
param on configuration annotations?
And then @DisregardConfigFailure
will just configure the param.
testng-core/src/main/java/org/testng/internal/invokers/ConfigInvoker.java
Show resolved
Hide resolved
@krmahadevan |
Perfectly aligned with you on this.
Not necessarily true given the fact that the existing model is NOT tied to the annotations at all but is more aligned at the overall test execution.
This is where I am trying to get more context in terms of what is the issue with the current implementation of using an annotation driven model to express that intent, given the fact that
The reason why I am pursuing a
|
The engine and its model are not coupled to annotations but the naming of the model refers to annotation for legacy reason. You can have both a new annotation for userland and an attribute in the domain for the engine. |
I didn't understand what you are suggesting. Can you please explain a bit more since I am not able to grasp what you are expecting here. When you say engine, what are you referring to? I am not quite sure I understand this part, especially when TestNG doesn't seem to have such distinct components. I would like this feature to be a purely annotation driven approach which cannot/should not be toggled just as how we have |
As you know, TestNG has many phases:
The run phase has sub-phases but that is not the subject here. As I understand the fix, it needs to be applied in phase 4 during the run. In other words, the fix is ok except the |
@juherr - Thank you for explaining this. Now I understand the concern. Let me see what I can come up with that adheres the model that you called out. |
d84933e
to
ddc46e9
Compare
ddc46e9
to
b7080a6
Compare
@juherr - I have re-worked on this PR to adhere to the expectations you had called out earlier. Can you please help take a look ? |
@juherr - Gentle reminder on this. |
The change is nice: good job! 👍 |
And I learnt about the layered model that you explained while working on this. That was a new learning |
Closes #2862
Fixes #2862 .
Did you remember to?
CHANGES.txt
./gradlew autostyleApply
We encourage pull requests that:
If your pull request involves fixing SonarQube issues then we would suggest that you please discuss this with the
TestNG-dev before you spend time working on it.
Note: For more information on contribution guidelines please make sure you refer our Contributing section for detailed set of steps.