Skip to content

Commit

Permalink
CI: Fix Komodo ci script
Browse files Browse the repository at this point in the history
Forgot to link the `examples/` directory. Also felt it would be more
correct to subshell the sourcing of roxenv to prevent potential
conflicts and reduce the possible sources of errors.
  • Loading branch information
mferrera committed Nov 23, 2023
1 parent 3c0118a commit 4dc7244
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ci/testkomodo.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
XTG_TEST_RUNPATH=$CI_TEST_ROOT/run

ROXENVSOURCE=/project/res/roxapi/aux/roxenvbash
RMS_VERSIONS=(
12.1.4
13.1.2
Expand All @@ -16,6 +17,7 @@ copy_test_files () {
# xtgeo tests look two directories back for xtgeo-testdata
mkdir -p $XTG_TEST_RUNPATH
cp -r $CI_SOURCE_ROOT/tests $XTG_TEST_RUNPATH
ln -s $CI_SOURCE_ROOT/examples $XTG_TEST_RUNPATH/examples
ln -s $CI_SOURCE_ROOT/conftest.py $XTG_TEST_RUNPATH/conftest.py
ln -s $CI_SOURCE_ROOT/pyproject.toml $XTG_TEST_RUNPATH/pyproject.toml
}
Expand All @@ -24,8 +26,11 @@ start_tests () {
pushd $CI_TEST_ROOT
echo "Testing xtgeo against Komodo"
install_and_test

set -e
for version in ${RMS_VERSIONS[@]}; do
test_in_roxenv $version
# Subshell each version for sourcing roxenv
$(test_in_roxenv $version)
done
popd
}
Expand All @@ -49,15 +54,15 @@ run_pytest () {

test_in_roxenv () {
set +e
source /project/res/roxapi/aux/roxenvbash $1
source $ROXENVSOURCE $1
# Unsetting an empty PYTHONPATH after sourcing roxenvbash
# may result in an error.
unset PYTHONPATH
set -e

python -m venv roxenv --system-site-packages

source roxenv/bin/activate

echo "Testing xtgeo against RMS $1"
install_and_test
deactivate
Expand Down

0 comments on commit 4dc7244

Please sign in to comment.