2

I've got an TestNG project which was running on Jenkins. For some reason which I don't know it stopped running the tests. It compiles perfectly but it doesn't run the the test. Here is the output of a run:

 <===[JENKINS REMOTING CAPACITY]===>channel started log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter). log4j:WARN Please initialize the log4j system properly. Executing Maven: -B -f C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB SELENIUM-WEB-TEST\pom.xml clean install [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building TEST-CMS-WEB 0.0.1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ Web --- [INFO] [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ Web --- [debug] execute contextualize [INFO] Using 'cp1252' encoding to copy filtered resources. [INFO] Copying 69 resources [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ Web --- [INFO] Compiling 73 source files to C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\classes [INFO] [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ Web --- [debug] execute contextualize [INFO] Using 'cp1252' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ Web --- [INFO] Compiling 2 source files to C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\test-classes [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ Web --- [JENKINS] Recording test results [INFO] [INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ Web --- [INFO] Building jar: C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar [INFO] [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ Web --- [INFO] Installing C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar to C:\.m2\repository\Test\Web\0.0.1\Web-0.0.1.jar [INFO] Installing C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\pom.xml to C:\.m2\repository\Test\Web\0.0.1\Web-0.0.1.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5.211s [INFO] Finished at: Wed Jan 15 14:21:03 UYST 2014 [INFO] Final Memory: 26M/310M [INFO] ------------------------------------------------------------------------ [JENKINS] Archiving C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\pom.xml to C:\Java\jenkins-1.523\jobs\TEST_HEAD_NOEXPORT\modules\Test$Web\builds\2014-01-15_14-20-56\archive\Test\Web\0.0.1\Web-0.0.1.pom [JENKINS] Archiving C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar to C:\Java\jenkins-1.523\jobs\TEST_HEAD_NOEXPORT\modules\Test$Web\builds\2014-01-15_14-20-56\archive\Test\Web\0.0.1\Web-0.0.1.jar Waiting for Jenkins to finish collecting data 

If anyone knows what could be happening I would appreciate the help.

3
  • i'm seeing nowhere where it's finding your tests. Since you are using maven, are your tests under src/test/java ? Commented Jan 15, 2014 at 19:39
  • they are under src/main/java, but the thing is im using TestNG with maven surefire and im: <suiteXmlFiles> <suiteXmlFile>src/main/resources/testsCasesRun/smokeTestPlan.xml </suiteXmlFile> </suiteXmlFiles> Commented Jan 16, 2014 at 11:37
  • per maven convention, your tests will not be run if they aren't in src/test/java. Either move them there, or you need to find out how to explicitly tell maven that your test directory is in src/main/java Commented Jan 16, 2014 at 14:52

2 Answers 2

2

If your using Maven Surefire, did you correctly specify a "test include" filter? The test phase will search the packages in src/test/java for classes containing the @Test annotation. It's easy to misconfigure Maven for the location of the src/test/java directory and so just be careful and you will figure it out.

Sign up to request clarification or add additional context in comments.

2 Comments

yes im using Maven Surefire and i have specified it in the pom, this way: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.12.4</version> <configuration> <includes> <include>**/Test*.java</include> </includes> <suiteXmlFiles> <suiteXmlFile>src/main/resources/testsCasesRun/jenkins.xml</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> </plugins> </build>
That's not the part I was saying to be careful about. Be very careful about how you configured (or accepted defaults) and placed your src/main and src/test dir locations.
0

<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.0.0-M3</version> <configuration> <suiteXmlFiles> <suiteXmlFile>testng.xml</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> </plugins> </build> <dependencies> 

Include maven surefire plugin end of the properties & before the dependencies. Use your "TestNG" XML file name.Use above code.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.