-
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
Before/After methods are not running when groups "include" in suite #1574
Comments
Closes testng-team#1574 Suppose there are one or more configuration methods which don’t belong to any group and for which “alwaysRun” attribute is not set, and when the user specifies a valid exclusion list for groups, TestNG would still execute those configuration methods. Fixed this anomaly.
@chetand24 - There are two parts to your issue.
By default if you would like your
This part is a bug. I have fixed this, by raising a pull request ( #1575 ) |
Closes testng-team#1574 Suppose there are one or more configuration methods which don’t belong to any group and for which “alwaysRun” attribute is not set, and when the user specifies a valid exclusion list for groups, TestNG would still execute those configuration methods. Fixed this anomaly.
@krmahadevan I'm not sure if it is a bug. The documentation doesn't specify it, but we can imagine that no group means the "default group". So, include "x" won't add "default group" but exclude "x" won't remove "default group". @cbeust Could you clarify the expected behavior of "exclude" for methods without a group? |
In fact, if we remove "no group" methods with "exclude", I don't know how to run "no group" and some other groups methods. |
@juherr - You are right in terms of the behavior not defined properly. Here's my understanding :
|
Closes testng-team#1574 Suppose there are one or more configuration methods which don’t belong to any group and for which “alwaysRun” attribute is not set, and when the user specifies a valid exclusion list for groups, TestNG would still execute those configuration methods. Fixed this anomaly.
Closes testng-team#1574 Suppose there are one or more configuration methods which don’t belong to any group and for which “alwaysRun” attribute is not set, and when the user specifies a valid exclusion list for groups, TestNG would still execute those configuration methods. Fixed this anomaly.
Closes testng-team#1574 Suppose there are one or more configuration methods which don’t belong to any group and for which “alwaysRun” attribute is not set, and when the user specifies a valid exclusion list for groups, TestNG would still execute those configuration methods. Fixed this anomaly.
Closes testng-team#1574 Suppose there are one or more configuration methods which don’t belong to any group and for which “alwaysRun” attribute is not set, and when the user specifies a valid exclusion list for groups, TestNG would still execute those configuration methods. Fixed this anomaly.
@krmahadevan, your PR will broke backward compatibility. In my projects I use groups feature only to exclude tests (flacky, app-bug, time-consumind, etc). So I mark only those tests which I want to exclude. After your PR all my tests without groups will be excluded from run. I'll be forced to assign some groups to ALL methods when I want to exclude just 1 test-case. This is not obvious (I need to assign ANY group to method if I want to run it with exclusions activated)
About
Test with no-group belongs to virtual 'all-tests' group (as same as tests with groups). No need to |
@kool79 - Thanks for your inputs. The only reason why this PR is pending merge and will perhaps never be merged is because of backward compatibility. The current behavior IMHO is not intuitive. But debates apart, backward compatibility is more important than anything else. So this PR will not be merged. |
It almost begs the question if alwaysRun should default to true and be disabled if the method has a group. |
TestNG Version : 6.12.0, 6.11.0
Expected behavior
The Before and After methods should run when "include" tag is present in the testng suite
Actual behavior
The Before and After methods are not running when "include" tag present in the testng suite. But is working fine when "exclude" is present
Is the issue reproductible on runner?
Test case sample
The test class:
Example XML Suite
Output when included the group:
Output when excluded the group:
The text was updated successfully, but these errors were encountered: