From 3c3ff0c03b9e8cb12aefedbd56a1b626e1ca653b Mon Sep 17 00:00:00 2001 From: quillford <8762862+quillford@users.noreply.github.com> Date: Wed, 3 Jul 2019 19:47:41 -0700 Subject: [PATCH] Update Jenkinsfile (#239) --- Jenkinsfile | 38 +++++++++++++++++++++++++++----------- run_automated_tests.sh | 10 +++++++--- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0b43b341a54b0c..11c9430d48dc23 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,22 +20,42 @@ 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" + } } } } @@ -43,10 +63,6 @@ pipeline { } 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" } } diff --git a/run_automated_tests.sh b/run_automated_tests.sh index 4805c67fe77035..b69c8acb066ac8 100755 --- a/run_automated_tests.sh +++ b/run_automated_tests.sh @@ -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'