首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PITest在测试运行开始时挂起

PITest在测试运行开始时挂起
EN

Stack Overflow用户
提问于 2019-12-23 00:36:59
回答 1查看 486关注 0票数 0

我正在尝试在light4j (https://github.com/networknt/light-4j)的主版本上运行PITest,我或多或少随机选择了一个项目,以便在现实世界的代码上试用PITest。

测试在大多数模块上都完成得很好,除了light4j的'cient‘模块。运行时

代码语言:javascript
复制
mvn -X test org.pitest:pitest-maven:mutationCoverage

在light-4j/client文件夹中,正常的单元测试运行完成(所有测试都正常,跳过3次),但PITest似乎不会生成和执行突变。最后一条消息是

代码语言:javascript
复制
[INFO] Adding org.pitest:pitest to SUT classpath
[INFO] Mutating from /Users/jan/dev/inno/light-4j/client/target/classes
[INFO] Defaulting target classes to match packages in build directory
/-\|/-\|/-\|/-\|/-stderr  : WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.xnio.nio.NioXnio$2 (file:/Users/jan/.m2/repository/org/jboss/xnio/xnio-nio/3.3.8.Final/xnio-nio-3.3.8.Final.jar) to constructor sun.nio.ch.KQueueSelectorstderr  : Provider()
WARNING: Please consider reporting this to the maintainers of org.xnio.nio.NioXnio$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in astderr  :  future release

在那之后什么都不会发生。

light4j的正常构建成功完成。

可能的问题是什么?

[编辑时间:2020年2月5日:我已经派生了light4j存储库:https://github.com/jvermeir/light-4j,然后我执行了一个普通的构建mvn clean install,所以所有的工件都在我本地的maven存储库中。接下来,我在light4j项目的根级别更改了pom.xml,添加了

代码语言:javascript
复制
<plugin>
    <groupId>org.pitest</groupId>
    <artifactId>pitest-maven</artifactId>
    <version>1.4.10</version>
    <dependencies>
<!--                    <dependency>-->
<!--                        <groupId>org.pitest</groupId>-->
<!--                        <artifactId>pitest-junit5-plugin</artifactId>-->
<!--                        <version>0.10</version>-->
<!--                    </dependency>-->
    </dependencies>
</plugin>

最后,在build部分中,我从client文件夹中启用了PiTest来执行测试:mvn -X test org.pitest:pitest-maven:mutationCoverage > ../buildlog.txt这会生成一个build.txt文件,但也会在终端中显示几行代码:

代码语言:javascript
复制
17:10:30 PIT >> INFO : Verbose logging is disabled. If you encounter a problem, please enable it before reporting an issue.
17:10:30 PIT >> INFO : Sending 147 test classes to minion
17:10:30 PIT >> INFO : Sent tests to minion
17:10:30 PIT >> INFO : MINION : 17:10:30 PIT >> INFO : Checking environment

17:10:32 PIT >> INFO : MINION : 17:10:32 PIT >> INFO : Found  18 tests

17:10:32 PIT >> INFO : MINION : 17:10:32 PIT >> INFO : Dependency analysis reduced number of potential tests by 0

17:10:32 PIT >> INFO : MINION : 17:10:32 PIT >> INFO : 18 tests received

17:10:33 PIT >> INFO : MINION : WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.powermock.reflect.internal.WhiteboxImpl (file:/Users/jan/.m2/repository/org/powermock/powermock-reflect/2.0.2/powermock-reflect-2.0.2.jar) to method java
17:10:33 PIT >> INFO : MINION : .lang.Object.clone()
WARNING: Please consider reporting this to the maintainers of org.powermock.reflect.internal.WhiteboxImpl
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access
17:10:33 PIT >> INFO : MINION :  operations will be denied in a future release

17:11:24 PIT >> INFO : MINION : 17:11:24 PIT >> WARNING : More threads at end of test (46) com.networknt.client.Http2ClientTest than start. (5)

17:11:24 PIT >> INFO : Calculated coverage in 54 seconds.
17:11:25 PIT >> INFO : Created  92 mutation test units

build.txt的结尾如下所示:

代码语言:javascript
复制
[INFO] Adding org.pitest:pitest to SUT classpath
[INFO] Mutating from /Users/jan/dev/inno/light4jfork/light-4j/client/target/classes
[INFO] Defaulting target classes to match packages in build directory
-stderr  : WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.xnio.nio.NioXnio$2 (file:/Users/jan/.m2/repository/org/jboss/xnio/xnio-nio/3.3.8.Final/xnio-nio-3.3.8.Final.jar) to constructor sun.nio.ch.KQueueSelectorstderr  : Provider()
WARNING: Please consider reporting this to the maintainers of org.xnio.nio.NioXnio$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in astderr  :  future release
EN

回答 1

Stack Overflow用户

发布于 2020-02-04 09:19:10

我也尝试过同样的方法,它在客户端模块停止了。我只是在想,我们是否应该在pom.xml中添加pitest-maven插件

代码语言:javascript
复制
[INFO] Mutating from /home/steve/networknt/light-4j/client/target/classes
[INFO] Defaulting target classes to match packages in build directory
7:35:54 p.m. PIT >> INFO : Verbose logging is disabled. If you encounter a problem, please enable it before reporting an issue.
7:35:54 p.m. PIT >> INFO : Sending 147 test classes to minion
7:35:54 p.m. PIT >> INFO : Sent tests to minion
7:35:54 p.m. PIT >> INFO : MINION : 7:35:54 p.m. PIT >> INFO : Checking environment

7:35:55 p.m. PIT >> INFO : MINION : 7:35:55 p.m. PIT >> INFO : Found  18 tests

7:35:55 p.m. PIT >> INFO : MINION : 7:35:55 p.m. PIT >> INFO : Dependency analysis reduced number of potential tests by 0

7:35:55 p.m. PIT >> INFO : MINION : 7:35:55 p.m. PIT >> INFO : 18 tests received

7:35:56 p.m. PIT >> INFO : MINION : WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.powermock.reflect.internal.WhiteboxImpl (file:/home/steve/.m2/repository/org/powermock/powermock-reflect/2.0.2/powermock-reflect-2.0.2.jar) to method jav
7:35:56 p.m. PIT >> INFO : MINION : a.lang.Object.clone()
WARNING: Please consider reporting this to the maintainers of org.powermock.reflect.internal.WhiteboxImpl
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal acces
7:35:56 p.m. PIT >> INFO : MINION : s operations will be denied in a future release
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59446096

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档