Skip to content

Commit aecdca4

Browse files
committed
Merge branch 'release/6.0.0'
2 parents 2ed478f + 6f2f87b commit aecdca4

File tree

1,132 files changed

+28064
-21122
lines changed

Some content is hidden

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

1,132 files changed

+28064
-21122
lines changed

.classpath

-32
This file was deleted.

.github/CONTRIBUTING.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,7 @@ Use `git rebase` (not `git merge`) to sync your work from time to time.
131131
#### Test your code
132132

133133
Be sure to run the tests before submitting your pull request. PRs with failing
134-
tests won't be accepted.
135-
136-
First verify that you have valid server and admin auth info in
137-
`SERVER_ADMIN_USER` and `SERVER_ADMIN_PASS` fields in
138-
src/test/java/com/marklogic/client/test/Common.java
139-
140-
$ ./gradlew clean
141-
$ ./gradlew testServerInit
142-
$ ./gradlew test
134+
tests won't be accepted. See the instructions in this repository's README.md file for running the tests.
143135

144136

145137
#### If your server is not on localhost

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ buildSrc/build
2626
.idea
2727

2828
*/gradle/wrapper/gradle-wrapper.properties
29+
out
30+
uriCache.txt
31+
gradle-local.properties
32+
bin
33+
repairXMLFull.xml
34+
xml-with-props.xml
35+

.project

-23
This file was deleted.

.settings/org.eclipse.core.resources.prefs

-6
This file was deleted.

.settings/org.eclipse.jdt.core.prefs

-5
This file was deleted.

.settings/org.eclipse.m2e.core.prefs

-4
This file was deleted.

