mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1038 from akva2/test_update_automation
refinement in regression data update script to aid automation
This commit is contained in:
commit
72a83222a1
@ -20,9 +20,8 @@ set(BASE_RESULT_PATH ${PROJECT_BINARY_DIR}/tests/results)
|
||||
#
|
||||
# Details:
|
||||
# - This test class compares output from a simulation to reference files.
|
||||
macro (add_test_compareECLFiles casename filename simulator abs_tol rel_tol prefix)
|
||||
|
||||
set(RESULT_PATH ${BASE_RESULT_PATH}/${simulator}+${casename})
|
||||
macro (add_test_compareECLFiles casename filename simulator abs_tol rel_tol prefix dirprefix)
|
||||
set(RESULT_PATH ${BASE_RESULT_PATH}${dirprefix}/${simulator}+${casename})
|
||||
opm_add_test(${prefix}_${simulator}+${filename} NO_COMPILE
|
||||
EXE_NAME ${simulator}
|
||||
DRIVER_ARGS ${OPM_DATA_ROOT}/${casename} ${RESULT_PATH}
|
||||
@ -94,10 +93,10 @@ opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-regressionTest.sh "")
|
||||
set(abs_tol 2e-2)
|
||||
set(rel_tol 1e-5)
|
||||
|
||||
add_test_compareECLFiles(spe1 SPE1CASE2 flow ${abs_tol} ${rel_tol} compareECLFiles)
|
||||
add_test_compareECLFiles(spe1 SPE1CASE1 flow_sequential ${abs_tol} ${rel_tol} compareECLFiles)
|
||||
add_test_compareECLFiles(spe3 SPE3CASE1 flow ${abs_tol} ${rel_tol} compareECLFiles)
|
||||
add_test_compareECLFiles(spe9 SPE9_CP_SHORT flow ${abs_tol} ${rel_tol} compareECLFiles)
|
||||
add_test_compareECLFiles(spe1 SPE1CASE2 flow ${abs_tol} ${rel_tol} compareECLFiles "")
|
||||
add_test_compareECLFiles(spe1 SPE1CASE1 flow_sequential ${abs_tol} ${rel_tol} compareECLFiles "")
|
||||
add_test_compareECLFiles(spe3 SPE3CASE1 flow ${abs_tol} ${rel_tol} compareECLFiles "")
|
||||
add_test_compareECLFiles(spe9 SPE9_CP_SHORT flow ${abs_tol} ${rel_tol} compareECLFiles "")
|
||||
|
||||
# Restart tests
|
||||
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-restart-regressionTest.sh "")
|
||||
@ -111,7 +110,7 @@ add_test_compare_restarted_simulation(spe9 SPE9_CP_SHORT flow ${abs_tol_restart}
|
||||
# Init tests
|
||||
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-init-regressionTest.sh "")
|
||||
|
||||
add_test_compareECLFiles(norne NORNE_ATW2013 flow ${abs_tol} ${rel_tol} compareECLInitFiles)
|
||||
add_test_compareECLFiles(norne NORNE_ATW2013 flow ${abs_tol} ${rel_tol} compareECLInitFiles /init)
|
||||
|
||||
# Parallel tests
|
||||
if(MPI_FOUND)
|
||||
|
@ -14,11 +14,13 @@ copyToReferenceDir () {
|
||||
FILETYPES=${@:4};
|
||||
|
||||
for filetype in $FILETYPES; do
|
||||
echo cp "$WORKSPACE/$SRC_DIR$STEM.$filetype" $DST_DIR
|
||||
cp "$WORKSPACE/$SRC_DIR$STEM.$filetype" $DST_DIR
|
||||
done
|
||||
}
|
||||
|
||||
for test_name in ${@:2}; do
|
||||
tests=${@:2}
|
||||
test -z "$tests" && tests="spe11 spe12 spe3 spe9 norne_init"
|
||||
for test_name in ${tests}; do
|
||||
if grep -q "spe11" <<< $test_name
|
||||
then
|
||||
copyToReferenceDir \
|
||||
@ -40,7 +42,7 @@ for test_name in ${@:2}; do
|
||||
if grep -q "spe3" <<< $test_name
|
||||
then
|
||||
copyToReferenceDir \
|
||||
$configuration/build-opm-simulators/tests/results/flow_sequential+spe3/ \
|
||||
$configuration/build-opm-simulators/tests/results/flow+spe3/ \
|
||||
$OPM_DATA_ROOT/spe3/opm-simulation-reference/ \
|
||||
SPE3CASE1 \
|
||||
EGRID INIT PRT SMSPEC UNRST UNSMRY
|
||||
@ -54,14 +56,37 @@ for test_name in ${@:2}; do
|
||||
SPE9_CP_SHORT \
|
||||
EGRID INIT PRT SMSPEC UNRST UNSMRY
|
||||
fi
|
||||
|
||||
if grep -q "norne_init" <<< $test_name
|
||||
then
|
||||
copyToReferenceDir \
|
||||
$configuration/build-opm-simulators/tests/results/init/flow+norne/ \
|
||||
$OPM_DATA_ROOT/norne/opm-simulation-reference/ \
|
||||
NORNE_ATW2013 \
|
||||
EGRID INIT
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "${@:2}" ]
|
||||
then
|
||||
# User did not specify tests to update, probe
|
||||
pushd $OPM_DATA_ROOT > /dev/null
|
||||
tests=""
|
||||
git status | grep "SPE1CASE1" && tests="spe11"
|
||||
git status | grep "SPE1CASE2" && tests="$tests spe12"
|
||||
git status | grep "SPE3CASE1" && tests="$tests spe3"
|
||||
git status | grep "SPE9_CP" && tests="$tests spe9"
|
||||
git status | grep "NORNE_ATW2013" && tests="$tests norne_init"
|
||||
popd > /dev/null
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
echo -e "update reference data for ${@:2}\n" > /tmp/cmsg
|
||||
echo -e "update reference data for $tests\n" > /tmp/cmsg
|
||||
if [ -z "$REASON" ]
|
||||
then
|
||||
echo -e "Reason: fill in this\n" >> /tmp/cmsg
|
||||
else
|
||||
echo -e "Reason: $REASON\n" >> /tmp/cmsg
|
||||
fi
|
||||
for dep in ert opm-common opm-core opm-grid opm-material opm-parser opm-output ewoms
|
||||
do
|
||||
pushd $WORKSPACE/deps/$dep > /dev/null
|
||||
@ -73,4 +98,14 @@ done
|
||||
echo -e "opm-simulators = `git rev-parse HEAD`" >> /tmp/cmsg
|
||||
|
||||
cd $OPM_DATA_ROOT
|
||||
if [ -n "$BRANCH_NAME" ]
|
||||
then
|
||||
git checkout -b $BRANCH_NAME origin/master
|
||||
fi
|
||||
|
||||
if [ -z "$REASON" ]
|
||||
then
|
||||
git commit -a -t /tmp/cmsg
|
||||
else
|
||||
git commit -a -F /tmp/cmsg
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user