Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pipelines/tikv/tikv/latest/pod-pull_integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
spec:
containers:
- name: runner
image: "hub.pingcap.net/jenkins/tikv-cached-master:latest"
image: "ghcr.io/pingcap-qe/cd/builders/tikv:v2025.8.17-13-ga5750d9"
tty: true
resources:
requests:
Expand All @@ -15,7 +15,7 @@ spec:
securityContext:
privileged: true
- name: golang
image: hub.pingcap.net/jenkins/centos7_golang-1.21:latest
image: golang:1.21
tty: true
resources:
requests:
Expand Down
4 changes: 2 additions & 2 deletions pipelines/tikv/tikv/latest/pod-pull_unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
spec:
containers:
- name: runner
image: "hub.pingcap.net/jenkins/tikv-ci:rocky8-base-cached-master"
image: "ghcr.io/pingcap-qe/cd/builders/tikv:v2025.8.17-13-ga5750d9"
imagePullPolicy: Always
tty: true
command:
Expand All @@ -25,7 +25,7 @@ spec:
name: "volume-tmp"
readOnly: false
- name: net-tool
image: hub.pingcap.net/jenkins/network-multitool
image: wbitt/network-multitool
tty: true
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
spec:
containers:
- name: runner
image: "hub.pingcap.net/jenkins/tikv-cached-release-6.1:latest"
image: "ghcr.io/pingcap-qe/cd/builders/tikv:v2025.12.14-1-g33e22ac-centos7-devtoolset8"
tty: true
resources:
requests:
Expand All @@ -15,7 +15,7 @@ spec:
securityContext:
privileged: true
- name: golang
image: hub.pingcap.net/jenkins/centos7_golang-1.19:latest
image: golang:1.19
tty: true
resources:
requests:
Expand Down
14 changes: 2 additions & 12 deletions pipelines/tikv/tikv/release-6.1/pod-pull_unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
spec:
containers:
- name: runner
image: "hub.pingcap.net/jenkins/tikv-cached-release-6.1:latest"
image: "ghcr.io/pingcap-qe/cd/builders/tikv:v2025.12.14-1-g33e22ac-centos7-devtoolset8"
tty: true
command:
- "/bin/sh"
Expand All @@ -24,22 +24,12 @@ spec:
name: "volume-tmp"
readOnly: false
- name: net-tool
image: hub.pingcap.net/jenkins/network-multitool
image: wbitt/network-multitool
tty: true
resources:
limits:
memory: 128Mi
cpu: 100m
- name: util
image: hub.pingcap.net/jenkins/ks3util
args: ["sleep", "infinity"]
resources:
requests:
cpu: "500m"
memory: "500Mi"
limits:
cpu: "500m"
memory: "500Mi"
volumes:
- emptyDir:
medium: ""
Expand Down
186 changes: 72 additions & 114 deletions pipelines/tikv/tikv/release-6.1/pull_unit_test.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
final K8S_NAMESPACE = "jenkins-tikv"
final GIT_CREDENTIALS_ID = 'github-sre-bot-ssh'
final GIT_FULL_REPO_NAME = 'tikv/tikv'
final KS3_GIT_CREDENTIALS_ID = 'ks3util-config'
final POD_TEMPLATE_FILE = 'pipelines/tikv/tikv/release-6.1/pod-pull_unit_test.yaml'
final LEGACY_CHUNK_COUNT = 20
final REFS = readJSON(text: params.JOB_SPEC).refs
Expand All @@ -24,8 +23,7 @@ pipeline {
TIKV_TEST_MEMORY_DISK_MOUNT_POINT = "/home/jenkins/agent/memvolume"
}
options {
timeout(time: 50, unit: 'MINUTES')
// parallelsAlwaysFailFast()
timeout(time: 150, unit: 'MINUTES')
skipDefaultCheckout()
}
stages {
Expand Down Expand Up @@ -141,127 +139,87 @@ pipeline {
chmod a+x test-chunk-*
tar czf test-artifacts.tar.gz test-chunk-* src tests components `ls target/*/deps/*plugin.so 2>/dev/null`
ls -alh test-artifacts.tar.gz
mv archive-test-binaries.tar test-artifacts.tar.gz $WORKSPACE
mkdir -p /home/jenkins/archives
mv archive-test-binaries.tar test-artifacts.tar.gz /home/jenkins/archives/
"""
}
}
container("util") {
dir("$WORKSPACE") {
sh """
pwd && ls -alh
"""
script{
component.ks3_upload_fileserver("archive-test-binaries.tar", "tikv_test/${REFS.pulls[0].sha}/archive-test-binaries.tar")
component.ks3_upload_fileserver("test-artifacts.tar.gz", "tikv_test/${REFS.pulls[0].sha}/test-artifacts.tar.gz")
}
}
}
}
}
stage("Test") {
matrix {
axes {
axis {
name 'CHUNK_SUFFIX'
values '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20'
}
}
agent{
kubernetes {
namespace K8S_NAMESPACE
yamlFile POD_TEMPLATE_FILE
defaultContainer 'runner'
retries 5
}
}
stages {
stage("Test") {
steps {
dir('/home/jenkins/agent/tikv-presubmit/unit-test') {
sh label: 'os info', script:"""
rm -rf /home/jenkins/tikv-*
ls -alh /home/jenkins/
ln -s `pwd` \$HOME/tikv-src
mkdir -p target/debug
uname -a
df -h
free -hm
"""
container("util") {
script {
component.ks3_download_fileserver("tikv_test/${REFS.pulls[0].sha}/test-artifacts.tar.gz", "test-artifacts.tar.gz")
component.ks3_download_fileserver("tikv_test/${REFS.pulls[0].sha}/archive-test-binaries.tar", "archive-test-binaries.tar")
}
sh """
ls -alh test-artifacts.tar.gz archive-test-binaries.tar
tar xf test-artifacts.tar.gz && rm test-artifacts.tar.gz
tar xf archive-test-binaries.tar --strip-components=1 && rm archive-test-binaries.tar
ls -la
ls -alh target/debug/deps/
chown -R 1000:1000 target/
"""
}
retry(3) {
sh label: 'run test', script: """
ls -alh \$HOME/tikv-src
ls -alh /home/jenkins/tikv-src/
ls -alh /home/jenkins/tikv-src/target/debug/deps/
uname -a
export RUSTFLAGS=-Dwarnings
export FAIL_POINT=1
export RUST_BACKTRACE=1
export MALLOC_CONF=prof:true,prof_active:false
if [[ ! -f test-chunk-${CHUNK_SUFFIX} ]]; then
if [[ ${CHUNK_SUFFIX} -eq ${LEGACY_CHUNK_COUNT} ]]; then
exit
else
echo test-chunk-${CHUNK_SUFFIX} not found
exit 1
fi
fi
export CI=1
export LOG_FILE=target/my_test.log
export RUST_TEST_THREADS=1
export RUST_BACKTRACE=1
./test-chunk-${CHUNK_SUFFIX} 2>&1 | tee tests.out
chunk_count=`grep nocapture test-chunk-${CHUNK_SUFFIX} | wc -l`
ok_count=`grep "test result: ok" tests.out | wc -l`
options { timeout(time: 120, unit: 'MINUTES') }
steps {
dir('/home/jenkins/agent/tikv-presubmit/unit-test') {
sh label: "Setup test environment", script: """
rm -rf /home/jenkins/tikv-*
ls -alh /home/jenkins/
ln -s `pwd` \$HOME/tikv-src
mkdir -p target/debug
uname -a
df -h
free -hm

if [ "\$chunk_count" -eq "\$ok_count" ]; then
echo "test pass"
else
# test failed
grep "^ " tests.out | tr -d '\\r' | grep :: | xargs -I@ awk 'BEGIN{print "---- log for @ ----\\n"}/start, name: @/{flag=1}{if (flag==1) print substr(\$0, length(\$1) + 2)}/end, name: @/{flag=0}END{print ""}' target/my_test.log
awk '/^failures/{flag=1}/^test result:/{flag=0}flag' tests.out
gdb -c core.* -batch -ex "info threads" -ex "thread apply all bt"
exit 1
fi
"""
}
# prepare test artifacts
cp /home/jenkins/archives/test-artifacts.tar.gz .
cp /home/jenkins/archives/archive-test-binaries.tar .
tar xf test-artifacts.tar.gz && rm test-artifacts.tar.gz
tar xf archive-test-binaries.tar --strip-components=1 && rm archive-test-binaries.tar
ls -la
ls -alh target/debug/deps/
chown -R 1000:1000 target/
"""
sh label: "run tests", script: """
ls -alh \$HOME/tikv-src
ls -alh /home/jenkins/tikv-src/
ls -alh /home/jenkins/tikv-src/target/debug/deps/
uname -a
export RUSTFLAGS=-Dwarnings
export FAIL_POINT=1
export RUST_BACKTRACE=1
export MALLOC_CONF=prof:true,prof_active:false
export CI=1
export LOG_FILE=target/my_test.log
export RUST_TEST_THREADS=1

}
}
post {
failure {
sh label: "collect logs", script: """
log_dir="/home/jenkins/tikv-src/target/"
output_archive="log-ut.tar.gz"
for i in \$(seq 1 ${LEGACY_CHUNK_COUNT}); do
if [[ ! -f test-chunk-\${i} ]]; then
echo "test-chunk-\${i} not found, skipping remaining chunks"
break
fi
echo "Running test chunk \${i}"
./test-chunk-\${i} 2>&1 | tee tests-\${i}.out
chunk_count=\$(grep nocapture test-chunk-\${i} | wc -l)
ok_count=\$(grep "test result: ok" tests-\${i}.out | wc -l)
if [ "\$chunk_count" -eq "\$ok_count" ]; then
echo "test chunk \${i} pass"
else
grep "^ " tests-\${i}.out | tr -d '\\r' | grep :: | xargs -I@ awk 'BEGIN{print "---- log for @ ----\\n"}/start, name: @/{flag=1}{if (flag==1) print substr(\$0, length(\$1) + 2)}/end, name: @/{flag=0}END{print ""}' target/my_test.log
awk '/^failures/{flag=1}/^test result:/{flag=0}flag' tests-\${i}.out
gdb -c core.* -batch -ex "info threads" -ex "thread apply all bt"
exit 1
fi
done
"""
}
}
post {
failure {
sh label: "collect logs", script: """
log_dir="/home/jenkins/tikv-src/target/"
output_archive="log-ut.tar.gz"

# Find all log files in the specified directory
log_files=\$(find "\$log_dir" -type f -name "*.log")
# Find all log files in the specified directory
log_files=\$(find "\$log_dir" -type f -name "*.log")

if [[ -n \$log_files ]]; then
tar -cvzf "\$output_archive" \$log_files
echo "Logs have been archived into \$output_archive"
else
echo "No log files found in \$log_dir"
fi
ls -alh "\$output_archive"
"""
archiveArtifacts artifacts: "log-ut.tar.gz", allowEmptyArchive: true
}
}
}
if [[ -n \$log_files ]]; then
tar -cvzf "\$output_archive" \$log_files
echo "Logs have been archived into \$output_archive"
else
echo "No log files found in \$log_dir"
fi
ls -alh "\$output_archive"
"""
archiveArtifacts artifacts: "log-ut.tar.gz", allowEmptyArchive: true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
spec:
containers:
- name: runner
image: "hub.pingcap.net/jenkins/tikv-cached-release-6.5:latest"
image: "ghcr.io/pingcap-qe/cd/builders/tikv:v2025.12.14-1-g33e22ac-centos7-devtoolset8"
tty: true
resources:
requests:
Expand All @@ -15,7 +15,7 @@ spec:
securityContext:
privileged: true
- name: golang
image: hub.pingcap.net/jenkins/centos7_golang-1.19:latest
image: golang:1.19
tty: true
resources:
requests:
Expand Down
4 changes: 2 additions & 2 deletions pipelines/tikv/tikv/release-6.5/pod-pull_unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
spec:
containers:
- name: runner
image: "hub.pingcap.net/jenkins/tikv-cached-release-6.5:latest"
image: "ghcr.io/pingcap-qe/cd/builders/tikv:v2025.12.14-1-g33e22ac-centos7-devtoolset8"
tty: true
command:
- "/bin/sh"
Expand All @@ -24,7 +24,7 @@ spec:
name: "volume-tmp"
readOnly: false
- name: net-tool
image: hub.pingcap.net/jenkins/network-multitool
image: wbitt/network-multitool
tty: true
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
spec:
containers:
- name: runner
image: "hub.pingcap.net/jenkins/tikv-cached-release-7.1:latest"
image: "ghcr.io/pingcap-qe/cd/builders/tikv:v2025.12.14-1-g33e22ac-centos7-devtoolset8"
tty: true
resources:
requests:
Expand All @@ -15,7 +15,7 @@ spec:
securityContext:
privileged: true
- name: golang
image: hub.pingcap.net/jenkins/centos7_golang-1.20:latest
image: golang:1.20
tty: true
resources:
requests:
Expand Down
4 changes: 2 additions & 2 deletions pipelines/tikv/tikv/release-7.1/pod-pull_unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
spec:
containers:
- name: runner
image: "hub.pingcap.net/jenkins/tikv-cached-release-7.1:latest"
image: "ghcr.io/pingcap-qe/cd/builders/tikv:v2025.12.14-1-g33e22ac-centos7-devtoolset8"
tty: true
command:
- "/bin/sh"
Expand All @@ -24,7 +24,7 @@ spec:
name: "volume-tmp"
readOnly: false
- name: net-tool
image: hub.pingcap.net/jenkins/network-multitool
image: wbitt/network-multitool
tty: true
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
spec:
containers:
- name: runner
image: "hub.pingcap.net/jenkins/tikv-cached-release-7.5:latest"
image: "ghcr.io/pingcap-qe/cd/builders/tikv:v2025.12.14-1-g33e22ac-centos7-devtoolset8"
tty: true
resources:
requests:
Expand All @@ -15,7 +15,7 @@ spec:
securityContext:
privileged: true
- name: golang
image: hub.pingcap.net/jenkins/centos7_golang-1.21:latest
image: golang:1.21
tty: true
resources:
requests:
Expand Down
Loading