Skip to content

Commit 8a1ea5d

Browse files
authored
Merge pull request #671 from marklogic/feature/task-fix
Fixing issue in mlUnitTest
2 parents 198d4cf + 35ca843 commit 8a1ea5d

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

src/main/groovy/com/marklogic/gradle/task/test/UnitTestTask.groovy

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,22 @@ class UnitTestTask extends MarkLogicTask {
5050

5151
try {
5252
def testManager = new TestManager(client)
53-
def runParams = buildRunParameters()
53+
54+
// Initially had the following block in its own method, but that caused issues since
55+
// marklogic-unit-test-client is a compileOnly dependency.
56+
def runParams = new TestManager.RunParameters()
57+
if (project.hasProperty("runTeardown")) {
58+
runParams.withRunTeardown(Boolean.parseBoolean(project.property("runTeardown")))
59+
}
60+
if (project.hasProperty("runSuiteTeardown")) {
61+
runParams.withRunSuiteTeardown(Boolean.parseBoolean(project.property("runSuiteTeardown")))
62+
}
63+
if (project.hasProperty("runCodeCoverage")) {
64+
runParams.withCalculateCoverage(Boolean.parseBoolean(project.property("runCodeCoverage")))
65+
}
66+
if (project.hasProperty("tests")) {
67+
runParams.withTestNames(project.property("tests").split(","))
68+
}
5469

5570
def suites
5671
long start = System.currentTimeMillis()
@@ -126,23 +141,6 @@ class UnitTestTask extends MarkLogicTask {
126141
return appConfig.newDatabaseClient()
127142
}
128143

129-
TestManager.RunParameters buildRunParameters() {
130-
def runParams = new TestManager.RunParameters()
131-
if (project.hasProperty("runTeardown")) {
132-
runParams.withRunTeardown(Boolean.parseBoolean(project.property("runTeardown")))
133-
}
134-
if (project.hasProperty("runSuiteTeardown")) {
135-
runParams.withRunSuiteTeardown(Boolean.parseBoolean(project.property("runSuiteTeardown")))
136-
}
137-
if (project.hasProperty("runCodeCoverage")) {
138-
runParams.withCalculateCoverage(Boolean.parseBoolean(project.property("runCodeCoverage")))
139-
}
140-
if (project.hasProperty("tests")) {
141-
runParams.withTestNames(project.property("tests").split(","))
142-
}
143-
return runParams
144-
}
145-
146144
static String escapeFilename(String filename) {
147145
return filename.replaceAll("(/|\\\\)", ".")
148146
}

0 commit comments

Comments
 (0)