2

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

eaolson
  • 14,717
  • 7
  • 43
  • 58
  • You have lots of moving parts in your situation: Markligic server, ml-unit-test, ml-gradle. I would suggest that you also tag your question as ml-gradle and ml-unit-test since the issues (and your description) lie close to tbose separate projects and nit the server itself. – David Ennis -CleverLlamas.com Nov 07 '20 at 10:08
  • 2
    Your configuration looks good to me. Please use Query Console to look at your modules database and confirm that the tests did get deployed. – Dave Cassel Nov 07 '20 at 14:13

1 Answers1

0

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.

eaolson
  • 14,717
  • 7
  • 43
  • 58