Skip to content

XML output for Jenkins intergration #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RichardGuion opened this issue May 23, 2013 · 7 comments · Fixed by #106
Closed

XML output for Jenkins intergration #100

RichardGuion opened this issue May 23, 2013 · 7 comments · Fixed by #106

Comments

@RichardGuion
Copy link

I have Spoon executed through a Jenkins job and it works fine. In addition to the super nice HMTL reports that Spoon produces (which I was able to provide a link to in the build artifacts), people in the company would like to see Jenkins consume an XML file with the test results. We could then turn on the Post build action "Publish JUnit test result report" and get the graph with the Test Result trend and table breakdown of the tests that were executed, pass/fail state, duration, etc.

Do you have any plans to add this to Spoon?

If not, I can take a crack at it. It seems like the file result.json has all the data. I could read that in and generate the XML in the format required for Jenkins.

@JakeWharton
Copy link
Collaborator

No plans, but it'd be a great addition. result.json is just a serialized version of data that we have represented by objects. Add another class (or classes) that spit out JUnit-compatible XML, pass it the object, and call it where we generate the normal website!

@ducrohet
Copy link
Contributor

I don't know how you run the tests but in ddmlib there is now (not sure when this showed up) a XmlTestRunListener that can create those XML files directly.

They are to be used with the RemoteAndroidTestRunner, which I'm guessing you are not using, but just throwing it out in case you want to take a look.

@JakeWharton
Copy link
Collaborator

Is there anywhere special the XML files have to be placed in order to be picked up?

@RichardGuion
Copy link
Author

There is a setting Hudson/Jenkins where the XML file can be consumed as a build artifact. You specify the sub-folder under the Jenkins workspace. I think if you generate the XML file in the top level Spoon folder, the user can copy it over to the location for Jenkins.

We do a little trick with your index.html file. The spoon results are generated in a /var/www folder referenced by Apache web server. When the test job is done, we create a little html that contains a javascript to forward the user over to the Spoon results on the web server.

@JakeWharton
Copy link
Collaborator

They are to be used with the RemoteAndroidTestRunner, which I'm guessing you are not using, but just throwing it out in case you want to take a look.

We are using this and I'm all about re-using work that someone else already did. This will also allow us to output emma reports for #67. Thanks for the pointer.

@JakeWharton
Copy link
Collaborator

@RichardGuion Please review #106.

@tandroidt
Copy link

HI where can I find this report?
I asked in a separated issue and been told it is in "junit-reports" folder, but I don't have this folder on the device not on the Jenkins slave.
I can't find any documentation about to where it is generated, and if it is generated by default or I should add something to the command to get it.
This is how I run spoon now :

java -jar $SPOON_JAR --apk $APK_PATH --test-apk $TEST_APK_PATH --output $SPOON_REPORT_PATH --title "$TITLE" --class-name $TEST_SUITE_CLASS

Please help me!
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants