Skip to content

Commit cc0fd63

Browse files
committed
run in parallel
1 parent 9c44a55 commit cc0fd63

File tree

1 file changed

+54
-63
lines changed

1 file changed

+54
-63
lines changed

Jenkinsfile

+54-63
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def phone_steps(String device_type, steps) {
4242
pipeline {
4343
agent none
4444
environment {
45+
CI = "1"
4546
TEST_DIR = "/data/openpilot"
4647
SOURCE_DIR = "/data/openpilot_source/"
4748
}
@@ -74,21 +75,22 @@ pipeline {
7475
}
7576
}
7677

77-
stages {
78+
parallel {
79+
7880
stage('simulator') {
7981
agent {
8082
dockerfile {
8183
filename 'Dockerfile.sim_nvidia'
82-
dir 'tools/sim'
83-
args "--user=root"
84+
dir 'tools/sim'
85+
args '--user=root'
8486
}
8587
}
8688
steps {
8789
sh "git config --global --add safe.directory ${WORKSPACE}"
8890
sh "git lfs pull"
8991
sh "${WORKSPACE}/tools/sim/build_container.sh"
90-
sh "CI=1 ${WORKSPACE}/tools/sim/start_carla.sh"
91-
sh "CI=1 ${WORKSPACE}/tools/sim/start_openpilot_docker.sh"
92+
sh "${WORKSPACE}/tools/sim/start_carla.sh"
93+
sh "${WORKSPACE}/tools/sim/start_openpilot_docker.sh"
9294
}
9395

9496
post {
@@ -99,71 +101,60 @@ pipeline {
99101
}
100102
}
101103

102-
stage('On-device Tests') {
104+
stage('build') {
103105
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
104-
stages {
105-
stage('parallel tests') {
106-
parallel {
107-
stage('build') {
108-
environment {
109-
R3_PUSH = "${env.BRANCH_NAME == 'master' ? '1' : ' '}"
110-
}
111-
steps {
112-
phone_steps("tici", [
113-
["build master-ci", "cd $SOURCE_DIR/release && TARGET_DIR=$TEST_DIR EXTRA_FILES='tools/' ./build_devel.sh"],
114-
["build openpilot", "cd selfdrive/manager && ./build.py"],
115-
["test manager", "python selfdrive/manager/test/test_manager.py"],
116-
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
117-
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
118-
])
119-
}
120-
}
121-
122-
stage('HW + Unit Tests') {
123-
steps {
124-
phone_steps("tici2", [
125-
["build", "cd selfdrive/manager && ./build.py"],
126-
["test power draw", "python selfdrive/hardware/tici/test_power_draw.py"],
127-
["test boardd loopback", "python selfdrive/boardd/tests/test_boardd_loopback.py"],
128-
["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"],
129-
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py"],
130-
["test sensord", "python selfdrive/sensord/test/test_sensord.py"],
131-
])
132-
}
133-
}
134-
135-
stage('camerad') {
136-
steps {
137-
phone_steps("tici-party", [
138-
["build", "cd selfdrive/manager && ./build.py"],
139-
["test camerad", "python selfdrive/camerad/test/test_camerad.py"],
140-
["test exposure", "python selfdrive/camerad/test/test_exposure.py"],
141-
])
142-
}
143-
}
144-
145-
stage('replay') {
146-
steps {
147-
phone_steps("tici3", [
148-
["build", "cd selfdrive/manager && ./build.py"],
149-
["model replay", "cd selfdrive/test/process_replay && ./model_replay.py"],
150-
])
151-
}
152-
}
153-
154-
}
155-
}
106+
environment {
107+
R3_PUSH = "${env.BRANCH_NAME == 'master' ? '1' : ' '}"
156108
}
109+
steps {
110+
phone_steps("tici", [
111+
["build master-ci", "cd $SOURCE_DIR/release && TARGET_DIR=$TEST_DIR EXTRA_FILES='tools/' ./build_devel.sh"],
112+
["build openpilot", "cd selfdrive/manager && ./build.py"],
113+
["test manager", "python selfdrive/manager/test/test_manager.py"],
114+
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
115+
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
116+
])
117+
}
118+
}
157119

158-
post {
159-
always {
160-
cleanWs()
161-
}
120+
stage('HW + Unit Tests') {
121+
steps {
122+
phone_steps("tici2", [
123+
["build", "cd selfdrive/manager && ./build.py"],
124+
["test power draw", "python selfdrive/hardware/tici/test_power_draw.py"],
125+
["test boardd loopback", "python selfdrive/boardd/tests/test_boardd_loopback.py"],
126+
["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"],
127+
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py"],
128+
["test sensord", "python selfdrive/sensord/test/test_sensord.py"],
129+
])
162130
}
131+
}
163132

133+
stage('camerad') {
134+
steps {
135+
phone_steps("tici-party", [
136+
["build", "cd selfdrive/manager && ./build.py"],
137+
["test camerad", "python selfdrive/camerad/test/test_camerad.py"],
138+
["test exposure", "python selfdrive/camerad/test/test_exposure.py"],
139+
])
140+
}
164141
}
165142

143+
stage('replay') {
144+
steps {
145+
phone_steps("tici3", [
146+
["build", "cd selfdrive/manager && ./build.py"],
147+
["model replay", "cd selfdrive/test/process_replay && ./model_replay.py"],
148+
])
149+
}
150+
}
151+
}
152+
153+
post {
154+
always {
155+
cleanWs()
156+
}
166157
}
167158
}
168159
}
169-
}
160+
}

0 commit comments

Comments
 (0)