CONTRIBUTING.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
To develop the Java Client and ultimately submit a pull request, you'll first need to be able to build the client and
2+
run the tests locally.
3+
4+
Please see [this guide](.github/CONTRIBUTING.md) for information on creating and submitting a pull request.
5+
6+
To build the client locally, complete the following steps:
7+
8+
1. Clone this repository on your machine.
9+
2. Choose the appropriate branch (usually develop)
10+
3. Ensure you are using Java 8 or Java 11 or Java 17 (the JVM version used to compile should not matter as compiler flags
11+
are set to ensure the compiled code will run on Java 8; Jenkins pipelines also exist to ensure that the tests pass on
12+
Java 8, 11, and 17, and thus they should for you locally as well; note that if you load the project into an IDE, you
13+
should use Java 8 in case your IDE does not process the build.gradle config that conditionally brings in JAXB dependencies
14+
required by Java 9+.)
15+
4. Verify that you can build the client by running `./gradlew build -x test`
16+
17+
"Running the tests" in the context of developing and submitting a pull request refers to running the tests found
18+
in the `marklogic-client-api` module. The tests for this module depend on a
19+
[ml-gradle](https://github.com/marklogic-community/ml-gradle) application being deployed from the `test-app` module.
20+
This application contains a number of database and security resources that the tests depend on.
21+
The `./gradle.properties` file defines the connection properties for this application; these default
22+
to `localhost` and an admin password of `admin`. To override these, create the file `./gradle-local.properties`
23+
and add the following (you can override additional properties as necessary):
24+
25+
mlHost=changeme
26+
mlPassword=changeme
27+
28+
Note that additional properties are defined via `./tests-app/gradle.properties`, though it is not expected that these
29+
properties will need to be changed.
30+
31+
The application is then deployed via the following command:
32+
33+
./gradlew mlDeploy -i
34+
35+
You can then run the tests, which will use the values of `mlHost` and `mlPassword` for connecting to MarkLogic as an
36+
admin user:
37+
38+
./gradlew marklogic-client-api:test
39+
40+
Individual tests can be run in the following manner (replace `GraphsTest` with the name of the test class you wish to run):
41+
42+
./gradlew marklogic-client-api:test --tests GraphsTest
43+
44+
You can also undeploy the test application if you do not wish to keep it around on your MarkLogic instance:
45+
46+
./gradlew mlUndeploy -i -Pconfirm=true

Jenkinsfile

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
@Library('shared-libraries') _
2+
3+
def getJava(){
4+
if(env.JAVA_VERSION=="JAVA17"){
5+
return "/home/builder/java/jdk-17.0.2"
6+
}else if(env.JAVA_VERSION=="JAVA11"){
7+
return "/home/builder/java/jdk-11.0.2"
8+
}else{
9+
return "/home/builder/java/openjdk-1.8.0-262"
10+
}
11+
}
12+
13+
def runtests(String type, String version){
14+
copyRPM type, version
15+
setUpML '$WORKSPACE/xdmp/src/Mark*.rpm'
16+
copyConvertersRPM type,version
17+
setUpMLConverters '$WORKSPACE/xdmp/src/Mark*Converters*.rpm'
18+
sh label:'deploy test app', script: '''#!/bin/bash
19+
export JAVA_HOME=$JAVA_HOME_DIR
20+
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
21+
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
22+
cd java-client-api
23+
./gradlew -i mlDeploy -PmlForestDataDirectory=/space
24+
'''
25+
sh label:'run marklogic-client-api tests', script: '''#!/bin/bash
26+
export JAVA_HOME=$JAVA_HOME_DIR
27+
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
28+
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
29+
cd java-client-api
30+
./gradlew marklogic-client-api:test || true
31+
'''
32+
sh label:'run ml-development-tools tests', script: '''#!/bin/bash
33+
export JAVA_HOME=$JAVA_HOME_DIR
34+
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
35+
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
36+
cd java-client-api
37+
./gradlew ml-development-tools:setupTestServer || true
38+
./gradlew ml-development-tools:generateTests || true
39+
./gradlew ml-development-tools:test || true
40+
'''
41+
sh label:'run functional tests', script: '''#!/bin/bash
42+
export JAVA_HOME=$JAVA_HOME_DIR
43+
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
44+
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
45+
cd java-client-api
46+
./gradlew -i mlDeploy -PmlForestDataDirectory=/space
47+
./gradlew -i marklogic-client-api-functionaltests:runFunctionalTests || true
48+
'''
49+
sh label:'post-test-process', script: '''
50+
cd $WORKSPACE/java-client-api/marklogic-client-api/build/test-results/test/
51+
sed -i "s/classname=\\"/classname=\\"${STAGE_NAME}-/g" TEST*.xml
52+
cd $WORKSPACE/java-client-api/ml-development-tools/build/test-results/test/
53+
sed -i "s/classname=\\"/classname=\\"${STAGE_NAME}-/g" TEST*.xml
54+
cd $WORKSPACE/java-client-api/marklogic-client-api-functionaltests/build/test-results/runFragileTests/
55+
sed -i "s/classname=\\"/classname=\\"${STAGE_NAME}-/g" TEST*.xml
56+
cd $WORKSPACE/java-client-api/marklogic-client-api-functionaltests/build/test-results/runFastFunctionalTests/
57+
sed -i "s/classname=\\"/classname=\\"${STAGE_NAME}-/g" TEST*.xml
58+
cd $WORKSPACE/java-client-api/marklogic-client-api-functionaltests/build/test-results/runSlowFunctionalTests/
59+
sed -i "s/classname=\\"/classname=\\"${STAGE_NAME}-/g" TEST*.xml
60+
'''
61+
}
62+
63+
pipeline{
64+
agent {label 'javaClientLinuxPool'}
65+
options {
66+
checkoutToSubdirectory 'java-client-api'
67+
buildDiscarder logRotator(artifactDaysToKeepStr: '7', artifactNumToKeepStr: '', daysToKeepStr: '7', numToKeepStr: '10')
68+
}
69+
parameters{
70+
booleanParam(name: 'regressions', defaultValue: false, description: 'indicator if build is for regressions')
71+
string(name: 'Email', defaultValue: '' ,description: 'Who should I say send the email to?')
72+
string(name: 'JAVA_VERSION', defaultValue: 'JAVA8' ,description: 'Who should I say send the email to?')
73+
}
74+
environment{
75+
JAVA_HOME_DIR= getJava()
76+
GRADLE_DIR =".gradle"
77+
DMC_USER = credentials('MLBUILD_USER')
78+
DMC_PASSWORD = credentials('MLBUILD_PASSWORD')
79+
}
80+
stages {
81+
stage('pull-request-tests') {
82+
when {
83+
not {
84+
expression {return params.regressions}
85+
}
86+
}
87+
steps {
88+
copyRPM 'Latest','11.0'
89+
setUpML '$WORKSPACE/xdmp/src/Mark*.rpm'
90+
copyConvertersRPM 'Latest','11.0'
91+
setUpMLConverters '$WORKSPACE/xdmp/src/Mark*Converters*.rpm'
92+
sh label:'deploy test app', script: '''#!/bin/bash
93+
export JAVA_HOME=$JAVA_HOME_DIR
94+
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
95+
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
96+
cd java-client-api
97+
./gradlew -i mlDeploy -PmlForestDataDirectory=/space
98+
'''
99+
sh label:'run marklogic-client-api tests', script: '''#!/bin/bash
100+
export JAVA_HOME=$JAVA_HOME_DIR
101+
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
102+
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
103+
cd java-client-api
104+
./gradlew -i marklogic-client-api:test || true
105+
./gradlew marklogic-client-api-functionaltests:runFastFunctionalTests || true
106+
'''
107+
junit '**/build/**/TEST*.xml'
108+
}
109+
post{
110+
unsuccessful{
111+
script{
112+
if(params.regressions){
113+
sendMail params.Email,'<h3>Some Tests Failed on Released 11.0 ML Nightly Server Single Node </h3><h4><a href=${JENKINS_URL}/blue/organizations/jenkins/java-client-api-regression/detail/$JOB_BASE_NAME/$BUILD_ID/tests><font color=red>Check the Test Report</font></a></h4><h4><a href=${RUN_DISPLAY_URL}>Check the Pipeline View</a></h4><h4> <a href=${BUILD_URL}/console> Check Console Output Here</a></h4><h4>Please create bugs for the failed regressions and fix them</h4>',false,'${STAGE_NAME} on develop against ML 11.0-nightly Failed'
114+
}
115+
}
116+
}
117+
}
118+
}
119+
120+
stage('regressions-11.0-Latest') {
121+
when {
122+
allOf {
123+
branch 'develop'
124+
expression {return params.regressions}
125+
}
126+
}
127+
steps {
128+
runtests('Latest','11.0')
129+
junit '**/build/**/TEST*.xml'
130+
}
131+
post {
132+
unsuccessful {
133+
sendMail params.Email,'<h3>Some Tests Failed on Released 11.0 ML Nightly Server Single Node </h3><h4><a href=${JENKINS_URL}/blue/organizations/jenkins/java-client-api-regression/detail/$JOB_BASE_NAME/$BUILD_ID/tests><font color=red>Check the Test Report</font></a></h4><h4><a href=${RUN_DISPLAY_URL}>Check the Pipeline View</a></h4><h4> <a href=${BUILD_URL}/console> Check Console Output Here</a></h4><h4>Please create bugs for the failed regressions and fix them</h4>',false,'${STAGE_NAME} on develop against ML 11.0-nightly Failed'
134+
}
135+
}
136+
}
137+
138+
stage('regressions-10.0-9') {
139+
when {
140+
allOf {
141+
branch 'develop'
142+
expression {return params.regressions}
143+
}
144+
}
145+
steps {
146+
runtests('Release','10.0-9.5')
147+
junit '**/build/**/TEST*.xml'
148+
}
149+
post {
150+
unsuccessful {
151+
sendMail params.Email,'<h3>Some Tests Failed on Released 10.0-9.5 ML Server Single Node </h3><h4><a href=${JENKINS_URL}/blue/organizations/jenkins/java-client-api-regression/detail/$JOB_BASE_NAME/$BUILD_ID/tests><font color=red>Check the Test Report</font></a></h4><h4><a href=${RUN_DISPLAY_URL}>Check the Pipeline View</a></h4><h4> <a href=${BUILD_URL}/console> Check Console Output Here</a></h4><h4>Please create bugs for the failed regressions and fix them</h4>',false,'${STAGE_NAME} on develop against ML 10.0-9.5 Failed'
152+
}
153+
}
154+
}
155+
}
156+
}

0 commit comments

Comments
 (0)