Skip to content

Commit 0295ef1

Browse files
committed
Moved test app files into "test-app" folder
No function changes, just a whole bunch of files moving out of "marklogic-spark-connector" and into "test-app". This should make @BillFarber quite happy.
1 parent eee9808 commit 0295ef1

File tree

76 files changed

+42
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+42
-45
lines changed

Jenkinsfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
@Library('shared-libraries') _
22

33
// Using testCodeCoverageReport from the jacoco-report-aggregation plugin to produce an aggregated code coverage
4-
// report, even though Sonar doesn't seem to be able to make sense of it yet.
4+
// report, even though Sonar doesn't seem to be able to make sense of it yet.
55
def runtests(String javaVersion){
66
sh label:'test', script: '''#!/bin/bash
77
export JAVA_HOME=$'''+javaVersion+'''
88
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
99
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
1010
cd marklogic-spark-connector
11-
echo "mlPassword=admin" > gradle-local.properties
1211
echo "Waiting for MarkLogic server to initialize."
1312
sleep 30s
1413
./gradlew -i mlDeploy

gradle.properties

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,6 @@
33
# 3.5.3 release notes - https://spark.apache.org/releases/spark-release-3-5-3.html .
44
sparkVersion=3.5.3
55

6-
# Only used for the test app and for running tests.
7-
mlHost=localhost
8-
mlAppName=spark-test
9-
mlRestPort=8015
10-
mlTestRestPort=8016
11-
mlUsername=admin
12-
mlPassword=set this in gradle-local.properties
13-
mlConfigPaths=src/test/ml-config
14-
mlModulePaths=src/test/ml-modules
15-
mlSchemaPaths=src/test/ml-schemas
16-
mlDataPaths=src/test/ml-data
17-
mlCascadePermissions=true
18-
# For now, only load the test data into the test database so that tests can use it.
19-
mlDataDatabaseName=spark-test-test-content
20-
21-
226
# Define these on the command line to publish to OSSRH
237
# See https://central.sonatype.org/publish/publish-gradle/#credentials for more information
248
mavenCentralUsername=

marklogic-spark-connector/build.gradle

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
22
id 'net.saliman.properties' version '1.5.2'
33
id 'com.gradleup.shadow' version '8.3.3'
4-
id "com.marklogic.ml-gradle" version "5.0.0"
54
id 'maven-publish'
65

76
// This is working in terms of nicely aggregating jacoco code coverage data from each subproject. It produces a very
@@ -101,18 +100,10 @@ dependencies {
101100
testImplementation "org.skyscreamer:jsonassert:1.5.1"
102101
}
103102

104-
test {
105-
// Allows mlHost to override the value in gradle.properties, which the test plumbing will default to.
106-
environment "mlHost", mlHost
107-
}
108-
109-
task reloadTestData(type: com.marklogic.gradle.task.MarkLogicTask) {
110-
description = "Convenience task for clearing the test database and reloading the test data; only intended for a connector developer to use."
111-
doLast {
112-
new com.marklogic.mgmt.resource.databases.DatabaseManager(getManageClient()).clearDatabase("spark-test-test-content")
113-
}
114-
}
115-
reloadTestData.finalizedBy mlLoadData
103+
//test {
104+
// // Allows mlHost to override the value in gradle.properties, which the test plumbing will default to.
105+
// environment "mlHost", mlHost
106+
//}
116107

117108
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
118109
test {
@@ -213,15 +204,3 @@ task gettingStartedZip(type: Zip) {
213204
archiveFileName = "marklogic-spark-getting-started-${version}.zip"
214205
destinationDirectory = file("build")
215206
}
216-
217-
tasks.register("addMarkLogic12SchemasIfNecessary", com.marklogic.gradle.task.MarkLogicTask) {
218-
description = "If testing against MarkLogic 12, include schemas that will not work on MarkLogic 11 or earlier."
219-
doLast {
220-
def version = new com.marklogic.mgmt.resource.clusters.ClusterManager(getManageClient()).getVersion()
221-
if (version.startsWith("12.")) {
222-
mlAppConfig.getSchemaPaths().add(new File(getProjectDir(), "src/test/ml-schemas-12").getAbsolutePath())
223-
}
224-
}
225-
}
226-
mlDeploy.dependsOn addMarkLogic12SchemasIfNecessary
227-
mlLoadSchemas.dependsOn addMarkLogic12SchemasIfNecessary

marklogic-spark-connector/src/test/java/com/marklogic/spark/TestConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
@Configuration
1111
@PropertySource(
12-
value = {"file:../gradle.properties", "file:../gradle-local.properties"},
12+
value = {"file:../test-app/gradle.properties", "file:../test-app/gradle-local.properties"},
1313
ignoreResourceNotFound = true
1414
)
1515
public class TestConfig extends SimpleTestConfig {

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include "marklogic-langchain4j", "marklogic-spark-api", "marklogic-spark-langchain4j", "marklogic-spark-connector"
1+
include "marklogic-langchain4j", "marklogic-spark-api", "marklogic-spark-langchain4j", "marklogic-spark-connector", "test-app"

test-app/build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
plugins {
2+
id "net.saliman.properties" version "1.5.2"
3+
id "com.marklogic.ml-gradle" version "5.0.0"
4+
}
5+
6+
task reloadTestData(type: com.marklogic.gradle.task.MarkLogicTask) {
7+
description = "Convenience task for clearing the test database and reloading the test data; only intended for a connector developer to use."
8+
doLast {
9+
new com.marklogic.mgmt.resource.databases.DatabaseManager(getManageClient()).clearDatabase("spark-test-test-content")
10+
}
11+
}
12+
reloadTestData.finalizedBy mlLoadData
13+
14+
tasks.register("addMarkLogic12SchemasIfNecessary", com.marklogic.gradle.task.MarkLogicTask) {
15+
description = "If testing against MarkLogic 12, include schemas that will not work on MarkLogic 11 or earlier."
16+
doLast {
17+
def version = new com.marklogic.mgmt.resource.clusters.ClusterManager(getManageClient()).getVersion()
18+
if (version.startsWith("12.")) {
19+
mlAppConfig.getSchemaPaths().add(new File(getProjectDir(), "src/main/ml-schemas-12").getAbsolutePath())
20+
}
21+
}
22+
}
23+
mlDeploy.dependsOn addMarkLogic12SchemasIfNecessary
24+
mlLoadSchemas.dependsOn addMarkLogic12SchemasIfNecessary

test-app/gradle.properties

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Only used for the test app and for running tests.
2+
mlHost=localhost
3+
mlAppName=spark-test
4+
mlRestPort=8015
5+
mlTestRestPort=8016
6+
mlUsername=admin
7+
mlPassword=admin
8+
mlCascadePermissions=true
9+
10+
# For now, only load the test data into the test database so that tests can use it.
11+
mlDataDatabaseName=spark-test-test-content

0 commit comments

Comments
 (0)