ml-gradle icon indicating copy to clipboard operation
ml-gradle copied to clipboard

mlUnitTest: allow selection of test suites and test cases to run

Open dmcassel opened this issue 6 years ago • 2 comments

Currently the mlUnitTest task runs all test suites. Add parameters to control which suites and test cases are to be run.

dmcassel avatar Sep 18 '18 14:09 dmcassel

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.

rjrudin avatar Oct 19 '18 01:10 rjrudin

Another candidate ticket to move to ml-unit-test, I think..

grtjn avatar Apr 21 '21 12:04 grtjn

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)

rjrudin avatar Aug 09 '23 18:08 rjrudin

See #668

rjrudin avatar Sep 06 '23 16:09 rjrudin