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

查看:34
本文介绍了如何在 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.

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

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):

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

(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.) 在项目设置中,添加一个新的构建后操作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天全站免登陆