ml-gradle
ml-gradle copied to clipboard
mlUnitTest: allow selection of test suites and test cases to run
Currently the mlUnitTest task runs all test suites. Add parameters to control which suites and test cases are to be run.
Just making a note that this will require an enhancement to marklogic-unit-test-client - the TestManager class doesn't yet accept a "tests" param to pass along to the REST endpoint.
Another candidate ticket to move to ml-unit-test, I think..
I am thinking that the following would be helpful:
./gradlew mlUnitTest -Psuite=suite1
./gradlew mlUnitTest -Psuite=suite1 -Ptests=test1,test2
The marklogic-unit-test REST extension already expects for rs:tests
to be a comma-delimited string.
We could also support:
./gradlew mlUnitTest -Psuites=suite1,suite2
where ml-gradle uses a delimiter for the suite names. If we do that though, I don't think a user would ever use -Ptests
as well as the odds of test names being in multiple suites seems rare. But we could still pass "tests" as long.
The above design means we'd want the following methods added to marklogic-unit-test:
// For the first use case
JUnitTestSuite runSuite(String suite, String commaDelimitedTestNames, the 3 boolean args)
// For the second use case
List<JUnitTestSuite> runSuites(List<String> suites, String commaDelimitedTestNames, the 3 boolean args)
See #668