[ 
https://jira.codehaus.org/browse/SUREFIRE-1143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=363316#comment-363316
 ] 

Tibor Digana commented on SUREFIRE-1143:
----------------------------------------

@Elad
You POM is expected to skip unit tests, but the IT should not be skipped since 
group1 is expected to run and Person#getLastName() returns NULL and therefore 
the test fails > "smith" != NULL.

{code}
e:\vcs\tmp\surefire-bug~>mvn clean verify
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testproj 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ testproj ---
[INFO] Deleting e:\vcs\tmp\surefire-bug~\target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ testproj 
---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, 
i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ testproj ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. 
build is platform dependent!
[INFO] Compiling 1 source file to e:\vcs\tmp\surefire-bug~\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ 
testproj ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, 
i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ 
testproj ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. 
build is platform dependent!
[INFO] Compiling 1 source file to e:\vcs\tmp\surefire-bug~\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ testproj ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ testproj ---
[INFO] Building jar: e:\vcs\tmp\surefire-bug~\target\testproj-0.0.1-SNAPSHOT.jar
[INFO]
[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.812 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}

> 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)

Reply via email to