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+ 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+ uv pip install " .[tests]"
32+
33+ echo " Dependencies installed successfully. Listing installed dependencies..."
34+ uv 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+ }
You can’t perform that action at this time.
0 commit comments