Skip to content

Commit 0160b49

Browse files
committed
MLE-24733 Merging the two test ml-gradle projects
Needs two separate invocations to handle data/modules going to different locations.
1 parent 2d38258 commit 0160b49

File tree

77 files changed

+47
-701
lines changed

Some content is hidden

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

77 files changed

+47
-701
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions

Jenkinsfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def runTests() {
1616
./gradlew -i mlWaitTillReady
1717
./gradlew -i mlTestConnections
1818
./gradlew -i mlDeploy
19+
./gradlew -i -Penv=e2e mlLoadData mlLoadModules
1920
2021
cd ..
2122
rm -rf $WORKSPACE/*.xml || true
@@ -70,19 +71,12 @@ def runLint() {
7071

7172
def runE2ETests() {
7273
sh label: 'run-e2e-tests', script: '''
73-
export JAVA_HOME=$JAVA_HOME_DIR
74-
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
75-
export PATH=$JAVA_HOME/bin:${NODE_HOME_DIR}/bin:$PATH
74+
export PATH=${NODE_HOME_DIR}/bin:$PATH
7675
cd node-client-api
7776
node --version
7877
npm --version
7978
npm ci
8079
81-
cd test-complete-app-mlDeploy
82-
echo "Deploying from test-complete-app-mlDeploy"
83-
./gradlew -i mlDeploy
84-
cd ..
85-
8680
echo "Running test-complete tests"
8781
./node_modules/.bin/mocha --no-parallel -R xunit --timeout 60000 test-complete/ --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/test-complete-results.xml || true
8882
echo "Done with test-complete tests"

test-app/build.gradle

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ buildscript {
1212
}
1313

1414
plugins {
15-
id "net.saliman.properties" version "1.5.2"
15+
id "net.saliman.properties" version "1.6.0"
1616
}
1717

1818
apply plugin: "com.marklogic.ml-gradle"
@@ -46,3 +46,32 @@ ext {
4646
command.setValidFor(365)
4747
mlAppDeployer.commands.add(command)
4848
}
49+
50+
tasks.register("curlPeople", Exec) {
51+
commandLine = [
52+
'curl',
53+
'--fail',
54+
'--anyauth', '--user', 'admin:admin',
55+
'-i',
56+
'-X', 'POST',
57+
'--data-binary', '@./src/main/turtle/people/people.ttl',
58+
'-H', 'Content-type: text/turtle',
59+
'http://localhost:8079/v1/graphs?graph=/people'
60+
]
61+
}
62+
63+
tasks.register("curlCompanies", Exec) {
64+
commandLine = [
65+
'curl',
66+
'--fail',
67+
'--anyauth', '--user', 'admin:admin',
68+
'-i',
69+
'-X', 'POST',
70+
'--data-binary', '@./src/main/turtle/companies/companies_100.ttl',
71+
'-H', 'Content-type: text/turtle',
72+
'http://localhost:8079/v1/graphs?graph=/optic/sparql/test/companies.ttl'
73+
]
74+
}
75+
76+
mlDeploy.finalizedBy curlPeople
77+
mlDeploy.finalizedBy curlCompanies

test-app/gradle-e2e.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Defines properties for loading data and modules for the so-called "e2e" tests in "test-complete".
2+
mlDataPaths=src/main/ml-e2e-data
3+
mlModulePaths=src/main/ml-e2e-modules
4+
5+
mlDataDatabaseName=nodeOpticFunctionalTest
6+
mlModulesDatabaseName=nodeOpticFunctionalTestModules
7+
8+
mlNoRestServer=true

test-app/gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
# See https://github.com/stevesaliman/gradle-properties-plugin
2+
propertiesPluginEnvironmentNameProperty=env
3+
14
mlAppName=unittest-nodeapi
25
mlContentDatabaseName=unittest-nodeapi
36
mlHost=localhost
47
mlUsername=admin
58
mlPassword=admin
69
mlRestPort=8015
7-
mlContentForestsPerHost=3
10+
mlContentForestsPerHost=3

0 commit comments

Comments
 (0)