在Gradle退出时运行单个JUnit5测试,并显示STANDARD_ERROR

hgncfbus  于 2022-11-24  发布在  其他
关注(0)|答案(1)|浏览(180)

正在运行的测试显示已通过,但Gradle测试执行器显示STANDARD_ERROR。

>>./gradlew --stop                                                                                                     
Stopping Daemon(s)
1 Daemon stopped
>>./gradlew test --tests com.tudu.task.TaskListTests.tasksAddedSequentiallyWithDescendingDueDateAreSortedByAscendingDueDate
Starting a Gradle Daemon, 8 stopped Daemons could not be reused, use --status for details

> Task :test

Gradle Test Executor 1 STANDARD_ERROR
Mar 11, 2021 4:53:00 PM org.junit.platform.launcher.core.EngineDiscoveryOrchestrator lambda$logTestDescriptorExclusionReasons$7
INFO: 0 containers and 1 tests were Method or class mismatch

TaskListTests > tasks added sequentially with descending due date are sorted by ascending due date PASSED

当我运行完整的测试文件时,没有出现此错误。

>>./gradlew test --tests com.tudu.task.TaskListTests                                                                       

> Task :test

TaskListTests > tasks added sequentially with descending due date are sorted by ascending due date PASSED

TaskListTests > tasks added sequentially with random due date are sorted by ascending due date PASSED

"方法或类不匹配"是什么意思?什么导致STANDARD_ERROR?

lmvvr0a8

lmvvr0a81#

STANDARD_ERROR是当前JUnit 5的行为:https://github.com/junit-team/junit5/issues/1774
您可以使用下面的*.properties示例尝试解决方法:https://github.com/junit-team/junit5/issues/1774#issuecomment-463662553

handlers=java.util.logging.ConsoleHandler
.level=INFO

org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.level=WARNING

相关问题