-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add script for running tests from github worklow (#271)
- Loading branch information
1 parent
23f2b9e
commit 81aa95b
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This shell script is to be sourced and run from a github workflow | ||
# when fmu-tools is to be tested towards a new RMS enviroment | ||
|
||
run_tests () { | ||
copy_test_files | ||
|
||
install_test_dependencies | ||
|
||
pushd $CI_TEST_ROOT | ||
start_tests | ||
popd | ||
} | ||
|
||
install_test_dependencies () { | ||
pip install ".[dev]" | ||
} | ||
|
||
copy_test_files () { | ||
cp -r $CI_SOURCE_ROOT/tests $CI_TEST_ROOT/tests | ||
# Pytest configuration is in pyproject.toml | ||
cp $CI_SOURCE_ROOT/pyproject.toml $CI_TEST_ROOT | ||
} | ||
|
||
start_tests () { | ||
pytest | ||
} |