soapUI tests reports are not visible in jenkins - jenkins

I am using maven-soapui-extension-plugin:test-multi to run tests splitted in multiple soapUI projects.
I see that a lot of TEST-*.xml are generated in target/surefire-reports but I don't see them on the jenkins build page like I do with other projects containing regular junit tests. It seems that jenkins does not detect those reports.
My plugin is configured as such:
<plugin>
<groupId>com.github.redfish4ktc.soapui</groupId>
<artifactId>maven-soapui-extension-plugin</artifactId>
<version>4.6.4.2</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test-multi</goal>
</goals>
<configuration>
<projectFiles>
<scan>
<baseDirectory>${soapui.folder}</baseDirectory>
<includes>
<include>**/*-soapui-project.xml</include>
</includes>
</scan>
</projectFiles>
<host>${soapui.endpoint}</host>
<outputFolder>${basedir}/target/surefire-reports</outputFolder>
<junitReport>true</junitReport>
<exportAll>true</exportAll>
<testFailIgnore>true</testFailIgnore>
<useOutputFolderPerProject>false</useOutputFolderPerProject>
</configuration>
</execution>
</executions>
</plugin>
Do I need something else in my configuration or in jenkins?

It seems to be a problem with Jenkins which does not publish surefire reports generated outside the surefire-plugin for maven (non-freestyle) projects.

Related

Cucumber : Setting setSkippedAsNotFailing is not working when I am running from jenkins

Below are my Jenkins setup:
Created Freestyle project
In Build section added :- Invoke top-level Maven targets In
In Post-Build Actions added:- Cucumber reports
However the same is working fine when I am executing from maven. here is the pom.xml setting related to cucumber reports.
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>5.4.0</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>Sample</projectName>
<skip>false</skip>
<outputDirectory>${project.build.directory}/cucumber-reports</outputDirectory>
<inputDirectory>${project.build.directory}/cucumber-reports</inputDirectory>
<buildNumber>2</buildNumber>
<jsonFiles>
<param>**/*.json</param>
</jsonFiles>
<classificationDirectory>${project.build.directory}/cucumber-reports</classificationDirectory>
<classificationFiles>
<param>*.properties</param>
</classificationFiles>
<checkBuildResult>false</checkBuildResult>
<setSkippedAsNotFailing>true</setSkippedAsNotFailing>
<treatPendingAsFailed>false</treatPendingAsFailed>
<treatUndefinedAsFailed>false</treatUndefinedAsFailed>
</configuration>
</execution>
</executions>
</plugin>
Please let ne know what I am missing..
Unfortunately, cucumber-reports-plugin does not have a setting for its own notFailingStatuses parameter(aka setSkippedAsNotFailing in pom) from cucumber-reporting library.
I have forked the plugin and made some changes to enable that setting. You can check it out here and build a custom plugin yourself.

How to use Atlassian Bamboo variables in Maven pom.xml?

I want to use Atlassian Bamboo to deploy non-Maven artifacts, that is artifacts created outside of Maven in another Bamboo task. So I created a Maven 3.x task and put it after the task that creates the artifacts and put deploy:deploy-file in the Goal box. The goal configuration requires the full path of the file I want to deploy. So I did this...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<executions>
<execution>
<id>deploy-my_artifact-tgz</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<!-- Will this work??? -->
<file>${bamboo.build.working.directory}/dist/my_artifact.tgz</file>
<url>${project.repoUrl}</url>
<repositoryId>${project.repoId}</repositoryId>
<groupId>${project.groupId}.rtim.garner</groupId>
<version>${project.version}</version>
<artifactId>my_artifact</artifactId>
<packaging>tgz</packaging>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Can I use the ${bamboo.build.working.directory} to define part of the file path inside the part of the , as I have above? Should I expect Bamboo to substitute this to the correct value?
NOTE: Showing the effective pom in the Bamboo job does not substitute the varables' corresponding value so I can't tell.
I had to pass it the value of the variable. So I have this in my Goal text box of my Bamboo Maven task.
-Dbamboo.build.working.directory=${bamboo.build.working.directory} deploy:deploy-file

