如何在Android上为Jenkins生成JUnit测试报告 [英] How to generate JUnit test reports on android for jenkins

查看:125
本文介绍了如何在Android上为Jenkins生成JUnit测试报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Jenkins中的发布JUnit测试结果报告",但无法使其适用于我的android测试项目. 我在詹金斯(Jenkins)的android测试项目的设置基于以下指南: https://wiki.jenkins-ci .org/display/JENKINS/Building + an + Android + app + and + test + project

I'am trying to make use of the "Publish JUnit test result report" in Jenkins, but can't get it to work for my android test project. The setup of my android test project in Jenkins is based on this guide: https://wiki.jenkins-ci.org/display/JENKINS/Building+an+Android+app+and+test+project

我希望有人能发布一个简单的分步指南,介绍如何从测试运行中获取JUnit测试结果报告,以便能够使用发布JUnit测试结果报告". 之所以要使用此功能,是因为Jenkins中Junit测试的标准控制台输出不是很方便.

I hope someone could post an easy step by step guide on how to get the JUnit test result reports out of the test run to being able to use "Publish JUnit test result report". Would like to use this feature because the standard console output of the Junit tests in Jenkins are not quite convenient.

我在Internet上找到了一些指南(不是很多),但是没有一个对我有用. 这是我到目前为止尝试过的(没有成功):

I found some guides (not so many) on the Internet, but non of them worked for me. This is what I tried so far (with no success):

  • 只需在不带参数的情况下添加发布JUnit测试结果报告"即可进行构建操作
  • 遵循本指南的建议,该指南建议可以从设备/仿真器中下载报告(
  • Just adding the "Publish JUnit test result report" post-build-action with no arguments
  • Followed this guide, which suggests, that the reports can be downloaded from the device/emulator ( http://blackriver.to/2012/08/android-continuous-integration-with-ant-and-jenkins-part-2-2/ )
  • Then this guide ( http ://blog.cloudbees.com/2012/11/unit-test-results-code-coverage-and.html ) which is similar to the previous guide, but adds a custom instrumentation library
  • And then I have found this API for ant on junit reports ( http:// ant.apache.org/manual/Tasks/junitreport.html ) but I have absolutly no idea how to add this to my android test projected generated by the android sdk

(某些链接显示不正确,因为不能用我的声誉发布两个以上的链接.)

(Some links are not displayed correctly because cant post more then two links with my reputition.)

非常感谢您的帮助:)

推荐答案

我只为自己解决了这个问题,这就是我的工作方式:

I just had to solve this problem for myself, this is how I got it working:

1.)安装性能插件 2.)在项目设置中,添加一个新的Post构建操作"Publish JUnit-testresults" 3.)作为路径,添加/app/build/androidTest-results/connected/*.xml(路径在您的计算机上可能会略有不同)

1.) Install the performance Plugin 2.) In the project settings, add a new Post build action "Publish JUnit-testresults" 3.) As path, add /app/build/androidTest-results/connected/*.xml (Path may be slightly different on your machine)

4.)现在,在第一次运行项目之后,您将拥有一个新的链接"Last testresult",并在右侧有一个图形表示.

4.) Now, after the project ran the first time, you have a new Link "Last testresult" and on the right side a graphical representation.

致谢

这篇关于如何在Android上为Jenkins生成JUnit测试报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