[
https://jira.codehaus.org/browse/SUREFIRE-1143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=363315#comment-363315
]
Tibor Digana edited comment on SUREFIRE-1143 at 2/15/15 3:56 PM:
-----------------------------------------------------------------
>From my PoV everything is ok.
I added {code}System.out.println("### I am running the test testGetLastName()
###");{code} at the first line of test method "testGetLastName".
This is the expected outcome with groups=group1:
{code}
[INFO] --- maven-failsafe-plugin:2.18.1:integration-test (integration-test) @
testproj ---
[INFO] Failsafe report directory:
e:\vcs\tmp\surefire-bug~\target\failsafe-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.ravellosystems.test.PersonTest
Configuring TestNG with: TestNG652Configurator
### I am running the test testGetLastName() ###
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.766 sec <<<
FAILURE! - in com.ravellosystems.test.PersonTest
testGetLastName(com.ravellosystems.test.PersonTest) Time elapsed: 0.031 sec
<<< FAILURE!
java.lang.AssertionError: expected:<smith> but was:<null>
at org.testng.AssertJUnit.assertEquals(AssertJUnit.java:101)
at org.testng.AssertJUnit.assertEquals(AssertJUnit.java:108)
at
com.ravellosystems.test.PersonTest.testGetLastName(PersonTest.java:16)
Results :
Failed tests:
PersonTest.testGetLastName:16 expected:<smith> but was:<null>
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
{code}
This is with
mvn verify -DexcludedGroups=group1
{code}
[INFO] --- maven-failsafe-plugin:2.18.1:integration-test (integration-test) @
testproj ---
[INFO] Failsafe report directory:
e:\vcs\tmp\surefire-bug~\target\failsafe-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.ravellosystems.test.PersonTest
Configuring TestNG with: TestNG652Configurator
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.672 sec - in
com.ravellosystems.test.PersonTest
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
{code}
This is the result with non-existing group "group2".
This means groups=group2 :
{code}
[INFO] --- maven-failsafe-plugin:2.18.1:integration-test (integration-test) @
testproj ---
[INFO] Failsafe report directory:
e:\vcs\tmp\surefire-bug~\target\failsafe-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.ravellosystems.test.PersonTest
Configuring TestNG with: TestNG652Configurator
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.64 sec - in
com.ravellosystems.test.PersonTest
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
{code}
was (Author: tibor17):
>From my PoV everything is ok.
I added {@code}System.out.println("### I am running the test testGetLastName()
###");{@code} at the first line of test method "testGetLastName".
This is the expected outcome with groups=group1:
{@code}
[INFO] --- maven-failsafe-plugin:2.18.1:integration-test (integration-test) @
testproj ---
[INFO] Failsafe report directory:
e:\vcs\tmp\surefire-bug~\target\failsafe-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.ravellosystems.test.PersonTest
Configuring TestNG with: TestNG652Configurator
### I am running the test testGetLastName() ###
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.766 sec <<<
FAILURE! - in com.ravellosystems.test.PersonTest
testGetLastName(com.ravellosystems.test.PersonTest) Time elapsed: 0.031 sec
<<< FAILURE!
java.lang.AssertionError: expected:<smith> but was:<null>
at org.testng.AssertJUnit.assertEquals(AssertJUnit.java:101)
at org.testng.AssertJUnit.assertEquals(AssertJUnit.java:108)
at
com.ravellosystems.test.PersonTest.testGetLastName(PersonTest.java:16)
Results :
Failed tests:
PersonTest.testGetLastName:16 expected:<smith> but was:<null>
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
{@code}
This is with
mvn verify -DexcludedGroups=group1
{@code}
[INFO] --- maven-failsafe-plugin:2.18.1:integration-test (integration-test) @
testproj ---
[INFO] Failsafe report directory:
e:\vcs\tmp\surefire-bug~\target\failsafe-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.ravellosystems.test.PersonTest
Configuring TestNG with: TestNG652Configurator
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.672 sec - in
com.ravellosystems.test.PersonTest
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
{@code}
This is the result with non-existing group "group2".
This means groups=group2 :
{@code}
[INFO] --- maven-failsafe-plugin:2.18.1:integration-test (integration-test) @
testproj ---
[INFO] Failsafe report directory:
e:\vcs\tmp\surefire-bug~\target\failsafe-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.ravellosystems.test.PersonTest
Configuring TestNG with: TestNG652Configurator
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.64 sec - in
com.ravellosystems.test.PersonTest
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
{@code}
> excludedGroups in pom.xml are ignored with TestNG
> -------------------------------------------------
>
> Key: SUREFIRE-1143
> URL: https://jira.codehaus.org/browse/SUREFIRE-1143
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Failsafe Plugin
> Affects Versions: 2.18
> Environment: Linux - Ubuntu 14.x.
> Oracle JDK 1.7.
> Reporter: Elad Tabak
> Assignee: Tibor Digana
> Attachments: surefire-bug.tar.gz
>
>
> When setting excluded groups in pom.xml under surefire/failsafe plugin, the
> tests on that groups still getting invoked.
> Using TestNG annotation with @Test(groups = ...)
> However, using the command line argument "-DexcludedGroups=...", the tests
> are skipped.
> See attached project. To reproduce the issue with the test project:
> Run: mvn clean install
> Result: test invoked, build failed.
> Expected result: test excluded, build pass
> Run: mvn clean install -DexcludedGroups=group1
> Result: test excluded, build pass, as expected
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)