Gradle TestNG tests do not work, even with test.useTestNG ()

My build.gradle looks like this:

 apply plugin: 'scala' apply plugin: 'java' sourceCompatibility = 1.8 version = '1.0' repositories { mavenCentral() } dependencies { compile "org.scala-lang:scala-library:2.11.4" compile 'org.reactivestreams:reactive-streams:1.0.0.RC1' compile 'org.reactivestreams:reactive-streams-tck:1.0.0.RC1' testCompile group: 'junit', name: 'junit', version: '4.11' testCompile group: 'org.testng', name: 'testng', version: '5.14.10' } test { useTestNG() } 

I have an implementation in Scala and TestNG in java. The test class does not actually contain any tests, but it does its parent class. Gradle seems to have no tests in the class.

 Skipping task ':testClasses' as it has no actions. :testClasses UP-TO-DATE :testClasses (Thread[main,5,main]) completed. Took 0.001 secs. :test (Thread[main,5,main]) started. :test Skipping task ':test' as it is up-to-date (took 0.048 secs). :test UP-TO-DATE 

Testing class compiled in build/classes/test

+1
source share
1 answer

TL; DR

Add the following code snippet for build.gradle:

 tasks.withType(Test) { scanForTestClasses = false include "**/*Test.class" // whatever Ant pattern matches your test class files } 

Explanation:

Here is the error that causes the problem you are facing. And here you can find a solution. Do not forget to raise all the answers (I mean Peter);)

+4
source

Source: https://habr.com/ru/post/981549/


All Articles