Skip to content

Commit

Permalink
Update Jenkinsfile (commaai#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh authored Jul 4, 2019
1 parent 1bd9284 commit 3c3ff0c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
38 changes: 27 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,49 @@ pipeline {
}
}
}
stage('Test Dev Build (no WIFI)') {
steps {
lock(resource: "Pandas", inversePrecedence: true, quantity: 1){
timeout(time: 60, unit: 'MINUTES') {
script {
sh "docker run --name ${env.DOCKER_NAME} --privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host ${env.DOCKER_IMAGE_TAG} bash -c 'cd /tmp/panda; SKIPWIFI=1 ./run_automated_tests.sh'"
sh "docker cp ${env.DOCKER_NAME}:/tmp/panda/nosetests.xml test_results_dev_nowifi.xml"
sh "docker rm ${env.DOCKER_NAME}"
}
}
}
}
}
stage('Test EON Build') {
steps {
lock(resource: "Pandas", inversePrecedence: true, quantity:1){
lock(resource: "Pandas", inversePrecedence: true, quantity: 1){
timeout(time: 60, unit: 'MINUTES') {
sh "docker cp ${env.DOCKER_NAME}:/tmp/panda/nosetests.xml test_results_dev.xml"
sh "touch EON && docker cp EON ${env.DOCKER_NAME}:/EON"
sh "docker start -a ${env.DOCKER_NAME}"
script {
sh "docker run --name ${env.DOCKER_NAME} --privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host ${env.DOCKER_IMAGE_TAG} bash -c 'touch /EON; cd /tmp/panda; ./run_automated_tests.sh'"
sh "docker cp ${env.DOCKER_NAME}:/tmp/panda/nosetests.xml test_results_eon.xml"
sh "docker rm ${env.DOCKER_NAME}"
}
}
}
}
}
stage('Test Dev Build') {
stage('Test Dev Build (WIFI)') {
steps {
lock(resource: "Pandas", inversePrecedence: true, quantity:1){
lock(resource: "Pandas", inversePrecedence: true, quantity: 1){
timeout(time: 60, unit: 'MINUTES') {
sh "docker run --name ${env.DOCKER_NAME} --privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host ${env.DOCKER_IMAGE_TAG} bash -c 'cd /tmp/panda; ./run_automated_tests.sh '"
script {
sh "docker run --name ${env.DOCKER_NAME} --privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host ${env.DOCKER_IMAGE_TAG} bash -c 'cd /tmp/panda; ./run_automated_tests.sh'"
sh "docker cp ${env.DOCKER_NAME}:/tmp/panda/nosetests.xml test_results_dev.xml"
sh "docker rm ${env.DOCKER_NAME}"
currentStage.result = "SUCCESS"
}
}
}
}
}
}
post {
always {
script {
sh "docker cp ${env.DOCKER_NAME}:/tmp/panda/nosetests.xml test_results_EON.xml"
sh "docker rm ${env.DOCKER_NAME}"
}
junit "test_results*.xml"
}
}
Expand Down
10 changes: 7 additions & 3 deletions run_automated_tests.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#!/bin/bash
#!/bin/bash -e
TEST_FILENAME=${TEST_FILENAME:-nosetests.xml}
if [ -f "/EON" ]; then
TESTSUITE_NAME="Panda_Test-EON"
TEST_SCRIPTS=$(ls tests/automated/$1*.py | grep -v "wifi")
else
TESTSUITE_NAME="Panda_Test-DEV"
fi

if [ ! -z "${SKIPWIFI}" ] || [ -f "/EON" ]; then
TEST_SCRIPTS=$(ls tests/automated/$1*.py | grep -v wifi)
else
TEST_SCRIPTS=$(ls tests/automated/$1*.py)
fi

cd boardesp
make flashall
env PYTHONPATH="${PWD%/*/*}" make flashall
cd ..

IFS=$'\n'
Expand Down

0 comments on commit 3c3ff0c

Please sign in to comment.