2020-07-25 17:12:19 +08:00
|
|
|
def phone(String ip, String step_label, String cmd) {
|
2021-03-24 08:46:53 +08:00
|
|
|
withCredentials([file(credentialsId: 'id_rsa', variable: 'key_file')]) {
|
2021-01-24 10:34:18 +08:00
|
|
|
def ssh_cmd = """
|
2021-12-05 13:07:57 +08:00
|
|
|
ssh -tt -o StrictHostKeyChecking=no -i ${key_file} 'comma@${ip}' /usr/bin/bash <<'END'
|
2021-01-24 10:34:18 +08:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
export CI=1
|
|
|
|
export TEST_DIR=${env.TEST_DIR}
|
2021-07-05 11:26:38 +08:00
|
|
|
export SOURCE_DIR=${env.SOURCE_DIR}
|
2021-01-24 10:34:18 +08:00
|
|
|
export GIT_BRANCH=${env.GIT_BRANCH}
|
|
|
|
export GIT_COMMIT=${env.GIT_COMMIT}
|
|
|
|
|
|
|
|
source ~/.bash_profile
|
2021-03-27 04:23:18 +08:00
|
|
|
if [ -f /TICI ]; then
|
|
|
|
source /etc/profile
|
|
|
|
fi
|
2021-01-24 10:34:18 +08:00
|
|
|
|
2021-02-01 10:49:34 +08:00
|
|
|
ln -snf ${env.TEST_DIR} /data/pythonpath
|
|
|
|
|
2020-07-25 17:12:19 +08:00
|
|
|
cd ${env.TEST_DIR} || true
|
|
|
|
${cmd}
|
|
|
|
exit 0
|
2021-01-24 10:34:18 +08:00
|
|
|
|
2021-12-05 13:07:57 +08:00
|
|
|
END"""
|
2021-01-24 10:34:18 +08:00
|
|
|
|
|
|
|
sh script: ssh_cmd, label: step_label
|
2020-07-25 17:12:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def phone_steps(String device_type, steps) {
|
|
|
|
lock(resource: "", label: device_type, inversePrecedence: true, variable: 'device_ip', quantity: 1) {
|
2022-04-29 13:02:32 +08:00
|
|
|
timeout(time: 20, unit: 'MINUTES') {
|
2020-07-25 17:12:19 +08:00
|
|
|
phone(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),)
|
|
|
|
steps.each { item ->
|
|
|
|
phone(device_ip, item[0], item[1])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-31 05:06:45 +08:00
|
|
|
pipeline {
|
2021-12-01 14:18:43 +08:00
|
|
|
agent none
|
2020-02-12 11:26:34 +08:00
|
|
|
environment {
|
2020-07-25 17:12:19 +08:00
|
|
|
TEST_DIR = "/data/openpilot"
|
2021-07-05 11:26:38 +08:00
|
|
|
SOURCE_DIR = "/data/openpilot_source/"
|
2020-02-12 11:26:34 +08:00
|
|
|
}
|
2020-10-16 01:14:50 +08:00
|
|
|
options {
|
2022-04-29 13:02:32 +08:00
|
|
|
timeout(time: 4, unit: 'HOURS')
|
2020-10-16 01:14:50 +08:00
|
|
|
}
|
2020-07-04 10:12:05 +08:00
|
|
|
|
2020-01-31 05:06:45 +08:00
|
|
|
stages {
|
2022-04-19 08:55:23 +08:00
|
|
|
stage('build release3') {
|
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
2020-08-09 11:59:32 +08:00
|
|
|
when {
|
|
|
|
branch 'devel-staging'
|
|
|
|
}
|
2022-04-19 08:55:23 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("tici", [
|
|
|
|
["build release3-staging & dashcam3-staging", "PUSH=1 $SOURCE_DIR/release/build_release.sh"],
|
|
|
|
])
|
2020-08-09 11:59:32 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-06 11:21:04 +08:00
|
|
|
stage('openpilot tests') {
|
2020-07-08 05:17:09 +08:00
|
|
|
when {
|
|
|
|
not {
|
|
|
|
anyOf {
|
2021-07-29 13:19:30 +08:00
|
|
|
branch 'master-ci'; branch 'devel'; branch 'devel-staging';
|
|
|
|
branch 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-staging';
|
|
|
|
branch 'release3'; branch 'release3-staging'; branch 'dashcam3'; branch 'dashcam3-staging';
|
|
|
|
branch 'testing-closet*'; branch 'hotfix-*'
|
2020-07-08 05:17:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-07-04 10:12:05 +08:00
|
|
|
|
2020-08-09 11:59:32 +08:00
|
|
|
stages {
|
2020-08-06 11:21:04 +08:00
|
|
|
stage('On-device Tests') {
|
2021-12-01 14:18:43 +08:00
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
2020-08-06 11:21:04 +08:00
|
|
|
stages {
|
2020-08-09 11:59:32 +08:00
|
|
|
stage('parallel tests') {
|
|
|
|
parallel {
|
2022-04-19 08:55:23 +08:00
|
|
|
stage('build') {
|
2021-02-01 10:49:34 +08:00
|
|
|
environment {
|
|
|
|
R3_PUSH = "${env.BRANCH_NAME == 'master' ? '1' : ' '}"
|
|
|
|
}
|
2021-01-24 10:34:18 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("tici", [
|
2022-05-14 15:18:30 +08:00
|
|
|
["build master-ci", "cd $SOURCE_DIR/release && TARGET_DIR=$TEST_DIR EXTRA_FILES='tools/' ./build_devel.sh"],
|
2021-11-19 15:43:09 +08:00
|
|
|
["build openpilot", "cd selfdrive/manager && ./build.py"],
|
|
|
|
["test manager", "python selfdrive/manager/test/test_manager.py"],
|
2021-04-12 06:56:17 +08:00
|
|
|
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
|
2021-11-19 15:43:09 +08:00
|
|
|
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
|
2021-01-24 10:34:18 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-19 08:55:23 +08:00
|
|
|
stage('HW + Unit Tests') {
|
2021-07-03 07:29:57 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("tici2", [
|
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
2022-04-22 14:13:20 +08:00
|
|
|
["test power draw", "python selfdrive/hardware/tici/test_power_draw.py"],
|
2021-11-06 05:31:13 +08:00
|
|
|
["test boardd loopback", "python selfdrive/boardd/tests/test_boardd_loopback.py"],
|
2021-07-03 07:29:57 +08:00
|
|
|
["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"],
|
|
|
|
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py"],
|
2022-05-13 21:48:38 +08:00
|
|
|
["test sensord", "python selfdrive/sensord/test/test_sensord.py"],
|
2021-07-03 07:29:57 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-19 08:55:23 +08:00
|
|
|
stage('camerad') {
|
2021-04-01 07:48:10 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("tici-party", [
|
2021-05-25 10:52:54 +08:00
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
2021-04-01 07:48:10 +08:00
|
|
|
["test camerad", "python selfdrive/camerad/test/test_camerad.py"],
|
2021-05-19 03:07:48 +08:00
|
|
|
["test exposure", "python selfdrive/camerad/test/test_exposure.py"],
|
2021-04-01 07:48:10 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-19 08:55:23 +08:00
|
|
|
stage('replay') {
|
2021-11-25 07:59:19 +08:00
|
|
|
steps {
|
2022-04-07 01:34:46 +08:00
|
|
|
phone_steps("tici3", [
|
2021-11-25 07:59:19 +08:00
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
|
|
|
["model replay", "cd selfdrive/test/process_replay && ./model_replay.py"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-06 11:21:04 +08:00
|
|
|
}
|
|
|
|
}
|
2020-07-06 08:56:24 +08:00
|
|
|
}
|
2020-09-30 13:14:54 +08:00
|
|
|
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
cleanWs()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-06 08:56:24 +08:00
|
|
|
}
|
|
|
|
|
2020-01-31 05:06:45 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|