From 842cfb220ebc1901791bbcc4ee933003f75c1708 Mon Sep 17 00:00:00 2001 From: Asmund Birkeland Date: Thu, 13 Feb 2020 10:07:10 +0100 Subject: [PATCH] Move komodo test to ci --- Jenkinsfile-komodo | 17 ----------- checkout_komodo_tag.sh | 12 -------- ci/jenkins/Jenkinsfile-komodo | 21 +++++++++++++ testkomodo.sh => ci/jenkins/testkomodo.sh | 36 +++++++++++++++-------- 4 files changed, 44 insertions(+), 42 deletions(-) delete mode 100644 Jenkinsfile-komodo delete mode 100644 checkout_komodo_tag.sh create mode 100644 ci/jenkins/Jenkinsfile-komodo rename testkomodo.sh => ci/jenkins/testkomodo.sh (54%) diff --git a/Jenkinsfile-komodo b/Jenkinsfile-komodo deleted file mode 100644 index b506d445c2..0000000000 --- a/Jenkinsfile-komodo +++ /dev/null @@ -1,17 +0,0 @@ -pipeline { - agent { label 'si-build' } - stages { - stage('checkout komodo tag') { - steps { - sh 'sh checkout_komodo_tag.sh' - } - } - stage('run tests') { - steps { - sh 'sh testkomodo.sh' - } - } - } -} - - diff --git a/checkout_komodo_tag.sh b/checkout_komodo_tag.sh deleted file mode 100644 index 7f9483d1b2..0000000000 --- a/checkout_komodo_tag.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -source /project/res/komodo/$KOMODO_VERSION/enable - -GIT=/prog/sdpsoft/bin/git - -# find and check out the code that was used to build libres for this komodo relase -echo "checkout tag from komodo" -EV=$(cat /project/res/komodo/$KOMODO_VERSION/$KOMODO_RELEASE | grep "libres:" -A2 | grep "version:") -EV=($EV) # split the string "version: vX.X.X" -EV=${EV[1]} # extract the version -echo "Using libres version $EV" -$GIT checkout $EV diff --git a/ci/jenkins/Jenkinsfile-komodo b/ci/jenkins/Jenkinsfile-komodo new file mode 100644 index 0000000000..3fe8baf7f1 --- /dev/null +++ b/ci/jenkins/Jenkinsfile-komodo @@ -0,0 +1,21 @@ +pipeline { + agent { label 'si-build' } + parameters { + string(defaultValue: "bleeding-py36", description: 'The komodo relase to be used', name: 'RELEASE_NAME') + string(defaultValue: "/prog/res/komodo", description: 'Root folder for komodo', name: 'KOMODO_ROOT') + string(defaultValue: "/opt/rh/devtoolset-7", description: 'The devtoolset folder', name: 'DEVTOOL') + string(defaultValue: "/prog/sdpsoft", description: 'The SDPSOFT folder', name: 'SDPSOFT') + } + stages{ + stage('run tests') { + steps { + sh 'sh ci/jenkins/testkomodo.sh' + } + } + } + post { + cleanup { + deleteDir() + } + } +} diff --git a/testkomodo.sh b/ci/jenkins/testkomodo.sh similarity index 54% rename from testkomodo.sh rename to ci/jenkins/testkomodo.sh index 301deb74f7..22e2efa640 100644 --- a/testkomodo.sh +++ b/ci/jenkins/testkomodo.sh @@ -1,9 +1,18 @@ #!/bin/bash -source /project/res/komodo/$KOMODO_VERSION/enable -source /opt/rh/devtoolset-7/enable -GCC_VERSION=7.3.0 CMAKE_VERSION=3.10.2 source /prog/sdpsoft/env.sh -set -e - +set -xe +source $KOMODO_ROOT/$RELEASE_NAME/enable +source $DEVTOOL/enable + +# find and check out the code that was used to build libres for this komodo relase +echo "checkout tag from komodo" +EV=$(cat $KOMODO_ROOT/$RELEASE_NAME/$RELEASE_NAME | grep "libres:" -A2 | grep "version:") +EV=($EV) # split the string "version: vX.X.X" +EV=${EV[1]} # extract the version +EV=${EV%"+py3"} +echo "Using libres version $EV" +git checkout $EV + +GCC_VERSION=7.3.0 CMAKE_VERSION=3.10.2 source $SDPSOFT/env.sh echo "building c tests" rm -rf build mkdir build @@ -12,7 +21,7 @@ cmake .. -DBUILD_TESTS=ON\ -DENABLE_PYTHON=OFF\ -DBUILD_APPLICATIONS=ON\ -DCMAKE_INSTALL_PREFIX=install\ --DCMAKE_PREFIX_PATH=/project/res/komodo/$KOMODO_VERSION/root/\ +-DCMAKE_PREFIX_PATH=$KOMODO_ROOT/$RELEASE_NAME/root/\ -DCMAKE_C_FLAGS='-Werror=all'\ -DCMAKE_CXX_FLAGS='-Wno-unused-result' make -j 12 @@ -21,16 +30,16 @@ rm -r lib64 echo "running ctest" ctest --output-on-failure - popd echo "create virtualenv" ENV=testenv -rm -rf testenv +rm -rf $ENV mkdir $ENV python -m virtualenv --system-site-packages $ENV source $ENV/bin/activate -python -m pip install mock decorator +python -m pip install -r test_requirements.txt + echo "running pytest" #run in a new folder so that we dont load the other python code from the source, but rather run against komodo @@ -38,12 +47,13 @@ rm -rf tmptest mkdir tmptest cp -r python/tests tmptest/tests pushd tmptest + +export ECL_SKIP_SIGNAL=ON python -m pytest \ --ignore="tests/res/enkf/test_analysis_config.py"\ --ignore="tests/res/enkf/test_res_config.py"\ --ignore="tests/res/enkf/test_site_config.py"\ - --ignore="tests/res/enkf/test_workflow_list.py" - - + --ignore="tests/res/enkf/test_workflow_list.py"\ + --ignore="tests/res/enkf/test_hook_manager.py"\ + --ignore="tests/legacy" popd -