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

Configure TestNG to fail when all tests are skipped #2258

Merged
merged 1 commit into from
Mar 3, 2020

Conversation

krmahadevan
Copy link
Member

Closes #217

Currently TestNG doesn’t throw an exception which
build tools can leverage to fail a build, when all
the “@test” methods get skipped and nothing was run.
TestNG returns the proper status, but sometimes
build tools may not be reading that status and take
appropriate action.

Introduced a new configuration through this PR using
which a user can instruct TestNG itself to trigger
an exception when no tests were executed.

If one is using surefire plugin, then your surefire
plugin configuration would look like below:

<configuration>
  <properties>
    <property>
      <name>failwheneverythingskipped</name>
      <value>true</value>
    </property>
  </properties>
</configuration>

If you are using command line, then this feature
can be turned on by passing
-failwheneverythingskipped=true

Fixes #217 .

Did you remember to?

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

Closes testng-team#217

Currently TestNG doesn’t throw an exception which
build tools can leverage to fail a build, when all
the “@test” methods get skipped and nothing was run.
TestNG returns the proper status, but sometimes 
build tools may not be reading that status and take
appropriate action.

Introduced a new configuration through this PR using
which a user can instruct TestNG itself to trigger
an exception when no tests were executed.

If one is using surefire plugin, then your surefire
plugin configuration would look like below:


<configuration>
  <properties>
    <property>
      <name>failwheneverythingskipped</name>
      <value>true</value>
    </property>
  </properties>
</configuration>

If you are using command line, then this feature
can be turned on by passing 
-failwheneverythingskipped=true
@krmahadevan krmahadevan merged commit c7563f8 into testng-team:master Mar 3, 2020
@krmahadevan krmahadevan deleted the fix_217 branch March 3, 2020 10:38
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.

exception in DataProvider doesn't fail test run
2 participants