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

configfailurepolicy=continue only works for BeforeTest when using TestNG XML file #2735

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bj-9527
Copy link
Contributor

@bj-9527 bj-9527 commented Feb 24, 2022

configfailurepolicy=continue only works for BeforeTest when using TestNG XML file

Fixes #2731

Did you remember to?

  • Add test case(s)
  • Update CHANGES.txt
  • Auto applied styling via ./gradlew autostyleApply

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.

Note: For more information on contribution guidelines please make sure you refer our Contributing section for detailed set of steps.

import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class ConfigFailTestSample {
Copy link
Member

Choose a reason for hiding this comment

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

This is where I have a concern.

The documentation says this Whether TestNG should continue to execute the remaining tests in the suite or skip them if an @Before* method fails. Default behavior is skip.

But here we are trying to move forward with trying to run the next lower level configuration even when the earlier higher order one failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whether TestNG should continue to execute the remaining tests in the suite or skip them if an @before* method fails. Default behavior is skip.

In my opinion, the default behavior is skip because of that the default config policy is set to FailurePolicy DEFAULT_CONFIG_FAILURE_POLICY = FailurePolicy.SKIP; , I'm not sure the description for Continue, will look up in document.

Copy link
Member

@juherr juherr left a comment

Choose a reason for hiding this comment

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

I think the behavior change should be configurable because there are too many changes that will be difficult to review (so, right by default).

@bj-9527 bj-9527 force-pushed the github2731 branch 2 times, most recently from a30dc42 to 86d924d Compare March 1, 2022 03:25
@bj-9527
Copy link
Contributor Author

bj-9527 commented Mar 2, 2022

I think the behavior change should be configurable because there are too many changes that will be difficult to review (so, right by default).

I added two test class, one for skip and anther is for continue, please help to check

Copy link
Member

@juherr juherr left a comment

Choose a reason for hiding this comment

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

The tests are failling and the change must not modify the current tests or the behavior by default. The new behavior may enabled by a new option.

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.

configfailurepolicy=continue only works for BeforeTest when using TestNG XML file
3 participants