-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* reduce time cost about ci test by parallel * add `-DNO_WERROR=ON` to cmake config for release-darwin build * Fix tidb_ghpr_tics_test fail (#1895) Signed-off-by: Zhigao Tong <[email protected]>
- Loading branch information
Showing
57 changed files
with
360 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
catchError { | ||
def util = load('util.groovy') | ||
|
||
def tidbBranch = ({ | ||
def m = params.ghprbCommentBody =~ /tidb\s*=\s*([^\s\\]+)(\s|\\|$)/ | ||
if (m) { | ||
return "${m.group(1)}" | ||
} | ||
return params.ghprbTargetBranch ?: 'master' | ||
}).call() | ||
|
||
echo "ticsTag=${params.ghprbActualCommit} tidbBranch=${tidbBranch}" | ||
|
||
stage("Wait for images") { | ||
util.runClosure("wait-for-images") { | ||
timeout(time: 60, unit: 'MINUTES') { | ||
container("docker") { | ||
sh """ | ||
while ! docker pull hub.pingcap.net/tiflash/tics:${params.ghprbActualCommit}; do sleep 60; done | ||
""" | ||
} | ||
} | ||
} | ||
} | ||
|
||
parallel ( | ||
"tidb ci test": { | ||
def label = "tidb-ci-test" | ||
util.runTest(label, "tics/tests/tidb-ci", tidbBranch) | ||
}, | ||
"gtest": { | ||
def label = "gtest" | ||
util.runTest(label, "tics/tests/gtest", tidbBranch) | ||
}, | ||
"delta merge test": { | ||
def label = "delta-merge-test" | ||
util.runTest(label, "tics/tests/delta-merge-test", tidbBranch) | ||
}, | ||
"fullstack test": { | ||
def label = "fullstack-test" | ||
util.runTest(label, "tics/tests/fullstack-test", tidbBranch) | ||
}, | ||
"fullstack test2": { | ||
def label = "fullstack-test2" | ||
util.runTest(label, "tics/tests/fullstack-test2", tidbBranch) | ||
}, | ||
"mutable test": { | ||
def label = "mutable-test" | ||
util.runTest(label, "tics/tests/mutable-test", tidbBranch) | ||
}, | ||
) | ||
} | ||
|
||
stage('Summary') { | ||
def duration = ((System.currentTimeMillis() - currentBuild.startTimeInMillis) / 1000 / 60).setScale(2, BigDecimal.ROUND_HALF_UP) | ||
def msg = "Build Result: `${currentBuild.currentResult}`" + "\n" + | ||
"Elapsed Time: `${duration} mins`" + "\n" + | ||
"${env.RUN_DISPLAY_URL}" | ||
|
||
echo "${msg}" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
def checkoutTiCS(commit, pullId) { | ||
def refspec = "+refs/heads/*:refs/remotes/origin/*" | ||
if (pullId) { | ||
refspec += " +refs/pull/${pullId}/*:refs/remotes/origin/pr/${pullId}/*" | ||
} | ||
checkout(changelog: false, poll: false, scm: [ | ||
$class : "GitSCM", | ||
branches : [ | ||
[name: "${commit}"], | ||
], | ||
userRemoteConfigs: [ | ||
[ | ||
url : "[email protected]:pingcap/tics.git", | ||
refspec : refspec, | ||
credentialsId: "github-sre-bot-ssh", | ||
] | ||
], | ||
extensions : [ | ||
[$class: 'PruneStaleBranch'], | ||
[$class: 'CleanBeforeCheckout'], | ||
], | ||
]) | ||
} | ||
|
||
def runClosure(label, Closure body) { | ||
podTemplate(name: label, label: label, instanceCap: 15, containers: [ | ||
containerTemplate(name: 'dockerd', image: 'docker:18.09.6-dind', privileged: true, | ||
resourceRequestCpu: '5000m', resourceRequestMemory: '10Gi', | ||
resourceLimitCpu: '16000m', resourceLimitMemory: '32Gi'), | ||
containerTemplate(name: 'docker', image: 'hub.pingcap.net/zyguan/docker:build-essential-java', | ||
alwaysPullImage: true, envVars: [ | ||
envVar(key: 'DOCKER_HOST', value: 'tcp://localhost:2375'), | ||
], ttyEnabled: true, command: 'cat'), | ||
]) { | ||
node(label) { | ||
body() | ||
} | ||
} | ||
} | ||
|
||
def runTest(label, testPath, tidbBranch) { | ||
runClosure(label) { | ||
stage("Checkout") { | ||
dir("tics") { | ||
checkoutTiCS("${params.ghprbActualCommit}", "${params.ghprbPullId}") | ||
} | ||
} | ||
dir(testPath) { | ||
stage("Test") { | ||
timeout(time: 60, unit: 'MINUTES') { | ||
container("docker") { | ||
try { | ||
sh "pwd" | ||
sh "TAG=${params.ghprbActualCommit} BRANCH=${tidbBranch} bash -xe ./run.sh" | ||
} catch (e) { | ||
archiveArtifacts(artifacts: "log/**/*.log", allowEmptyArchive: true) | ||
sh "find log -name '*.log' | xargs tail -n 500" | ||
sh "docker ps -a" | ||
throw e | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
return this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../docker/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../docker/mock-test-dt.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
source ../docker/util.sh | ||
|
||
set_branch | ||
|
||
set -xe | ||
|
||
# We need to separate mock-test for dt and tmt, since this behavior | ||
# is different in some tests | ||
# * "tmt" engine ONLY support disable_bg_flush = false. | ||
# * "dt" engine ONLY support disable_bg_flush = true. | ||
# (only tics0 up) (for engine DetlaTree) | ||
docker-compose -f mock-test-dt.yaml down | ||
clean_data_log | ||
|
||
docker-compose -f mock-test-dt.yaml up -d | ||
docker-compose -f mock-test-dt.yaml exec -T tics0 bash -c 'cd /tests ; ./run-test.sh delta-merge-test' | ||
|
||
docker-compose -f mock-test-dt.yaml down | ||
clean_data_log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.