Maven中的Scalatest:JUnit结果 [英] Scalatest in maven: JUnit results

查看:79
本文介绍了Maven中的Scalatest:JUnit结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Microsoft Visual Studio Team Services中设置了一个持续集成服务器.我可以通过 scalatest 构建代码并运行测试.

I have a continuous integration server set up in Microsoft Visual Studio Team Services. I am able to build my code and run my tests through scalatest.

但是,我无法弄清楚如何以JUnit格式输出结果.对于使用SBT的用户,我已经看到了许多结果,但是没有使用 Maven 的人.

However, I cannot figure out how to output the results in a JUnit format. I have seen many results for people using SBT, but none who are using Maven.

在配置下,"junitxml"标记是否应该生成正确的文件?那就意味着这是微软的问题.

Under configuration, is the 'junitxml' tag supposed to generate the correct file? This would mean it's a Microsoft problem then.

我的scalatest插件当前看起来像:

My scalatest plugin currently look like:

        <plugin>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest-maven-plugin</artifactId>
            <version>${maven.plugin.scalatest.version}</version>
            <configuration>
                <reportsDirectory>${project.build.directory}/scalatest-reports</reportsDirectory>
                <junitxml>jUnitResults</junitxml>
                <filereports>SparkTestSuite.txt</filereports>
            </configuration>
            <executions>
                <execution>
                    <id>test</id>
                    <goals>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

更新1:

无效的结果文件.确保文件'C:/a/1/s/common/target/scalatest-reports/jUnitResults/TEST-org.scalatest.tools.DiscoverySuite-2d5739be-0653-4b9d-a8ed-41b6d0f82e48.xml'的结果格式匹配"JUnit"测试结果格式.

Invalid results file. Make sure the result format of the file 'C:/a/1/s/common/target/scalatest-reports/jUnitResults/TEST-org.scalatest.tools.DiscoverySuite-2d5739be-0653-4b9d-a8ed-41b6d0f82e48.xml' matches 'JUnit' test results format.

推荐答案

我认为我能够解决这个问题.我的问题是我对VSTS的误解.但是,我的测试既生成了JUnit格式的测试结果,也生成了非JUnit格式的结果.因此,在我的构建配置中,我需要删除不必要的测试结果文件.VSTS并不是最直观的工具,因此对于测试结果的去向,我感到困惑.我的构建文件显示了通过的测试数量,但没有显示详细信息.我发现,如果在构建过程中测试失败,则失败的详细信息将显示在构建页面上.如果我想查看通过的测试的实际名称,则需要转到测试"选项卡,然后在运行"下查看.在那里,我将看到更详细的结果.

I think I was able to figure this out. My problem was with my misunderstanding of VSTS. However, my tests were generating both the JUnit formatted test results, as well as non-JUnit formatted results. So in my build configuration I need to remove the unnecessary test result files. VSTS is not the most intuitive tool to use, so I was confused as to where the test results were going. My build file shows me the number of tests that passed, but not details. I discovered that if a test fails during a build, details of the failure will show up on the build page. If I want to see the actual names of the tests which passed, I need to go to the "Test" tab and look under "Runs". There I will see a more detailed result.

这篇关于Maven中的Scalatest:JUnit结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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