Jenkins not running TestNG Tests - selenium

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.

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.

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

Related

When I run my test through jenkins chrome browser is not triggered and also showing testng.xml file is not matching

Chrome browser is not launching when I click the build now link in jenkins, but showing build is success.
Solution provided in Jenkins : Selenium GUI tests are not visible on Windows are not working for me. Someone please help me in this.
Started by user Karthick Ragu
Running as SYSTEM
Building in workspace C:\Program Files\Jenkins\workspace\killerFramework
Parsing POMs
Established TCP socket on 51445
[karthick.framework] $ "C:\Program Files\Java\jdk1.8.0_181/bin/java" -cp "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-agent-1.13.jar;C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven\boot\plexus-classworlds-2.6.0.jar;C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven/conf/logging" jenkins.maven3.agent.Maven35Main "C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven" "C:\Program Files\Jenkins\war\WEB-INF\lib\remoting-3.35.jar" "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-interceptor-1.13.jar" "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.13.jar" 51445
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f D:\LEARNING\sel\karthick.framework\pom.xml clean test
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< web.automation.killer:karthick.framework >--------------
[INFO] Building karthick.framework 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # karthick.framework ---
[INFO] Deleting D:\LEARNING\sel\karthick.framework\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # karthick.framework ---
[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:3.8.1:compile (default-compile) # karthick.framework ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # karthick.framework ---
[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:3.8.1:testCompile (default-testCompile) # karthick.framework ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 3 source files to D:\LEARNING\sel\karthick.framework\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M3:test (default-test) # karthick.framework ---
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.339 s
[INFO] Finished at: 2019-10-06T23:35:41+05:30
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving D:\LEARNING\sel\karthick.framework\pom.xml to web.automation.killer/karthick.framework/0.0.1-SNAPSHOT/karthick.framework-0.0.1-SNAPSHOT.pom
channel stopped
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **/testng-results.xml
Did not find any matching files.
Finished: SUCCESS
The error is loud and clear
Looking for TestNG results report in workspace using pattern:
**/testng-results.xml Did not find any matching files.
That mean Jenkins not able to found xml file as per the path you have provided in jenkins.
Check if the path or filename is fine.
Put the full absolute path first to check and then try to create ** relative path

How to get 'mvn lagom:runAll' to get my service listening on a port?

I was having problems getting my first service to run and decided to add the hello-api and hello-impl projects from the lagom Maven archtype project to see if it would work. It did but mine do not.
Background
Since other team members are pure Java developers, I was trying to avoid leveraging sbt and activator. Thus, the objective is that everything works in maven.
Here's a snippet of the 'mvn install' script output to show the other services built.
$ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Archetype - mai-svcs
[INFO] mai-svc-common
[INFO] mai-actors-api <======= WANT THE SERVICE FOR THIS ONE TO RUN
[INFO] mai-namespace-api
[INFO] mai-actors-impl
[INFO] mai-namespace-impl
[INFO] mai-i18n-phrases-api
[INFO] hello-api
[INFO] hello-impl
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Archetype - mai-svcs 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Archetype - mai-svcs ............................... SUCCESS [ 2.774 s]
[INFO] mai-svc-common ..................................... SUCCESS [ 7.190 s]
[INFO] mai-actors-api ..................................... SUCCESS [ 24.706 s]
[INFO] mai-namespace-api .................................. SUCCESS [ 12.628 s]
[INFO] mai-actors-impl .................................... SUCCESS [ 29.061 s]
[INFO] mai-namespace-impl ................................. SUCCESS [ 21.294 s]
[INFO] mai-i18n-phrases-api ............................... SUCCESS [ 22.091 s]
[INFO] hello-api .......................................... SUCCESS [ 3.546 s]
NOTES: An MAIActorsModule class analogous to the HelloModule class was created and the application.conf file added in the src/main/resources folder.
When the command 'mvn lagom:runAll' is issued, initially, the services are the hello service port is logged but no other service's port is.
$ mvn lagom:runAll
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Archetype - mai-svcs
[INFO] mai-svc-common
[INFO] mai-actors-api
[INFO] mai-namespace-api
[INFO] mai-actors-impl
[INFO] mai-namespace-impl
[INFO] mai-i18n-phrases-api
[INFO] hello-api
[INFO] hello-impl
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Archetype - mai-svcs 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- lagom-maven-plugin:1.2.1:runAll (default-cli) # mai-svcs ---
[INFO] Starting Kafka
[INFO] Starting Cassandra
.[INFO] Did not find Netty's native epoll transport in the classpath, defaulting to NIO.
....[INFO] Using data-center name 'datacenter1' for DCAwareRoundRobinPolicy (if this is incorrect, please provide the correct datacenter name with DCAwareRoundRobinPolicy constructor)
[INFO] New Cassandra host /127.0.0.1:4000 added
[INFO] Cassandra server running at 127.0.0.1:4000
[INFO] Service locator is running at http://localhost:8000
[INFO] Service gateway is running at http://localhost:9000
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\lusp\mai_svcs\mai-svcs\hello-api\src\main\resources
[INFO] Nothing to compile - all classes are up to date
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
**[INFO] Nothing to compile - all classes are up to date
[INFO] Service hello-impl listening for HTTP on 0:0:0:0:0:0:0:0:57797
// ----- NO ENTRY FOR mai-actors-impl!!! -----
[INFO] (Service started, press enter to stop and go back to the console...)**
What step(s) did I miss?
Each of your <service>-impl projects need to:
Invoke the lagom-maven-plugin
Configure it with the property <lagomService>true</lagomService>
Here's an example snippet of what you need to add to your pom.xml file in each service implementation project:
<build>
<plugins>
<plugin>
<groupId>com.lightbend.lagom</groupId>
<artifactId>lagom-maven-plugin</artifactId>
<configuration>
<lagomService>true</lagomService>
</configuration>
</plugin>
</plugins>
</build>
The Lagom documentation has more details in the page titled Defining a Lagom build

Build failure - Apache Parquet-MR source (mvn install failure)

I am getting following error while trying to execute "mvn clean install" for building parquet-mr source obtained from https://github.com/apache/parquet-mr
[INFO] Storing buildScmBranch: UNKNOWN
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (default) # parquet-generator ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Parquet MR ................................. SUCCESS [1.494s]
[INFO] Apache Parquet Generator .......................... FAILURE [0.064s]
[INFO] Apache Parquet Common ............................. SKIPPED
[INFO] Apache Parquet Encodings .......................... SKIPPED
[INFO] Apache Parquet Column ............................. SKIPPED
[INFO] Apache Parquet Jackson ............................ SKIPPED
[INFO] Apache Parquet Hadoop ............................. SKIPPED
[INFO] Apache Parquet Avro ............................... SKIPPED
[INFO] Apache Parquet Benchmarks ......................... SKIPPED
[INFO] Apache Parquet Pig ................................ SKIPPED
[INFO] Apache Parquet Thrift ............................. SKIPPED
[INFO] Apache Parquet Cascading .......................... SKIPPED
[INFO] Apache Parquet Pig Bundle ......................... SKIPPED
[INFO] Apache Parquet Protobuf ........................... SKIPPED
[INFO] Apache Parquet Scala .............................. SKIPPED
[INFO] Apache Parquet Scrooge ............................ SKIPPED
[INFO] Apache Parquet Hadoop Bundle ...................... SKIPPED
[INFO] Apache Parquet Hive ............................... SKIPPED
[INFO] Apache Parquet Hive Binding Parent ................ SKIPPED
[INFO] Apache Parquet Hive Binding Interface ............. SKIPPED
[INFO] Apache Parquet Hive 0.10 Binding .................. SKIPPED
[INFO] Apache Parquet Hive 0.12 Binding .................. SKIPPED
[INFO] Apache Parquet Hive Binding Factory ............... SKIPPED
[INFO] Apache Parquet Hive Binding Bundle ................ SKIPPED
[INFO] Apache Parquet Hive Storage Handler ............... SKIPPED
[INFO] Apache Parquet Hive Bundle ........................ SKIPPED
[INFO] Apache Parquet Tools .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.826s
[INFO] Finished at: Sun Jul 05 15:55:33 IST 2015
[INFO] Final Memory: 25M/365M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.5:process (default) on project parquet-generator: Error rendering velocity resource. NullPointerException -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :parquet-generator
"mvn --version" is:
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 20:52:22+0530)
Maven home: /Users/.../maven/apache-maven-3.1.1
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.4", arch: "x86_64", family: "mac"
Can someone guide me on the same ? Any help on this is highly appreciated.
Thank you!
This seems caused by a maven bug with Java 8:
[MSHARED-319] Filtering throws NPE when using JDK8
A workaround is using Java 7.
You need to use the latest maven-filtering plugin version. If the error is caused by a plugin who uses maven-filtering as implicit dependency you should declare its dependency(for example maven-remote-resources-plugin:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>1.5</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
Source http://tomee-openejb.979440.n4.nabble.com/Java-8-and-possible-TomEE-1-7-0-td4668490i20.html
Please refer the following URL:
https://www.mail-archive.com/dev#parquet.apache.org/msg00967.html
I had the same error in building Apache Parquet from https://github.com/apache/parquet-mr, but 1.8.0rc1 was successfully built(https://github.com/apache/parquet-mr/archive/parquet-1.8.0rc1.zip)
Using the following command will do.
mvn install --batch-mode -DskipTests=true -Dmaven.javadoc.skip=true -Dsource.skip=true

maven issue - maven-resources-plugin

Getting following excepting while running "mvn clean install -DskipTests -U"
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] (derived-data) avalon Data Modules
[INFO] (data-affiliate-dynamic) avalon Dynamic Affiliate Data
[INFO] (data-external-id) Amazon ID Reference Data
[INFO] (data-products-raw) avalon Raw Product Data
[INFO] (data-product-images) avalon Product Image Data
[INFO] ------------------------------------------------------------------------
[INFO] Building (derived-data) avalon Data Modules
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing C:\svn\data\trunk\pom.xml to C:\Users\dinsolani\.m2\repository
\com\avalon\derived-data\3\derived-data-3.pom
[INFO] ------------------------------------------------------------------------
[INFO] Building (data-affiliate-dynamic) avalon Dynamic Affiliate Data
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] artifact com.avalon:maven-resources-plugin: checking for updates from c
entral
[INFO] snapshot com.avalon:maven-resources-plugin:4.66-SNAPSHOT: checking for
updates from central
[INFO] snapshot com.avalon:tools-maven-plugins:4.66-SNAPSHOT: checking for upd
ates from central
Downloading: http://repo.avalon.com/content/groups/private/com/avalon/tools-
maven-plugins/4.66-SNAPSHOT/tools-maven-plugins-4.66-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:maven-resources-plugin:maven-plugin:null
Reason: Cannot find parent: com.avalon:tools-maven-plugins for project: null:m
aven-resources-plugin:maven-plugin:null for project null:maven-resources-plugin:
maven-plugin:null
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Thu Oct 13 19:50:23 IST 2011
[INFO] Final Memory: 13M/981M
[INFO] ------------------------------------------------------------------------
Now I really looking for some solution or atleast some workaround for this issue.
Can I manually download & place somewhere
Is there any public repository, which I can use?
Here is the pom for the data-affiliate-dynamic module:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.avalon</groupId>
<artifactId>derived-data</artifactId>
<version>3</version>
</parent>
<artifactId>data-affiliate-dynamic</artifactId>
<packaging>pom</packaging>
<name>(${project.artifactId})avalonDynamicAffiliateData</name>
<build>
<plugins>
<plugin>
<groupId>com.avalon</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<include>var/affiliate/${sourceId}*-dynamic-*.xml</include>
</configuration>
</plugin>
</plugins>
</build>
</project>

Maven2 problem to access plugins repository !

i just come to install maven2, after configuring the settings.xml in ${user.home}/.m2 and fixing a proxy error. Now by executing the command :
mvn -U archetype:create -DgroupId=maven-test -DartifactId=maven-test
-DpackageName=net.ensode.maventest
i get this error :
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri
eved from repository: central due to an error: Authorization failed: Access deni
ed to: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exi
st or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Thu Apr 29 16:05:40 CEST 2010
[INFO] Final Memory: 2M/247M
[INFO] ------------------------------------------------------------------------
any idea of what could cause it ?
thanks !
I think that the most likely cause is that your proxy requires you to authenticate, and you haven't configured the authentication details into your settings.xml file.