Skip to content

Generated tests can't be run in some Gradle projects #245

@EgorkaKulikov

Description

@EgorkaKulikov

Description

Tests generated with UtBot sometimes can not be run via standard Intellij Idea mechanism.

To Reproduce

  1. Create Gradle project without any custom settings
  2. Add an arbitrary class and generate tests for it with JUnit5
  3. Try to run generated tests

Expected behavior

Tests are successfully run in Intellij Idea

Actual behavior

Test events were not received error occurs

Additional context

This problem may be fixed manually adding the following code into build.gradle file:

test {
    useJUnit()
    useTestNG()
    useJUnitPlatform()
}

But it is not obvious how to do it programmatically.
The related question was sent to Intellij Support https://intellij-support.jetbrains.com/hc/en-us/community/posts/6168668718226-Enable-Gradle-native-support-programmatically

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions