Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle with TestNg: No tests found

I am using gradle project

  1. Project is working fine with junit, but
  2. with TestNg i am getting build fail error with this
    Testing started at 9:18 PM ...
    9:18:08 PM: Executing tasks ':cleanTest :test --tests "abc.lau" --scan'...

    > Task :cleanTest
    > Task :compileJava NO-SOURCE
    > Task :processResources NO-SOURCE
    > Task :classes UP-TO-DATE
    > Task :compileTestJava
    > Task :processTestResources NO-SOURCE
    > Task :testClasses
    > Task :test FAILED
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':test'.
    > No tests found for given includes: [abc.lau](filter.includeTestsMatching)
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    * Get more help at https://help.gradle.org
    BUILD FAILED in 0s
    3 actionable tasks: 3 executed
like image 562
amit sharma Avatar asked Mar 03 '23 23:03

amit sharma


1 Answers

did you explicitly specify in build.gradle that you use testng?

test {
    useTestNG()
}
like image 184
Tymur Kubai aka SirDiR Avatar answered Mar 16 '23 13:03

Tymur Kubai aka SirDiR