Skip to content
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

Fix Config invocation order for inheritance #2503

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

krmahadevan
Copy link
Member

Closes #2489

Fixes #2489

Did you remember to?

  • Add test case(s)
  • Update CHANGES.txt

We encourage pull requests that:

  • Add new features to TestNG (or)
  • Fix bugs in TestNG

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.

@krmahadevan krmahadevan requested a review from juherr March 28, 2021 17:57
@krmahadevan krmahadevan merged commit ad3834c into testng-team:master Mar 29, 2021
@krmahadevan krmahadevan deleted the fix_2489 branch March 29, 2021 02:32
* @param xmlTest - The {@link XmlTest} that represents the current <code>test</code>
* @return - <code>true</code> if group based selection was employed and false otherwise.
*/
public static boolean isGroupBasedExecution(XmlTest xmlTest) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why static? why XmlTest as argument?

why not just xmlTest.isGroupBasedExecution()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martinaldrin - Any specific reasons behind adding comments on a PR that is already merged ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw it when I tried to figure out the bug that I found in #2664

Comment on lines -292 to 306
String[] groupsDependedUpon = m.getGroupsDependedUpon();
if (groupsDependedUpon.length > 0) {
for (String group : groupsDependedUpon) {
ITestNGMethod[] methodsThatBelongToGroup =
MethodGroupsHelper.findMethodsThatBelongToGroup(m, methods, group);
predecessors.addAll(Arrays.asList(methodsThatBelongToGroup));
if (XmlTest.isGroupBasedExecution(xmlTest)) {
String[] groupsDependedUpon = m.getGroupsDependedUpon();
if (groupsDependedUpon.length > 0) {
for (String group : groupsDependedUpon) {
ITestNGMethod[] methodsThatBelongToGroup =
MethodGroupsHelper.findMethodsThatBelongToGroup(m, methods, group);
predecessors.addAll(Arrays.asList(methodsThatBelongToGroup));
}
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is the reason why dependsOnGroup and dependsOnMethods is broken in #2664

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to propose a fix ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hierarchical base- and test-class @AfterClass methods out of order using groups
3 participants