integrating soapUI report into sonar - maven

I have the following setup. I use maven /soapUI maven plugin /soapUI to execute tests on a webservice. My target is to display the test results in sonar. As there is no real build going on in maven, there is nothing to analyze for sonar (if i understood that correct). Is there a a soapUI report format, that can be reused by sonar? Has anyone made experiences with such a setup?
Thanks.

Why not try and run soapui from Junit?
http://www.soapui.org/Test-Automation/integrating-with-junit.html
Maven will run them automatically as part of the build and Sonar should display the results normally.

Related

Is there any way to get the code coverage of a Concordion tests?

I have a Java Project with Concordian and Maven, and I would like to know if is there a way to get the code coverage of a Concordion tests?
take a look at Jacoco. It has a Maven plugin and can run locally or remotely.

Integration Test Code Coverage using jacoco and maven

I have a maven test project which tests our dev code. These 2 are different maven projects.
Test project access dev project via maven dependency.
I want to measure integration test code coverage against dev project using jacoco and maven plugin.
Previously I have done it using jacoco and sonar where test code generates jacoco.exec file and then I manually built dev project passing jacoc.exec as arg in jenkins and get code coverage report.
I was not basically looking for 100% automated way of doing this.
Have read couple of articles which uses jacoco with maven but all those uses single project.
Appreciate any help/pointer.
Thanks
The 'dirty trick' here is to accumulate Jacoco coverage reports. As you have different projects there is no legal way to do this as by design maven projects are to be built without direct dependency.
But in real world nothing is ideal:
You point JaCoco report file with fixed path. By the way you can do it relatively to your Maven repository which is pretty clean approach.
You build your projects in 2 phases: first phase build all projects running all possible tests. It's better to have separate JaCoco report files per unit and integration tests. But they should be the same among projects and projects shall be configured to accumulate reports.
Doing second pass you run your mvn sonar:sonar magics. This will bring you 2 sonar projects (as I understand now you have the same picture) but coverage will be much more precise. The key is unified reports calculated on previous stage.
Here is complete enough illustration of this idea and lot of references to more simple projects. And here is another question which illustrates idea.
Hope this helps. I do the same approach for my multi-module projects to get coverage for 'lower layer' modules when doing tests for 'higher layer' ones.

Manage multiple Surefire ReportPaths with Sonarqube/Jenkins

In my company we develope eclipse plugins continuously built by a Jenkins CI Server (with tycho & maven) which also executes the tests (Unit Tests and SWTBot Tests). As a post build action we send the test data (JaCoCo & Surefire reports) via maven to a SonarQube server for analysis. Our sources and tests are each located in an own module.
In src/com.mycompany.projectA/ we have the source from Project A.
In test/com.mycompany.projectA.tests.ut/ we have the unit tests from Project A.
In test/com.mycompany.projectA.tests.swtbot/ we have the swtbot tests from Project A.
In order to allow Sonar to find the Jacoco and Surefire reports for the tests of each source plugin we set the report paths in our pom.xml:
<sonar.jacoco.reportPath>${project.basedir}/../../test/${project.artifactId}.tests.ut/target/jacoco.exec</sonar.jacoco.reportPath>
<sonar.surefire.reportsPath>${project.basedir}/../../test/${project.artifactId}.tests.ut/target/surefire-reports</sonar.surefire.reportsPath>
But this only allows one test per plugin. To also see the SwtBot test coverage in SonarQube, we added the SWTBot tests as integration tests (yeah I know, not very neat...)
<sonar.jacoco.itReportPath>${project.basedir}/../../test/${project.artifactId}.tests.swtbot/target/jacoco.exec</sonar.jacoco.itReportPath>
Like this, we can at least see the unit test coverage as well as the SWTBot test coverage in SonarQube. But as we are only able to set one report path for the surefire reports, those are ignored by Sonar and we can not see how many SWTBot test passed/failed.
Is there a convenient way to add multiple locations of surefire reports to be considered in the analysis?
This is not possible yet, but there's a ticket open for that: https://jira.codehaus.org/browse/SONAR-4101
Feel free to watch it and vote for it.
Maybe you can append the jacoco.exec of each project together and put the integrated jacoco report to Sonar. The following link is a good example to integrate the jacoco report.
http://www.lordofthejars.com/2012/07/jacoco-in-maven-multi-module-projects.html

Getting Cobertura reports for pax-exam Integration Tests

I am running my Integration Tests using maven and the failsafe plugin. The tests themselves are executed using pax-exam (which uses pax-runner). Failsafe runs at the integration-test phase, and Cobertura at verify.
While I get reports for all my junit tests, I get nothing from the Integration Tests.
Is this even technically feasible, or would pax-runner need to support cobertura directly?
Any idea how I could solve this? I am also open to any other plugin that helps, but I do need to run integration tests on OSGi bundles..
Thanks!
Well, it's been a while. The closest thing I've found that could help out is instrumenting the builds and collecting cobertura.ser files after the pax-exam tests have run. It is far from a simple setup. I'll report as I go! relevant reference

Junit report as PDF, preferably with Maven

Hey all,
Looking for feedback if anyone has a good way to, when you finalize the code, run one last Junit run and create a PDF-version of the junit report.
Maven PDF plugin with Surefire report:
http://maven.apache.org/plugins/maven-pdf-plugin/surefire-report.html
You can use http://junitpdfreport.sourceforge.net
Unfortunately maven is not supported. You have to configure it with AntRun plugin.

Resources