Jmeter Reports do not get generated if there are errors if the Jmeter Test executed using Jmeter Maven Plugin

I am running Jmeter tests using Jmeter Maven Plugin. After I run the test I want to generate simple reports that indicate if the tests passed/failed. I referred to
https://stackoverflow.com/questions/4669467/jmeter-how-to-create-summary-report-from-jtl-file?lq=1
for generating the reports. I have added a shell script to generate html reports from the jmeter jtl result files.Then I use the exec-maven plugin to execute the script that in turn generates the html report files.So far Everything works fine. The problem that I am facing is that if one of the Jmeter tests fails then the report isn't generated at all.
So I am assuming that maven exits once it detects error in the test-suites and doesn't execute the exec-maven plugin and hence the shell script isnt called at all.
Can someone give me directions on this? Is there any property in the pom file or any settings that I can try to get around this. Any help would be truly appreciated!
You can set the <ignoreResultFailures> configuration setting to true to make the plugin ignore the failures and continue executing everything else.
+---+
<project>
[...]
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<ignoreResultFailures>true</ignoreResultFailures>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
[...]
</project>
+---+

Maven: Overview for the values of Maven properties

I would like to find out the values of all Maven properties as they apply to some Maven project.
mvn help:system lists OS environment variables and JVM system properties, but no Maven properties.
mvn help:evaluate only works in an interactive mode, that means I have to type a single Maven property, (e.g. ${project.build.outputDirectory}) to get the value of that property.
I'm looking for a way get a full list of all Maven properties and their values.
As a workaround, add this to the <plugins> ... </plugins> section inside your project's pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echoproperties />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
Now execute mvn validate.
On the console, prefixed with [echoproperties], there will be the full list of system properties, including those set by Maven such as project.build.outputDirectory, basedir, and settings.localRepository.
the maven-help-plugin does what you want, just call it with -Dexpression=project.properties this will print the properties tag of the effective pom.
mvn help:evaluate -Dexpression=project.properties
Bonus Points when you just want the properties output and not the maven output
mvn help:evaluate -Dexpression=project.properties -q -DforceStdout
or with the explicit version because -DforceStdout works since version 3.1.0
mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.properties -q -DforceStdout
Not sure if helps, but I found this when trying to do the same thing:
mvn com.github.ekryd.echo-maven-plugin:echo-maven-plugin:echo -Decho.message='${project.build.testOutputDirectory}'
From here.
Adding the following to ${user.home}/.m2/settings.xml:
<pluginGroups>
<pluginGroup>com.github.ekryd.echo-maven-plugin</pluginGroup>
</pluginGroups>
the command can be shortened to:
mvn echo:echo -Decho.message='${project.build.testOutputDirectory}'
I don't know how to get them "officially", but here is a workaround. Add maven-antrun-plugin to your project and run mvn test -X. The plugin will show all properties passed to it from Maven. The list looks complete to me.
Actually project.build.outputDirectory is there but you need to execute in 'compile' phase, and NOT in 'validate'. I guess what properties are available also depends on the current phase for the executing goal of a particular plug-in, in this case 'maven-antrun-plugin'.
<!-- Ant Run Plugin for debugging pom.xml and calling ant tasks -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${ant.plugin.version}</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echoproperties/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
Had the same issue. Changed the timeout and maxheap in findbugs configuration through maven.
The below fixed it for me :
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<maxHeap>2048</maxHeap>
<timeout>1800000</timeout>
</configuration>
</plugin>

Maven Grails Plugin Environment

how do I specify build goals like development, test or production environment in the maven grails plugin when packaging a war file for deployment?
Thanks
Set grails.env when running maven:
mvn package -Dgrails.env=development
If you omit this option, the environment defaults to production.
You can also set it in the <configuration> section
<plugin>
<groupId>org.grails</groupId>
<artifactId>grails-maven-plugin</artifactId>
<version>1.3.7</version>
<executions>
<execution>
<goals>
<goal>maven-war</goal>
</goals>
<configuration>
<env>prod</env>
</configuration>
</execution>
</executions>
</plugin>

Resources