unit-testingmarklogicml-gradlemarklogic-10

MarkLogic unit test not running any tests


I thought it would be a good idea to set up MarkLogic unit testing, so I've been following the unit-test-project as best as I can. Everything seems to work, but no unit tests are being performed. I've copied the four unit tests to src/test/ml-modules/root/suites/My Tests and the one module to src/main/ml-modules/root/. Everything deploys correctly. But running the unit tests gives me:

$ gradle mlUnitTest

> Task :mlUnitTest
Constructing DatabaseClient that will connect to port: 8021
Run teardown scripts: true
Run suite teardown scripts: true
Run code coverage: false
Running all suites...
Done running all suites; time: 1791ms


0 tests completed, 0 failed

The unit testing UI loads in a browser, but it also displays no tests.

This is my build.gradle file:

buildscript {
  repositories {
    jcenter()
    mavenLocal()
  }
  dependencies {
    classpath "com.marklogic:marklogic-unit-test-client:1.0.0"
    classpath "com.marklogic:ml-gradle:4.1.0"
  }
}
plugins { id "com.marklogic.ml-gradle" version "4.1.0" }
repositories {
  jcenter()
}
dependencies {
  mlBundle "com.marklogic:marklogic-unit-test-modules:1.0.0"
}

And gradle.properties:

mlAppName=unitTestApp
mlHost=localhost
mlUsername=admin
mlPassword=*****
mlRestPort=8020
mlTestRestPort=8021
mlModulePaths=src/main/ml-modules,src/test/ml-modules

I'm using MarkLogic 10, on 64 bit Linux, ml-gradle 4.0


Solution

  • Ah. It looks like the test suites are expected under the project directory in

    src/test/ml-modules/root/test/suites/SuiteName
    

    I had put suites under root and missed the second test directory.