Skip to content

run/debug uses gradle test when it shouldn't #353

Open
@robaho

Description

@robaho

Often times, a standalone java program will be placed in the src/test folder to avoid having it included in a minimal production jar. The problem is that if you try to run that program using a 'launch configuration' it always uses the gradle test command - which fails.

For example:

src/test/SimpleFileServer.java

it tries to run using:

JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-23.jdk/Contents/Home"
cd /Users/robertengels/httpserver; ./gradlew --configure-on-demand -x check cleanTest test --debug-jvm --tests SimpleFileServer

which fails, because SimpleFileServer is not a "test" (i.e. does not extend TestCase, etc.)

Is there any way to make this work?

Using extension 23.0.1 and VSCode 1.96.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions