changed: replace opm-data with new opm-tests repository

This commit is contained in:
Arne Morten Kvarving 2018-03-12 14:21:26 +01:00
parent 8058bab5ea
commit e823b0a93e
9 changed files with 84 additions and 81 deletions

View File

@ -43,9 +43,9 @@ endif()
# the build starts, so it makes sense to keep the data there then.
include (OpmInit)
# Look for the opm-data repository; if found the variable
# HAVE_OPM_DATA will be set to true.
include(Findopm-data)
# Look for the opm-tests repository; if found the variable
# HAVE_OPM_TESTS will be set to true.
include(Findopm-tests)
# list of prerequisites for this particular project; this is in a
# separate file (in cmake/Modules sub-directory) because it is shared

View File

@ -68,29 +68,29 @@ foreach (test BoxTest
list(APPEND EXTRA_TESTS ${test})
endforeach ()
# opm-data dependent tests
if(HAVE_OPM_DATA)
# opm-tests dependent tests
if(HAVE_OPM_TESTS)
opm_add_test(parse_write ONLY_COMPILE
SOURCES tests/parser/integration/parse_write.cpp
LIBRARIES ${TEST_LIBS})
list(APPEND EXTRA_TESTS parse_write)
foreach (deck ${OPM_DATA_ROOT}/norne/NORNE_ATW2013.DATA
${OPM_DATA_ROOT}/solvent_test_suite/SPE1CASE2_SOLVENT.DATA
${OPM_DATA_ROOT}/solvent_test_suite/SPE9_CP_SOLVENT_CO2.DATA
${OPM_DATA_ROOT}/spe5/SPE5CASE1.DATA
${OPM_DATA_ROOT}/polymer_simple2D/2D_THREEPHASE_POLY_HETER.DATA
${OPM_DATA_ROOT}/spe1/SPE1CASE1.DATA
${OPM_DATA_ROOT}/spe1/SPE1CASE2.DATA
${OPM_DATA_ROOT}/spe1/SPE1CASE2_FAMII.DATA
${OPM_DATA_ROOT}/spe1/SPE1CASE2_SLGOF.DATA
${OPM_DATA_ROOT}/spe3/SPE3CASE1.DATA
${OPM_DATA_ROOT}/spe3/SPE3CASE2.DATA
${OPM_DATA_ROOT}/spe9/SPE9_CP.DATA
${OPM_DATA_ROOT}/spe9/SPE9_CP_GROUP.DATA
${OPM_DATA_ROOT}/spe9/SPE9.DATA
${OPM_DATA_ROOT}/spe10model1/SPE10_MODEL1.DATA
${OPM_DATA_ROOT}/spe10model2/SPE10_MODEL2.DATA
${OPM_DATA_ROOT}/msw_2d_h/2D_H__.DATA )
foreach (deck ${OPM_TESTS_ROOT}/norne/NORNE_ATW2013.DATA
${OPM_TESTS_ROOT}/spe1_solvent/SPE1CASE2_SOLVENT.DATA
${OPM_TESTS_ROOT}/spe9_solvent/SPE9_CP_SOLVENT_CO2.DATA
${OPM_TESTS_ROOT}/spe5/SPE5CASE1.DATA
${OPM_TESTS_ROOT}/polymer_simple2D/2D_THREEPHASE_POLY_HETER.DATA
${OPM_TESTS_ROOT}/spe1/SPE1CASE1.DATA
${OPM_TESTS_ROOT}/spe1/SPE1CASE2.DATA
${OPM_TESTS_ROOT}/spe1/SPE1CASE2_FAMII.DATA
${OPM_TESTS_ROOT}/spe1/SPE1CASE2_SLGOF.DATA
${OPM_TESTS_ROOT}/spe3/SPE3CASE1.DATA
${OPM_TESTS_ROOT}/spe3/SPE3CASE2.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP_GROUP.DATA
${OPM_TESTS_ROOT}/spe9/SPE9.DATA
${OPM_TESTS_ROOT}/spe10model1/SPE10_MODEL1.DATA
${OPM_TESTS_ROOT}/spe10model2/SPE10_MODEL2.DATA
${OPM_TESTS_ROOT}/msw_2d_h/2D_H__.DATA )
get_filename_component(test_name ${deck} NAME_WE)
opm_add_test(${test_name} NO_COMPILE
EXE_NAME parse_write

View File

@ -1,24 +0,0 @@
# This module searches for the opm-data repository. Since the opm-data
# has no libraries or header files the find implementation is quite
# naive.
#
# If the opm-data repository is found, the following variables are set:
#
# HAVE_OPM_DATA
# OPM_DATA_ROOT
if (OPM_DATA_ROOT)
set( _opm_data_root ${OPM_DATA_ROOT})
else()
set( _opm_data_root "${PROJECT_SOURCE_DIR}/../opm-data")
endif()
if (EXISTS "${_opm_data_root}/norne/NORNE_ATW2013.DATA")
set( HAVE_OPM_DATA True )
set( OPM_DATA_ROOT ${_opm_data_root} )
message(STATUS "Setting OPM_DATA_ROOT: ${OPM_DATA_ROOT}")
else()
set( HAVE_OPM_DATA False )
message(WARNING "opm-data not found - integration tests using opm-data will be skipped.")
endif()

View File

@ -0,0 +1,27 @@
# This module searches for the opm-tests repository. Since opm-tests
# has no libraries or header files the find implementation is quite
# naive.
#
# If the opm-tests repository is found, the following variables are set:
#
# HAVE_OPM_TESTS
# OPM_TESTS_ROOT
if (OPM_TESTS_ROOT)
set( _opm_tests_root ${OPM_TESTS_ROOT})
else()
set( _opm_tests_root "${PROJECT_SOURCE_DIR}/../opm-tests")
endif()
if (EXISTS "${_opm_tests_root}/norne/NORNE_ATW2013.DATA")
set( HAVE_OPM_DATA True )
set( HAVE_OPM_TESTS True )
set( OPM_TESTS_ROOT ${_opm_tests_root} )
set( OPM_DATA_ROOT ${_opm_tests_root} )
message(STATUS "Setting OPM_TESTS_ROOT: ${OPM_TESTS_ROOT}")
else()
set( HAVE_OPM_TESTS False )
set( HAVE_OPM_DATA False )
message(WARNING "opm-tests not found - integration tests using opm-tests will be skipped.")
endif()

View File

@ -178,7 +178,7 @@ function build_downstreams {
do
echo "Building downstream $downstream=${downstreamRev[$downstream]} configuration=$configuration"
# Build downstream and execute installation
clone_and_build_module $downstream "-DCMAKE_PREFIX_PATH=$WORKSPACE/$configuration/install -DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_DATA_ROOT=$OPM_DATA_ROOT" ${downstreamRev[$downstream]} $WORKSPACE/$configuration 1
clone_and_build_module $downstream "-DCMAKE_PREFIX_PATH=$WORKSPACE/$configuration/install -DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_TESTS_ROOT=$OPM_TESTS_ROOT" ${downstreamRev[$downstream]} $WORKSPACE/$configuration 1
test $? -eq 0 || exit 1
# Installation for downstream
@ -215,7 +215,7 @@ function build_module_full {
mkdir -p $configuration/build-$1
cd $configuration/build-$1
echo "Building main module $1=$sha1 configuration=$configuration"
build_module "-DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_DATA_ROOT=$OPM_DATA_ROOT" 1 $WORKSPACE
build_module "-DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_TESTS_ROOT=$OPM_TESTS_ROOT" 1 $WORKSPACE
test $? -eq 0 || exit 1
cmake --build . --target install
test $? -eq 0 || exit 1

View File

@ -32,6 +32,6 @@ parseRevisions
printHeader opm-common
# Setup opm-data
source $WORKSPACE/deps/opm-common/jenkins/setup-opm-data.sh
source $WORKSPACE/deps/opm-common/jenkins/setup-opm-tests.sh
build_module_full opm-common

View File

@ -1,29 +0,0 @@
#!/bin/bash
# Predefined by environment
if test -z "$OPM_DATA_ROOT"
then
OPM_DATA_REVISION="master"
if grep -q "opm-data=" <<< $ghprbCommentBody
then
OPM_DATA_REVISION=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-data=([0-9]+).*/\1/g'`/merge
fi
# Not specified in trigger, use shared copy
if [[ "$OPM_DATA_REVISION" = "master" ]] && [[ ! "$OPM_DATA_ROOT_PREDEFINED" = "" ]]
then
if ! test -d $WORKSPACE/deps/opm-data
then
cp $OPM_DATA_ROOT_PREDEFINED $WORKSPACE/deps/opm-data -R
fi
else
# Specified in trigger, download it
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
clone_module opm-data $OPM_DATA_REVISION
fi
else
if ! test -d $WORKSPACE/deps/opm-data
then
cp $OPM_DATA_ROOT $WORKSPACE/deps/opm-data -R
fi
fi
OPM_DATA_ROOT=$WORKSPACE/deps/opm-data

29
jenkins/setup-opm-tests.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
# Predefined by environment
if test -z "$OPM_TESTS_ROOT"
then
OPM_TESTS_REVISION="master"
if grep -q "opm-tests=" <<< $ghprbCommentBody
then
OPM_TESTS_REVISION=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-tests=([0-9]+).*/\1/g'`/merge
fi
# Not specified in trigger, use shared copy
if [[ "$OPM_TESTS_REVISION" = "master" ]] && [[ ! "$OPM_TESTS_ROOT_PREDEFINED" = "" ]]
then
if ! test -d $WORKSPACE/deps/opm-tests
then
cp $OPM_TESTS_ROOT_PREDEFINED $WORKSPACE/deps/opm-tests -R
fi
else
# Specified in trigger, download it
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
clone_module opm-tests $OPM_TESTS_REVISION
fi
else
if ! test -d $WORKSPACE/deps/opm-tests
then
cp $OPM_TESTS_ROOT $WORKSPACE/deps/opm-tests -R
fi
fi
OPM_TESTS_ROOT=$WORKSPACE/deps/opm-tests

View File

@ -48,7 +48,7 @@ $WORKSPACE/deps/opm-simulators/tests/update_reference_data.sh $OPM_DATA_ROOT
# Finally open the pull request
cd $OPM_DATA_ROOT
git remote add jenkins4opm git@github.com:jenkins4opm/opm-data
git remote add jenkins4opm git@github.com:jenkins4opm/opm-tests
# Do some cleaning of old remote branches
# Easier code with git 2.7+
@ -79,9 +79,9 @@ then
GH_TOKEN=`git config --get gitOpenPull.Token`
REV=${upstreamRev[$MAIN_REPO]}
PRNUMBER=${rev//[!0-9]/}
DATA_PR=`curl -X GET https://api.github.com/repos/OPM/opm-data/pulls?head=jenkins4opm:$BRANCH_NAME | grep '"number":' | awk -F ':' '{print $2}' | sed -e 's/,//' -e 's/ //'`
DATA_PR=`curl -X GET https://api.github.com/repos/OPM/opm-tests/pulls?head=jenkins4opm:$BRANCH_NAME | grep '"number":' | awk -F ':' '{print $2}' | sed -e 's/,//' -e 's/ //'`
git push -u jenkins4opm $BRANCH_NAME -f
curl -d "{ \"body\": \"Existing PR https://github.com/OPM/opm-data/pull/$DATA_PR was updated\" }" -X POST https://api.github.com/repos/OPM/$MAIN_REPO/issues/$PRNUMBER/comments?access_token=$GH_TOKEN
else
git-open-pull -u jenkins4opm --base-account OPM --base-repo opm-data -r /tmp/cmsg $BRANCH_NAME
git-open-pull -u jenkins4opm --base-account OPM --base-repo opm-tests -r /tmp/cmsg $BRANCH_NAME
fi