如何显示充满junit测试结果文件的目录 [英] How to display a directory full of junit test result files

查看:130
本文介绍了如何显示充满junit测试结果文件的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为在云中进行测试的一部分,我计划将测试结果(我碰巧正在使用gradle)以xml的形式从一个短暂的容器中复制到一个s3存储桶中.

As part of testing in the cloud, I plan to copy my test results (I happen to be using gradle) as xml out of a short lived container to an s3 bucket.

我想知道什么是充分利用包含测试结果的存储桶的最佳方法,以及是否有人对如何使用最少的自定义代码获得最大的这些结果有想法,等等.

I am wondering what is the best approach for making use of the bucket full of test results and if anyone has ideas for how to get the most of these results with the least custom code, etc.

过去,我使用XSLT来处理此问题,以将XML转换为HTML,但是这种方法的工作量比我想做的还要多.

In the past I have handled this with XSLT to make the XML into HTML but that approach feels like more work than I'd like to have to do.

有没有人出于自己的目的解决此问题并可以分享您的方法?

Has anyone solved this issue for their own purposes that can share your approach?

正如我要指出的那样,如果有人对如何使用HTML有所了解,我还可以将gradle的HTML报告复制到s3存储桶中.

As I side note... I could also copy out to my s3 bucket the HTML reports from gradle if someone has an idea about how to use the HTML instead.

理想情况下,我将能够看到排序的结果列表,然后单击最新的列表以查看测试运行的详细信息.

Ideally, I would be able to see a sorted list of results and click on the most recent to see the test run details.

推荐答案

免责声明:我不是Devops家伙,在这里我将以开发人员的观点"提出

Disclaimer: I'm not a Devops guy, I'll present a "developer's" point of view here

IMO的答案取决于所有这些报告的确切用途.

The answer IMO depends on what exactly would like to do with all these reports.

简而言之,您可以从测试执行中获得text/xml报告(我不能说gradle,但在maven surefire插件中会创建这些报告,我相信gradle也会这样做).

In a nutshell, you can have text/xml reports from the test execution (I can't say for gradle but in maven surefire plugin creates these reports, I believe gradle does the same).

您还可以使用报告信息生成一个美观的网站,也有用于此目的的工具,例如 Allure报告.最重要的是,可以在构建目录中生成一些要显示的内容.

You can also generate a good looking site with the reports information, there are tools for this as well, for example Allure Reports. Bottom line, some stuff to be shown can be generated in the build directory.

复制报告就像复制文件一样简单,但是问题是当它们在S3中时会如何处理?

Copying the reports is as simple as copying a file, but the question is what would like to do with them when they're in S3?

据我所知,它是一个CI作业(例如Jenkins),可在构建期间运行测试,或者可能针对已部署的环境(在云中)进行自动化测试. 这些CI工具运行gradle来构建项目并运行测试,然后显示每个构建的测试结果,并记住最近的N个构建.它也可以与上述的诱人工具集成,并且只要构建存储在CI工具中,就可以显示每个构建的HTML报告.

In my understanding, its a Job for CI tools (like Jenkins) to run the tests during the build, or maybe a suit of automation tests against a deployed environment (in the cloud). These CI Tools run gradle to build the project, and run tests, then they show test results per build memorizing last N builds. It can also be integrated with tools like aforementioned allure and show the HTML report per build as long as the build is stored in CI tool.

所以我不确定我为什么要在云中运行测试"(假设在部署工件时从中运行测试套件).

So I'm not sure I understand why would you like to "run tests in the cloud" (from which I assume you're running tests suite when the artifact is being deployed).

关于所有这些结果可以做什么的可能构想:

As for possible ideas of what can be done with all these results:

  1. 您可以创建一个网站,该网站将显示各个版本的结果(同样,这是 已经由詹金斯(Jenkins)这样的CI工具解决了)

  1. You can create a site that will show the results across builds (again, this is already solved by CI tool like Jenkins)

您可以将运行测试的结果存储在某些数据库中,并提供一些 聪明的统计信息(如果通常是 绿色,并且您不在从不稳定的测试中恢复"项目的过程中 东西)

You can store the results of running the tests in some database and provide some clever statistics (I personally don't see much benefit if usually the build is green and you're not in the process of "recuperation" of project from flaky tests or something)

这篇关于如何显示充满junit测试结果文件的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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