Skip to content

Commit b27a8a7

Browse files
committed
CI: Added testrmsenv.sh
1 parent dccab8a commit b27a8a7

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

ci/testrmsenv.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This shell script is to be sourced and run from a github workflow
2+
# when fmu-config is to be tested towards a new RMS Python enviroment
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 fmu-config tests..."
16+
CI_TEST_ROOT=$CI_ROOT/fmuconfig-test-root
17+
}
18+
19+
copy_test_files () {
20+
echo "Copy fmu-config test files to test folder $CI_TEST_ROOT..."
21+
mkdir -p $CI_TEST_ROOT
22+
cp -r $PROJECT_ROOT/tests $CI_TEST_ROOT
23+
cp $PROJECT_ROOT/pyproject.toml $CI_TEST_ROOT
24+
}
25+
26+
install_test_dependencies () {
27+
echo "Installing test dependencies..."
28+
pip install ".[tests]"
29+
30+
echo "Dependencies installed successfully. Listing installed dependencies..."
31+
pip list
32+
}
33+
34+
run_pytest () {
35+
echo "Running fmu-config tests with pytest..."
36+
pushd $CI_TEST_ROOT
37+
pytest ./tests -n 4 -vv
38+
popd
39+
}

0 commit comments

Comments
 (0)