From 81aa95bf4e2d912af9a8b5ab1e7df8d530cf9de5 Mon Sep 17 00:00:00 2001 From: Sindre Langeveld <31990241+slangeveld@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:28:28 +0100 Subject: [PATCH] CI: Add script for running tests from github worklow (#271) --- ci/testrmsenv.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ci/testrmsenv.sh diff --git a/ci/testrmsenv.sh b/ci/testrmsenv.sh new file mode 100644 index 00000000..54b6cc1d --- /dev/null +++ b/ci/testrmsenv.sh @@ -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 +} \ No newline at end of file