From 0b39406c8664e2e607c278878e38e2f1eb8b4639 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 18 Jun 2024 17:52:49 +1000 Subject: [PATCH] README.md: Update manually running model-config-tests infomation --- README.md | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 9ad0e7d..5179aa3 100644 --- a/README.md +++ b/README.md @@ -9,41 +9,42 @@ bit reproducibility tests](https://github.com/COSIMA/access-om2/blob/master/test ## Pytests -### How to run tests manually (from a local install of model-config-tests) - -1. First clone the pytest code into a separate directory. +### How to run pytests manually on NCI +1. Create and activate a python virtual environment for installing and running tests ```sh - git clone https://github.com/ACCESS-NRI/model-config-tests/ model-config-tests + module load python3/3.11.0 + python3 -m venv + source /bin/activate ``` -2. To create a local install of `model-config-tests` - +2. Either pip install a released version of `model-config-tests`, + ```sh + pip install model-config-tests==0.0.1 + ``` + Or to install `model-config-tests` in "editable" mode, first clone the repository, and then run pip install from the repository. This means any changes to the code are reflected in the installed package. ```sh - cd model-config-tests - pip install --user -e . - model-config-tests --help # model-config-tests runs the pytest command for tests in the package + git clone https://github.com/ACCESS-NRI/model-config-tests/ + pip install -e ``` 3. Checkout an experiment (in this case it is using an ACCESS-OM2 config) ```sh - git clone https://github.com/ACCESS-NRI/access-om2-configs/ - cd + git clone https://github.com/ACCESS-NRI/access-om2-configs/ + cd git checkout ``` -4. Setup payu - +4. Run the pytests ```sh - module use /g/data/vk83/modules - module load payu/1.1.3 + model-config-tests ``` -5. Run the pytests - +5. Once done with testing, deactivate the virtual environment, and if the environment is no longer needed, remove the environment ```sh - model-config-tests + deactivate + rm -rf # Deletes the test environment ``` ### Pytest Options