Skip to content

Commit bffce8e

Browse files
committed
CI: Add testrmsenv.sh script for testing against RMS environment
1 parent 2c4972b commit bffce8e

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

ci/testrmsenv.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This shell script is to be sourced and run from a github workflow
2+
# when xtgeoviz is to be tested towards a new RMS Python environment
3+
4+
run_tests() {
5+
set_test_variables
6+
7+
copy_test_files
8+
9+
install_test_dependencies
10+
11+
run_pytest
12+
}
13+
14+
set_test_variables() {
15+
echo "Setting variables for xtgeoviz tests..."
16+
CI_TEST_ROOT=$CI_ROOT/xtgeoviz_test_root
17+
}
18+
19+
copy_test_files () {
20+
echo "Copy xtgeoviz test files to $CI_TEST_ROOT..."
21+
mkdir -p $CI_TEST_ROOT
22+
cp -r $PROJECT_ROOT/tests $CI_TEST_ROOT
23+
24+
echo "Create symlinks from $CI_TEST_ROOT to files in $PROJECT_ROOT..."
25+
ln -s $PROJECT_ROOT/conftest.py $CI_TEST_ROOT/conftest.py
26+
ln -s $PROJECT_ROOT/pyproject.toml $CI_TEST_ROOT/pyproject.toml
27+
}
28+
29+
install_test_dependencies () {
30+
echo "Installing test dependencies..."
31+
pip install ".[tests]"
32+
33+
echo "Dependencies installed successfully. Listing installed dependencies..."
34+
pip list
35+
}
36+
37+
run_pytest () {
38+
echo "Running xtgeoviz tests with pytest..."
39+
pushd $CI_TEST_ROOT
40+
pytest ./tests -n 4 -vv --testdatapath $XTGEO_TESTDATA_PATH
41+
popd
42+
}

0 commit comments

Comments
 (0)