mirror of https://gitee.com/bigwinds/arangodb
Feature/jenkins pipeline (#3218)
This commit is contained in:
parent
33e3ead888
commit
e62d0a367f
|
@ -202,7 +202,7 @@ def checkCoresAndSave(os, runDir, name, archRuns, archCores) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
sh "for i in logs out tmp; do test -e \"${runDir}/\$i\" && mv \"${runDir}/\$i\" \"${archRuns}/${name}.\$i\" || true; done"
|
||||
sh "for i in logs out tmp result; do test -e \"${runDir}/\$i\" && mv \"${runDir}/\$i\" \"${archRuns}/${name}.\$i\" || true; done"
|
||||
|
||||
def files = findFiles(glob: '${runDir}/core*')
|
||||
|
||||
|
@ -400,14 +400,11 @@ def checkCommitMessages() {
|
|||
]
|
||||
}
|
||||
else {
|
||||
|
||||
restrictions = [
|
||||
"build-community-mac" : true,
|
||||
// "build-community-windows" : true,
|
||||
"build-enterprise-linux" : true,
|
||||
"test-cluster-enterprise-rocksdb-linux" : true,
|
||||
"test-singleserver-community-mmfiles-mac" : true
|
||||
// "test-singleserver-community-rocksdb-windows" : true
|
||||
"test-singleserver-enterprise-mmfiles-linux" : true
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -438,6 +435,10 @@ Restrictions: ${restrictions.keySet().join(", ")}
|
|||
def stashBinaries(os, edition) {
|
||||
def paths = ["build/etc", "etc", "Installation/Pipeline", "js", "scripts", "UnitTests"]
|
||||
|
||||
if (edition == "enterprise") {
|
||||
paths << "enterprise/js"
|
||||
}
|
||||
|
||||
if (os == "windows") {
|
||||
paths << "build/bin/RelWithDebInfo"
|
||||
paths << "build/tests/RelWithDebInfo"
|
||||
|
@ -488,75 +489,68 @@ def jslint() {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
def getTests(os, edition, mode, engine) {
|
||||
if (mode == "singleserver") {
|
||||
return [
|
||||
["agency", "agency", ""],
|
||||
["boost", "boost", "--skipCache false"],
|
||||
["arangobench", "arangobench", ""],
|
||||
def tests = [
|
||||
["arangobench", "arangobench" , ""],
|
||||
["arangosh", "arangosh", "--skipShebang true"],
|
||||
["authentication", "authentication", ""],
|
||||
["authentication_server", "authentication_server", ""],
|
||||
["authentication_parameters", "authentication_parameters", ""],
|
||||
["cluster_sync", "cluster_sync", ""],
|
||||
["config", "config", ""],
|
||||
["dfdb", "dfdb", ""],
|
||||
//"dump",
|
||||
//"dump_authentication",
|
||||
["config", "config" , ""],
|
||||
["dump", "dump" , ""],
|
||||
["dump_authentication", "dump_authentication" , ""],
|
||||
["endpoints", "endpoints", ""],
|
||||
rspecify(os, "http_replication"),
|
||||
rspecify(os, "http_server"),
|
||||
["replication_sync", "replication_sync", ""],
|
||||
["replication_static", "replication_static", ""],
|
||||
["replication_ongoing", "replication_ongoing", ""],
|
||||
["server_http", "server_http", ""],
|
||||
["shell_client", "shell_client", ""],
|
||||
["shell_replication", "shell_replication", ""],
|
||||
["shell_server", "shell_server", ""],
|
||||
["shell_server_aql_1", "shell_server_aql", "--testBuckets 4/0", ,""],
|
||||
["shell_server_aql_2", "shell_server_aql", "--testBuckets 4/1", ,""],
|
||||
["shell_server_aql_3", "shell_server_aql", "--testBuckets 4/2", ,""],
|
||||
["shell_server_aql_4", "shell_server_aql", "--testBuckets 4/3", ,""],
|
||||
rspecify(os, "ssl_server"),
|
||||
["upgrade", "upgrade" , ""]
|
||||
]
|
||||
}
|
||||
else {
|
||||
return [
|
||||
["arangobench", "arangobench" , ""],
|
||||
["arangosh", "arangosh" , "--skipShebang true"],
|
||||
["authentication", "authentication" , ""],
|
||||
["authentication_server", "authentication_server", ""],
|
||||
["authentication_parameters", "authentication_parameters" , ""],
|
||||
["config", "config" , ""],
|
||||
["dump", "dump" , ""],
|
||||
["dump_authentication", "dump_authentication" , ""],
|
||||
["endpoints", "endpoints" , ""],
|
||||
["upgrade", "upgrade" , ""],
|
||||
rspecify(os, "http_server"),
|
||||
["server_http", "server_http", ""],
|
||||
["shell_client", "shell_client", ""],
|
||||
["shell_server", "shell_server", ""],
|
||||
["shell_server_aql_1", "shell_server_aql", "--testBuckets 4/0"],
|
||||
["shell_server_aql_2", "shell_server_aql", "--testBuckets 4/1"],
|
||||
["shell_server_aql_3", "shell_server_aql", "--testBuckets 4/2"],
|
||||
["shell_server_aql_4", "shell_server_aql", "--testBuckets 4/3"],
|
||||
rspecify(os, "ssl_server"),
|
||||
["upgrade", "upgrade" , ""]
|
||||
rspecify(os, "ssl_server")
|
||||
]
|
||||
|
||||
if (edition == "enterprise") {
|
||||
tests += [
|
||||
["authentication_server", "authentication_server", ""]
|
||||
]
|
||||
}
|
||||
|
||||
if (mode == "singleserver") {
|
||||
tests += [
|
||||
["agency", "agency", ""],
|
||||
["boost", "boost", "--skipCache false"],
|
||||
["cluster_sync", "cluster_sync", ""],
|
||||
["dfdb", "dfdb", ""],
|
||||
["replication_ongoing", "replication_ongoing", ""],
|
||||
["replication_static", "replication_static", ""],
|
||||
["replication_sync", "replication_sync", ""],
|
||||
["shell_replication", "shell_replication", ""],
|
||||
rspecify(os, "http_replication")
|
||||
]
|
||||
}
|
||||
|
||||
return tests
|
||||
}
|
||||
|
||||
def setupTestEnvironment(os, logFile, runDir) {
|
||||
def setupTestEnvironment(os, edition, logFile, runDir) {
|
||||
fileOperations([
|
||||
folderCreateOperation("${runDir}/tmp"),
|
||||
])
|
||||
|
||||
def subdirs = ['build', 'etc', 'js', 'UnitTests']
|
||||
|
||||
if (edition == "enterprise") {
|
||||
subdirs << "enterprise"
|
||||
}
|
||||
|
||||
if (os == "windows") {
|
||||
for (file in ['build', 'etc', 'js', 'UnitTests']) {
|
||||
for (file in subdirs) {
|
||||
powershell "cd ${runDir} ; New-Item -Path ${file} -ItemType SymbolicLink -Value ..\\${file} | Out-Null"
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (file in ['build', 'etc', 'js', 'UnitTests']) {
|
||||
for (file in subdirs) {
|
||||
sh "ln -s ../${file} ${runDir}/${file}"
|
||||
}
|
||||
|
||||
|
@ -609,7 +603,7 @@ def executeTests(os, edition, mode, engine, portInit, arch, archRuns, archFailed
|
|||
|
||||
try {
|
||||
lock("test-${env.NODE_NAME}-${env.JOB_NAME}-${env.BUILD_ID}-${edition}-${engine}-${lockIndex}") {
|
||||
setupTestEnvironment(os, logFile, runDir)
|
||||
setupTestEnvironment(os, edition, logFile, runDir)
|
||||
|
||||
try {
|
||||
timeout(30) {
|
||||
|
@ -621,14 +615,16 @@ def executeTests(os, edition, mode, engine, portInit, arch, archRuns, archFailed
|
|||
powershell "cd ${runDir} ; ${command} | Add-Content -PassThru ${logFile}"
|
||||
}
|
||||
else {
|
||||
sh "echo \"Host: `hostname`\" | tee ${logFile}"
|
||||
sh "echo \"PWD: `pwd`\" | tee -a ${logFile}"
|
||||
sh "echo \"Date: `date`\" | tee -a ${logFile}"
|
||||
|
||||
command = "(cd ${runDir} ; echo 1 > result ; ${command} ; echo \$? > result) 2>&1 | " +
|
||||
"tee ${logFile} ; exit `cat ${runDir}/result`"
|
||||
"tee -a ${logFile} ; exit `cat ${runDir}/result`"
|
||||
echo "executing ${command}"
|
||||
sh command
|
||||
}
|
||||
}
|
||||
|
||||
checkCoresAndSave(os, runDir, name, archRuns, archCores)
|
||||
}
|
||||
}
|
||||
catch (exc) {
|
||||
|
@ -637,6 +633,9 @@ def executeTests(os, edition, mode, engine, portInit, arch, archRuns, archFailed
|
|||
copyFile(os, logFile, logFileFailed)
|
||||
throw exc
|
||||
}
|
||||
finally {
|
||||
checkCoresAndSave(os, runDir, name, archRuns, archCores)
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (exc) {
|
||||
|
@ -673,6 +672,7 @@ def testCheck(os, edition, mode, engine) {
|
|||
|
||||
def testStep(os, edition, mode, engine, testName) {
|
||||
return {
|
||||
if (testCheck(os, edition, mode, engine)) {
|
||||
node(testJenkins[os]) {
|
||||
stage(testName) {
|
||||
def archRel = "02_test_${os}_${edition}_${mode}_${engine}"
|
||||
|
@ -734,6 +734,7 @@ def testStep(os, edition, mode, engine, testName) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def testStepParallel(os, edition, modeList) {
|
||||
|
@ -741,13 +742,10 @@ def testStepParallel(os, edition, modeList) {
|
|||
|
||||
for (mode in modeList) {
|
||||
for (engine in ['mmfiles', 'rocksdb']) {
|
||||
if (testCheck(os, edition, mode, engine)) {
|
||||
def name = "test-${os}-${edition}-${mode}-${engine}";
|
||||
|
||||
branches[name] = testStep(os, edition, mode, engine, name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parallel branches
|
||||
}
|
||||
|
@ -937,11 +935,11 @@ def buildStepCheck(os, edition) {
|
|||
|
||||
def runEdition(os, edition) {
|
||||
return {
|
||||
if (buildStepCheck(os, edition)) {
|
||||
node(buildJenkins[os]) {
|
||||
stage("build-${os}-${edition}") {
|
||||
timeout(30) {
|
||||
checkoutCommunity()
|
||||
checkCommitMessages()
|
||||
|
||||
if (edition == "enterprise") {
|
||||
checkoutEnterprise()
|
||||
|
@ -967,6 +965,7 @@ def runEdition(os, edition) {
|
|||
|
||||
testStepParallel(os, edition, ['cluster', 'singleserver'])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -978,13 +977,12 @@ def runOperatingSystems(osList) {
|
|||
|
||||
for (os in osList) {
|
||||
for (edition in ['community', 'enterprise']) {
|
||||
if (buildStepCheck(os, edition)) {
|
||||
branches["build-${os}-${edition}"] = runEdition(os, edition)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parallel branches
|
||||
}
|
||||
|
||||
checkCommitMessages()
|
||||
runOperatingSystems(['linux', 'mac', 'windows'])
|
||||
|
|
Loading…
Reference in New Issue