I followed the steps on creating a report in eclipse (http://earlwillis.wordpress.com/2012/01/31/getting-started-with-junit-reports/), however the junitreport does not show up Edit configurations section at the end. What do I need to do to fix this?
You need to be using Maven or Ant to be generating the report for you. Maven's Surefire and Surefire report plugins will give you what you need. Alternatively, if you followed the steps in that document as you say, you just need to configure an ant build properly.
Related
I am working on Spring4.0 Project with apache-maven-3.5.4 and Java 1.8 and would like to use SonarQube for code coverage and reports. I am using jacoco-maven-plugin 0.7.8 version plugin for that. I am able to see the details in the browser. But when I try to generate the report to HTML, I am not seeing the reports generated. I did a lot of research in Google and I followed the below
mvn sonar:sonar -Dsonar.issuesreport.html.enable=true
and i added the entry in POM as well. But the reports are not generated. Kindly help me in getting this resolved. Below is my configuration in POM file.
<!-- Sonar -->
<sonar.jacoco.itReportPath>${project.basedir}/../target/jacoco-
it.exec</sonar.jacoco.itReportPath>
<sonar.groovy.binaries>target/classes</sonar.groovy.binaries>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.4.0.905</version>
</plugin>
Issue report plugin was deprecated, so this option will not work with recent versions of SonarQube. SonarQube is able to display coverage and reports via its UI, so this functionality was dropped.
Uh, don't you have an issue with your pom? I see
<sonar.jacoco.itReportPath>${project.basedir}/../target/jacoco-
it.exec</sonar.jacoco.itReportPath>
With the default maven directory layout, the target directory is inside ${project.basidir}. I would expect an issue like "no such file or directory" when the plugin tries to generate the reports, unless it is created on the fly.
Try with
<sonar.jacoco.itReportPath>${project.basedir}/target/jacoco-
it.exec</sonar.jacoco.itReportPath>
or maybe even
<sonar.jacoco.itReportPath>target/jacoco-
it.exec</sonar.jacoco.itReportPath>
depending on what the parent directory is set to.
In recent version, you have to generate your own reports based on what api/issues gives you.
A simple JS script can do trick.
I am using Allure for test reporting of a JUnit 5 project. I am using both Maven and Gradle in the same project (for teaching purposes).
Regarding Maven, this is my pom.xml. Everything works as expected:
I run my tests with mvn test and the JSON files generated by Allure are stored on the folder build\allure-results
I managed to run launch the HTML report using mvn allure:serve
Regarding Gragle, this is my build.gradle. I have two problems here:
I would like to save the JSON file on build/allure-results when running my tests (gradle test) but I don't make it. The JSON files end in the default path, allure-results (in the root of the project).
Anybody knows how can be done?
I would like to launch the HTML report with Gradle, but I don't know how.
Is there any command equivalent to mvn allure:serve in Gradle?
If you want to copy some file or directory content into build/allure-results folder via Gradle, you might want to check the following example: https://github.com/sskorol/allure2-testng-report/blob/c89c6ba5cb22d812c5deec012014cc9e31310173/build.gradle#L38
Regarding your second question, please check the official plugin's page: https://github.com/allure-framework/allure-gradle
Technically, you just need to download allure commandline (required only once) via:
gradlew allureReport
Then you can open report in browser via:
gradlew allureServe
To scan the dependencies of my project for known security vulnerabilities, I'm running the org.owasp:dependency-check-maven Maven plugin as part of a Jenkins pipeline build.
The plugin happily creates the report as XML in ${project.build.directory}/security-reports, and now I'd like to have it show up in the Test Results section of my pipeline build. Ideally, it would look like in these screenshots, but plain old xUnit output would probably be fine as well.
Unfortunately, I can't get it to work. I installed the OWASP Dependency-Check Jenkins plugin, which sounds just right according to its documentation. But it seems I cannot figure out how to configure it properly.
I also tried archiving the XML file like regular Junit results from my Jenkinsfile, using junit '**/target/security-reports/*.xml'. But the Junit step doesn't seem to recognise it and complains about not finding any reports.
Can anyone help?
To make Jenkins collect and display results of OWASP Dependency-check you need to have OWASP Dependency-Check plugin installed and to add Post-build Action step "Publish OWASP Dependency-Check analysis results".
You should provide the path to your XML file in settings for this step, by default **/dependency-check-report.xml is used.
Folks!
I'm new on TestNG, and I'm trying it with Maven (Surefire plugin) and Eclipse.
When my tests are run by Maven its reports are put on target/surefire-reports as expected, but the same tests when run by Eclipse TestNG plugin I'd like them to be put inside a target subfolder also (and as so be cleaned by clean Maven goal and ignored by git, not saying about respecting Maven folder organization), but always go to the default ${basedir}/test-output.
There is a way I can do it? I'd prefer one that I do not need to manually config Eclipse settings (Couldn't TestNG in detect it's a Maven project and so change its output folder consistently?), but if there is no such way, anyone surely will help.
TIA and regards,
Heleno
There is a no way that testng plugin can automatically figure out.
You can set your testng preferences at the workspace or project level. If you set it at the workbench level then for all projects, by default, testng would put the results there.
Go to Window->Prefs->TestNG.
Change Output directory to be same as maven output directory.
You can follow the way that niharika_neo told...
Elsewise you can also create timestamp enabled folder that would be created for every maven run you do, so won't let your testng reports bother you much. If still bothering put testng reports to a specific folder.
You can provide a different folder in your pom as --
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
</properties>
and under configuration of your maven-surefire-plugin put --
<reportsDirectory>./test-output/${timestamp}</reportsDirectory>
You will need to reconfigure XML Reporter as described at http://testng.org/doc/documentation-main.html#logging-xml-reports to set the outputDirectory property.
From that page:
In order to configure this reporter you can use the -reporter option
in the command line or the Ant task with the nested
element. For each of these you must specify the class
org.testng.reporters.XMLReporter. Please note that you cannot
configure the built-in reporter because this one will only use default
settings. If you need just the XML report with custom settings you
will have to add it manually with one of the two methods and disable
the default listeners.
It isn't clear how this translates into a configuration for the Maven Surefire plugin.
I had the same issue and I resolved it by going to Window-> Preferences -> TestNG
From there I check marked Absolute output path and entered the absolute path in the Output directory. For example C:\TestResults
I am successfully running Cucumber test on my java/maven eclipse project. But when I add my project do Jenkins I always get the following error "cucumber.runtime.CucumberException: No features found at []".
I read in this thread Setting cucumber-jvm options in Maven from the command line that:
...tests are running in separate JVM, so you need to specify that system property in the test plugin configuration (i.e. surefire or failsafe plugin config in your pom.xml)
But I am not quite sure how to do this. Can anyone help me?
PS: I am using "cucumber-java" and "cucumber-junit" dependencies.
If you're using surefire, the plugin documentation page http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html shows few options you can try to set system properties
For example you can try the systemPropertyVariables plugin settings
do you see the feature files in your target folder on your Jenkins slave ? maybe your *.feature files get excluded because of an incorrect config of your resources exclusion/inclusion in Maven ?