Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Java Test Runner not recording any test output

未关闭
#1,772 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
28/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
java, typescript
领域
testing

调研方向

报告指出了 Java Test Runner 和项目的 build.gradle.kts,其中 JUnit 测试通过 Gradle 调用。首先复现测试运行,并检查 Debug Console 和 Gradle 构建输出;当确定该项目不记录任何测试输出的原因并恢复成功的测试执行后,即视为完成。

由索引模型根据 Issue 内容生成。

描述

ai-triaged bug gradle investigating junit test-discovery test-execution

When I first try to execute all JUnit tests, I receive this on the Debug Console:

Image

Image

After cleaning the Gradle project with "./gradlew clean build --refresh-dependencies" and trying to run the tests again, it tells me that my build has failed.

Here is my current build.gradle.kts file:

plugins {
    // Apply the application plugin to add support for building a CLI application in Java.
    id("java")
    application
    id("org.openjfx.javafxplugin") version "0.1.0"
}

repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

dependencies {
    // Use JUnit Jupiter for testing.
    testImplementation(platform("org.junit:junit-bom:5.10.0"))
    testImplementation("org.junit.jupiter:junit-jupiter")
    // https://mvnrepository.com/artifact/org.mockito/mockito-core
    testImplementation("org.mockito:mockito-junit-jupiter:5.15.+")
}

// Apply a specific Java toolchain to ease working on different environments.
java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(21)
    }
    sourceSets {
        named("main") {
            java {
                setSrcDirs(listOf("src/main/java"))
            }
        }
    }
}

javafx {
    version = "21.0.6"
    modules("javafx.controls", "javafx.fxml")
}

application {
    // Define the main class for the application.
    mainClass = "main"
}

tasks.named<Test>("test") {
    // Use JUnit Platform for unit tests.
    useJUnitPlatform()
}

I tried reloading my project, cleaning java language workspace etc. nothing seemed to change anything.
Important to note is that on a completely different cloned repository with the same gradle configurations, everything works fine.

Would appreciate any help with this, otherwise I'll stick to IntelliJ with the testing.

主要语言
TypeScript
星标
339
派生
174
平均合并
1 天 8 小时
30 天内合并 PR
12

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-java-test 的其他 Issue

查看 microsoft/vscode-java-test 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。