I am running TestNg testcases through ant file which is called by hudson. I am using testng-plugin for hudson, which is getting the test-result.xml file. But it do not mail the report. I am able to see the following message in dashboard:
Looking for TestNG results report in workspace using pattern: \scripts\ant\automation\reports\testng-results.xml
Saving reports...
Processing 'C:\Users\admin.hudson\jobs\Jing_MongoDB\builds\2013-08-28_09-35-40\testng\testng-results.xml'
TestNG Reports Processing: FINISH
Is it that this plugin do not send report,or am I need to configure something else.
The TestNG plugin doesn't send an email report of the test results, it just displays them in the build page.
If you want to include the test results in email, take a look at the email-ext plugin.
Related
I have a task to send reports of periodic execution of FitNesse tests to some specific endpoint in some specific JSON format.
I set periodic execution of tests in Jenkins properties and saving it in XML, but now I need to parse information about results of it.
It cannot be just step in "after build" property in Jenkins (or can, but I don't know a plugin for it), but what it would be and how I can do this?
Especially, I don't need information about the test, only general moments like date of the test, pass rate, status, name of the project, etc.
I think the best way to solve this is to make a script that parses the XML file, and creates the required JSON file. We normally use python scripts for this.
If you need certain generic information of the build in the script, like build number, you can pass this to your script using the Jenkins environments.
To call the script just add a batch or shell step, and place it below your fitnesse build step, to make sure the XML is generated before calling the script.
FitNesse comes with a jUnit runner which allows you to execute a test/suite. If you create a test class annotated with #RunWith(FitNesseRunner.class) and include its execution in a Jenkins Maven job (where the jUnit class is executed by either surefire or failsafe plugin), the outcome of the tests executed will be picked up automatically by Jenkins, just like it picks up other/regular jUnit tests (as surefire or failsafe will include them in their XML reports and Jenkins will pick these up).
You can find a sample Maven FitNesse project using (a slightly customised version of) this approach at https://github.com/fhoeben/sample-fitnesse-project. How to run the tests on Jenkins is described at https://github.com/fhoeben/hsac-fitnesse-fixtures#to-run-the-tests-on-a-build-server:
Have the build server checkout the project and execute mvn clean test-compile failsafe:integration-test. The result in JUnit XML results can be found in: target/failsafe-reports (Jenkins will pick these up automatically for a Maven job)
You indicate you don't need the HTML results, but they will be made available. They can be found in: target/fitnesse-results/index.html, and you could choose to use the 'HTML Publisher' Jenkins plugin to link to them from each build.
I have a Jenkins job that has 4 upstream jobs.
What I want help with:
Include the changes to upstream jobs in the email which is sent after the build for the downstream Jenkins job is complete.
The email that I send is a html report, which is generated by my python script as a post-build action. I include the html report as a pre-send action written in groovy script.
Does this plugin address your needs?
https://wiki.jenkins-ci.org/display/JENKINS/BlameSubversion
Edit:
For non-plugin solution, you will have to extract the SCM log from the API. Take any build (not job) URL, and add /api to the end to get a list of possible options. You may try /api/xml to get all the information in XML format. The SCM commit messages are under <changeSet> element.
Need to run a job in Jenkins after successfully running the tests it needs to perform as post-build action for generating test reports
For this i have configured
Publish JUnit test result report
In the field
Test Report XMLs: continuum/*/target/surefire-reports/*TestSuite.xml
'continuum/*/target/surefire-reports/TestSuite.xml' doesn't match anything: 'continuum' exists but not 'continuum//target/surefire-reports/*TestSuite.xml'
Can you please help me out in resolving the error....??
I assume you have an 'Execute JUnit tests' Build step. This will produce a JUnit XML file to a location you specify, say, TestOutput/junitresults.xml.
In the 'Publish JUnit test result report' Post Build step you just need to specify TestOutput/junitresults.xml.
As long as your tests executed and produced the output file the Post Build step won't fail to publish it, whether the tests failed or not.
You shouldn't be trying to publish files in the surefire-reports directory unless that it where you told JUnit to write its output file. Normally you wouldn't.
If you want to make it even simpler just tell JUnit to write its output file to the Jenkins WORKSPACE root by removing the TestOutput/ and just specify junitresults.xml.
I have an ASP .NET MVC project that is built in a Jenkins project. We're using the nUnit plugin to fangle the output from our unit tests as a post-build step.
I've just added Jasmine tests for the javascript in the project and added a step in MSBuild to have Chutzpah run the Jasmine tests and output the results in jUnit format.
I added a post build step to process the jUnit results file and Jenkins runs the build and presents two 'Test Results' links in the Build result page...
However, when I click those links both go to the same result. When I left yesterday it was the nUnit results this morning it's the jUnit results so I'm guessing that it's just whichever finished last?
Is this possible? Do I need to do things a different way?
I would try just using the xUnit plugin, that way you can configure it to take bothe the junit and nunit test results all in a single publisher.
There is a bug in Jenkins related to this: NUnit Plugin fails to merge Unit test reports with unit tests split on basis of category.
To get around this, just put your NUnit post build action as the last that it works!
I'm using Jasmine-reporters with Jasmine to output a bunch of JUnitXML format files that I need Hudson to parse for me and report on success/failure. Does anybody know how I would ask Hudson to go test a bunch of XML as part of the build process? Thanks!
In the job's "Post-build Actions", there should be a check box to "Publish JUnit test result report". You can put an ant-glob expression (as if you were writing an "includes" element) to match your xml files. I'm basing this on what I see in my Jenkins server; Hudson should be equivalent for your question.