File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ ln -s $XTGEO_TESTDATA_PATH $CI_ROOT /xtgeo-testdata
23+ cp -r $PROJECT_ROOT /tests $CI_TEST_ROOT
24+
25+ echo " Create symlinks from $CI_TEST_ROOT to files in $PROJECT_ROOT ..."
26+ ln -s $PROJECT_ROOT /conftest.py $CI_TEST_ROOT /conftest.py
27+ ln -s $PROJECT_ROOT /pyproject.toml $CI_TEST_ROOT /pyproject.toml
28+ }
29+
30+ install_test_dependencies () {
31+ echo " Installing test dependencies..."
32+ pip install " .[tests]"
33+
34+ echo " Dependencies installed successfully. Listing installed dependencies..."
35+ pip list
36+ }
37+
38+ run_pytest () {
39+ echo " Running xtgeoviz tests with pytest..."
40+ pushd $CI_TEST_ROOT
41+ pytest ./tests -n 4 -vv --testdatapath $XTGEO_TESTDATA_PATH
42+ popd
43+ }
You can’t perform that action at this time.
0 commit comments