From 7df4e0f8ebd6cfe03b9c3e5432f4f51352354551 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 5 Jan 2018 01:50:38 -0500 Subject: [PATCH] reenable pytest with px4-dev-ecl --- .gitignore | 4 +++- EKF/CMakeLists.txt | 14 -------------- Jenkinsfile | 29 ++++++++++++++--------------- 3 files changed, 17 insertions(+), 30 deletions(-) diff --git a/.gitignore b/.gitignore index e5122b0688..5f40a80050 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.DS_Store -Build/ *~ +.cache/ +Build/ +EKF/tests/pytest/__pycache__/ diff --git a/EKF/CMakeLists.txt b/EKF/CMakeLists.txt index 6330ce758f..91429ac640 100644 --- a/EKF/CMakeLists.txt +++ b/EKF/CMakeLists.txt @@ -95,20 +95,6 @@ if(PythonTests) find_package(PythonLibs 3 REQUIRED) find_package(PythonInterp 3 REQUIRED) - # Check for required python packages - file(READ "${CMAKE_SOURCE_DIR}/tests/pytest/requirements.txt" ECL_TEST_PYTHON_PACKAGES) - # Strip version information and split into cmake list - string(REGEX REPLACE "\n" ";" ECL_TEST_PYTHON_PACKAGES "${ECL_TEST_PYTHON_PACKAGES}") - string(REGEX REPLACE "-" "_" ECL_TEST_PYTHON_PACKAGES "${ECL_TEST_PYTHON_PACKAGES}") - string(REGEX REPLACE "[>=]+[^;]*" "" ECL_TEST_PYTHON_PACKAGES "${ECL_TEST_PYTHON_PACKAGES}") - - foreach(package ${ECL_TEST_PYTHON_PACKAGES}) - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import ${package}" RESULT_VARIABLE PytestAvailable OUTPUT_QUIET ERROR_QUIET) - if(${PytestAvailable}) - message(FATAL_ERROR "Python package missing:\n Please install ${package}, e.g., \"pip3 install --user ${package}\"") - endif() - endforeach(package) - # Need SWIG to wrap ecl find_package(SWIG REQUIRED) include(${SWIG_USE_FILE}) diff --git a/Jenkinsfile b/Jenkinsfile index 741f289c98..40c707c01a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,21 +35,20 @@ pipeline { } } - //stage('pytest') { - // agent { - // docker { - // image 'px4io/px4-dev-base:2017-12-30' - // args '-e CI=true -e CCACHE_BASEDIR=$WORKSPACE -e CCACHE_DIR=/tmp/ccache -v /tmp/ccache:/tmp/ccache:rw' - // } - // } - // steps { - // sh 'git clean -ff -x -d .' - // sh 'git submodule deinit -f .' - // sh 'git submodule update --init --recursive' - // sh 'pip install --user -r ./EKF/tests/pytest/requirements.txt' - // sh './build.sh' - // } - //} + stage('pytest') { + agent { + docker { + image 'px4io/px4-dev-ecl' + args '-e CI=true -e CCACHE_BASEDIR=$WORKSPACE -e CCACHE_DIR=/tmp/ccache -v /tmp/ccache:/tmp/ccache:rw' + } + } + steps { + sh 'git clean -ff -x -d .' + sh 'git submodule deinit -f .' + sh 'git submodule update --init --recursive' + sh 'RUN_PYTEST=1 ./build.sh' + } + } } }