簡體   English   中英

在 gradle 上運行單個 JUnit5 測試以 STANDARD_ERROR 退出

[英]Running a single JUnit5 test on gradle exits with STANDARD_ERROR

正在運行的測試顯示已通過,但 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

“方法或 class 不匹配”是什么意思? 是什么導致了 STANDARD_ERROR?

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM