How can jenkins find junit.xml in a zip file? - junit

I am running Jenkins on a script, that generates a junit.xml report file and other files. However, all those files are zipped by the script, hence Jenkins cannot find it.
Is there a way to make Jenkins unzip the .zip file , find my particular junit file and generate the run results ?
All this is in Linux.
Thanks

Jenkins has the ability to execute arbitrary shell commands as a build step, just add the 'Execute Shell' step to your build and put in the commands you want (presumably 'unzip' would be among them).
Once you've extracted the xml, provided your internal tool generates it using this schema the JUnit plugin just needs the path you extracted to and it will show the results on the build page.
If you have the option, I would really suggest executing your tests via gradle or maven, as outputs from those tasks will produce a report that Jenkins (and other tools) can already read, and can streamline the job setup process for your users. But, if you can't get away with that, the above should work for you.

Related

Cypress BDD - Unable to populate log.json file & messages.ndjson using the latest boiler plate code

I'm using the new boiler plate code present here - https://github.com/JoanEsquivel/cypress-cucumber-boilerplate on a Windows machine to generate a log.json file, which in turn makes use of the "cucumber-json-formatter.exe" to format the json file and generate a cucumber-html report. Seem to have followed all the steps correctly, but the log.json file is not getting populated with any data and in turn no cucumber-html report.
Steps followed:
Cloned the project
Performed npm commands to install all latest packages (not required but as a double-check)
Downloaded cucumber-json-formatter-windows-386 from https://github.com/cucumber/json-formatter/releases/tag/v19.0.0 , renamed to cucumber-json-formatter.exe and included in the project folder
Performed "npm run cypress:execution" command - This comes from the script in package.json file. Able to see the feature files getting executed in the terminal. This creates the json logs folder with the 2 json files (log.json, messages.ndjson)
Performed "node .\cucumber-html-report.js" command. This generates the cucumber-html report which is empty, because it should be the formatted version of the log.json file. The formatting is done by the cucumber-json-formatter.exe.
Reaching out, if anyone else also came across the same issue. If yes, require some guidance here please.

Where does the downloaded file go when execute robot framework using Jenkins

I need one help,
I am Executing a script of robot framework using Jenkins, as per the flow the script should download one XLS and validate the data using Pandas.
When I am executing the script using Jenkins and searching the downloaded file in a hardcoded path i.e. "C:\Users\Administrator\Downloads" the file is not found.
but when executing it manually the file downloaded on the same path
Can anyone please help me by telling me where do Jenkins stores all the downloaded files?
PS : I am using Google Chrome as web browser
For each job Jenkins runs, it creates a workspace directory, usually at:
$JENKINS_HOME/workspace/(Name of the Job)
The scripts (and robotframework's in this case) are run there, as the root directory. Most probably the downloaded file will be in a path from there (or an error should have occurred because the Jenkins user does not have access to the C:\Users... path).
There is a step in the Jenkins job, which is to archive (download) files from workspace, to Jenkins database, to be shown as "artifacts". Even the screenshots images or videos recording, must be registered in that step, so they can be viewed on the Report and Log in Jenkins (Robot Framework Plugin).

How to get throughput and response time in Jmeter in Non GUI mode

Actually I don't want to generate HTML file, it is unable to parse for rsp and tsp. I am using Jmeter on server and using from non GUI mode. I normally come across to run many different threads with more than 1 sampler requests. So , I need to get the response time and throughput for those threads on a quick and easy basis.
JTL result and csv file is giving rsp only. I need perfect solution which provides my solution.
even if there is a way to generate a csv file containing results of RSP and TSP which I need, will be fine for me.
** also I cant load the jtl file on jmeter on my system to check results manually.
Any suggestions are welcome.
The easiest option would be going for JMeterPluginsCMD Command Line Tool which can generate a CSV form of the Aggregate Report listener out of the .jtl results file, you will need to execute a command like:
JMeterPluginsCMD.bat --generate-csv report.csv --input-jtl result.jtl --plugin-type AggregateReport
Just replace result.jtl with your .jtl results file name and the tool will create the Aggregate Report for you,
You can install this JMeterPluginsCMD Command Line Tool along with
Synthesis Report using JMeter Plugins Manager
Steps to Generate CSV including Throughput and Responsetime
-1- Need to install JMeter Plugin Manager - Download the jar file "jmeter-plugins-manager-1.1.jar" - Place it in lib/ext
-2- Install command-line graph plotting tool using JMeter Plugin Manager option in "Options"
-3- Install jpgc-synthesis for AggregateReport using JMeter Plugin Mangager
-4- And use the following command
java -jar C:\Performance\apache-jmeter-3.3\lib\cmdrunner-2.2.jar --tool Reporter --generate-csv test.csv --input-jtl testJmeter3.jtl --plugin-type SynthesisReport

Custom Reporting to Jenkins

I'm trying to hook up our own private testing tool to Jenkins. I'm able to run the test through the command line and create a report on my local machine. I will need to convert that report to xml JUnit format, specifically for Jenkins. Once that is done, how do I associate the xml file that was just created to the most recent job. This way the correct report gets put with the correct job?
The way Jenkins works is simple: you create a job and Jenkins runs it. Every run of a job is called a build. If you configure the job to look for test report files at the end of a build, the test reports are loaded and presented in the Jenkins UI. There is no way to submit test reports to a build outside of the build or after the build.
Usually this is not a problem. You run your test program/script as part of the build and it produces xml files in the JUnit format. When all the build steps are done, Jenkins looks for the xml files and loads them. You have to tell Jenkins to do it, though. You open the job configuration and you add a new post-build action titled "Publish JUnit test result report". Then you give Jenkins a pattern it uses to search for the files. You can use **/*.xml which means Jenkins will look for all *.xml files in every directory and subdirectory. Or you can e.g. use **/testreports/*.xml if you know where the test reports are going to be.

Ant script generate a findbugs_result.xml, but the hudson can not display on main interface. why?

Findbugs script in build.xml:
Findbugs checks Coding...
Findbugs checks Coding...
genetate a findbugs_result.xml.
Download Findbugs plugin for hudson.
Enter findbugs_result.xml path for hudson.
But hudson can not display on main interface. why?
I've found some annoying inconsistencies in the way Hudson stores paths; sometimes you use the overall workspace directory for the Hudson job and other times you have to use the path to the code that the job checks out of source control. For example, if your code gets checked out to MyProject under your workspace directory, and then the test XML files go into MyProject/target/test-reports, try specifying the path with and without the MyProject at the beginning of the path.