Skip to content

Commit e93b81a

Browse files
DH4.3.3 Jenkins File issues
1 parent dcead8d commit e93b81a

File tree

3 files changed

+13
-174
lines changed

3 files changed

+13
-174
lines changed

Jenkinsfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pipeline{
5959
}
6060
}
6161
}
62+
stage('tests'){
6263
parallel{
6364
stage('Unit-Tests-11.3.0'){
6465
agent { label 'dhfLinuxAgent'}
@@ -156,6 +157,7 @@ pipeline{
156157
}
157158
}
158159
}
160+
}
159161
}
160162
stage('code-review'){
161163
when {

ml-data-hub-plugin/src/test/groovy/com/marklogic/gradle/task/HubUpdateTaskTest.groovy

Lines changed: 0 additions & 98 deletions
This file was deleted.

ml-data-hub-plugin/src/test/groovy/com/marklogic/gradle/task/InstalledTests.groovy

Lines changed: 11 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ package com.marklogic.gradle.task
1919

2020
import com.marklogic.client.io.DOMHandle
2121
import com.marklogic.client.io.DocumentMetadataHandle
22+
import com.marklogic.hub.Debugging
2223
import com.marklogic.hub.HubConfig
24+
import com.marklogic.hub.Tracing
2325
import org.apache.commons.io.FileUtils
2426
import org.gradle.testkit.runner.UnexpectedBuildFailure
2527
import org.gradle.testkit.runner.UnexpectedBuildSuccess
26-
import com.marklogic.hub.Tracing;
27-
import com.marklogic.hub.Debugging;
28-
29-
import java.nio.file.Paths
3028

3129
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual
3230
import static org.gradle.testkit.runner.TaskOutcome.FAILED
@@ -39,7 +37,7 @@ class InstalledTests extends BaseTest {
3937
// this will be relatively fast (idempotent) for already-installed hubs
4038
println(runTask('hubInstallModules', '-i').getOutput())
4139
println(runTask('mlLoadModules', '-i').getOutput())
42-
clearDatabases(HubConfig.DEFAULT_STAGING_NAME, HubConfig.DEFAULT_FINAL_NAME, HubConfig.DEFAULT_JOB_NAME);
40+
clearDatabases(HubConfig.DEFAULT_STAGING_NAME, HubConfig.DEFAULT_FINAL_NAME, HubConfig.DEFAULT_JOB_NAME)
4341
}
4442

4543
def cleanupSpec() {
@@ -110,25 +108,25 @@ class InstalledTests extends BaseTest {
110108
assert (getStagingDocCount() == 0)
111109
assert (getFinalDocCount() == 0)
112110

113-
DocumentMetadataHandle meta = new DocumentMetadataHandle();
114-
meta.getCollections().add("my-new-entity");
111+
DocumentMetadataHandle meta = new DocumentMetadataHandle()
112+
meta.getCollections().add("my-new-entity")
115113
installStagingDoc("/employee1.xml", meta, new File("src/test/resources/run-flow-test/employee1.xml").text)
116114
installStagingDoc("/employee2.xml", meta, new File("src/test/resources/run-flow-test/employee2.xml").text)
117115
assert (getStagingDocCount() == 2)
118116
assert (getFinalDocCount() == 0)
119-
String result;
117+
String result
120118
installModule("/entities/my-new-entity/harmonize/my-new-harmonize-flow/content/content.xqy", "run-flow-test/content.xqy")
121119

122120
when:
123-
result = runTask('hubRunFlow', '-Pdhf.key=value', '-PshowOptions=true','-PentityName=my-new-entity', '-PflowName=my-new-harmonize-flow', '-i').getOutput()
121+
result = runTask('hubRunFlow', '-Pdhf.key=value', '-PshowOptions=true', '-PentityName=my-new-entity', '-PflowName=my-new-harmonize-flow', '-i').getOutput()
124122
println(result)
125123

126124
then:
127125
notThrown(UnexpectedBuildFailure)
128126
getStagingDocCount() == 2
129127
getFinalDocCount() == 2
130-
assert(result.contains("key = value"))
131-
assert(! result.contains("dhf.key = value"))
128+
assert (result.contains("key = value"))
129+
assert (!result.contains("dhf.key = value"))
132130
assertXMLEqual(getXmlFromResource("run-flow-test/harmonized1.xml"), hubConfig().newFinalClient().newDocumentManager().read("/employee1.xml").next().getContent(new DOMHandle()).get())
133131
assertXMLEqual(getXmlFromResource("run-flow-test/harmonized2.xml"), hubConfig().newFinalClient().newDocumentManager().read("/employee2.xml").next().getContent(new DOMHandle()).get())
134132
}
@@ -142,8 +140,8 @@ class InstalledTests extends BaseTest {
142140
assert (getStagingDocCount() == 0)
143141
assert (getFinalDocCount() == 0)
144142

145-
DocumentMetadataHandle meta = new DocumentMetadataHandle();
146-
meta.getCollections().add("my-new-entity");
143+
DocumentMetadataHandle meta = new DocumentMetadataHandle()
144+
meta.getCollections().add("my-new-entity")
147145
installFinalDoc("/employee1.xml", meta, new File("src/test/resources/run-flow-test/employee1.xml").text)
148146
installFinalDoc("/employee2.xml", meta, new File("src/test/resources/run-flow-test/employee2.xml").text)
149147

@@ -185,67 +183,4 @@ class InstalledTests extends BaseTest {
185183
result.getOutput().contains('The following Flows are legacy flows:')
186184
result.getOutput().contains('legacy-test => legacy-input-flow')
187185
}
188-
189-
def "createHarmonizeFlow with useES flag"() {
190-
given:
191-
propertiesFile << """
192-
ext {
193-
entityName=Employee
194-
flowName=my-new-harmonize-flow
195-
useES=true
196-
}
197-
"""
198-
199-
when:
200-
runTask('hubUpdate')
201-
runTask('hubCreateEntity')
202-
copyResourceToFile("employee.entity.json", Paths.get(testProjectDir.root.toString(), "plugins", "entities", "Employee", "Employee.entity.json").toFile())
203-
runTask('mlLoadModules')
204-
def result = runTask('hubCreateHarmonizeFlow')
205-
206-
then:
207-
notThrown(UnexpectedBuildFailure)
208-
result.task(":hubCreateHarmonizeFlow").outcome == SUCCESS
209-
210-
File entityDir = Paths.get(testProjectDir.root.toString(), "plugins", "entities", "Employee", "harmonize", "my-new-harmonize-flow").toFile()
211-
entityDir.isDirectory() == true
212-
File contentPlugin = Paths.get(testProjectDir.root.toString(), "plugins", "entities", "Employee", "harmonize", "my-new-harmonize-flow", "content.sjs").toFile()
213-
contentPlugin.text.contains("extractInstanceEmployee")
214-
}
215-
216-
def "runHarmonizeFlow with bad sourceDB"() {
217-
given:
218-
219-
println(runTask('hubCreateHarmonizeFlow', '-PentityName=my-new-entity', '-PflowName=my-new-harmonize-flow', '-PdataFormat=xml', '-PpluginFormat=xqy', '-PuseES=false').getOutput())
220-
println(runTask('mlReLoadModules'))
221-
222-
clearDatabases(HubConfig.DEFAULT_STAGING_NAME, HubConfig.DEFAULT_FINAL_NAME)
223-
assert (getStagingDocCount() == 0)
224-
assert (getFinalDocCount() == 0)
225-
226-
DocumentMetadataHandle meta = new DocumentMetadataHandle();
227-
meta.getCollections().add("my-new-entity");
228-
installStagingDoc("/employee1.xml", meta, new File("src/test/resources/run-flow-test/employee1.xml").text)
229-
installStagingDoc("/employee2.xml", meta, new File("src/test/resources/run-flow-test/employee2.xml").text)
230-
231-
assert (getStagingDocCount() == 2)
232-
assert (getFinalDocCount() == 0)
233-
installModule("/entities/my-new-entity/harmonize/my-new-harmonize-flow/content/content.xqy", "run-flow-test/content.xqy")
234-
235-
236-
when:
237-
propertiesFile << """
238-
ext {
239-
entityName=my-new-entity
240-
flowName=my-new-harmonize-flow
241-
sourceDB=12345678
242-
}
243-
"""
244-
def result = runTask('hubRunFlow', '-i')
245-
246-
then:
247-
notThrown(UnexpectedBuildFailure)
248-
result.getOutput().contains('No such database 12345678')
249-
result.task(":hubRunFlow").outcome == SUCCESS
250-
}
251186
}

0 commit comments

Comments
 (0)