From cb9e4dbcab70cdabb57701e707952c307f7e1f22 Mon Sep 17 00:00:00 2001 From: David Kopp Date: Wed, 22 Nov 2023 23:01:17 +0100 Subject: [PATCH 1/2] Add hint to README to install dev requirements before running tests --- tests/README.MD | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/README.MD b/tests/README.MD index ff1ca19ac..344fcbf97 100644 --- a/tests/README.MD +++ b/tests/README.MD @@ -1,6 +1,8 @@ ## Pre-reqs -Make sure you have `pytest` and `pydantic` installed: -`pip install pytest pydantic` +Make sure you have the required dev dependencies installed: +```sh +python3 -m pip install -r ../requirements-dev.txt +``` We assume that your green-metrics-tool is already set up to work on your machine, as it will use your local config.yml file to determine which metric providers can be utilized in the tests. From a10a626db43216c2ecaa355544eba359a9c66472 Mon Sep 17 00:00:00 2001 From: David Kopp Date: Wed, 29 Nov 2023 12:49:14 +0100 Subject: [PATCH 2/2] Improve tests README --- tests/README.MD | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/README.MD b/tests/README.MD index 344fcbf97..fabdaf9e6 100644 --- a/tests/README.MD +++ b/tests/README.MD @@ -1,6 +1,16 @@ +# Tests + ## Pre-reqs + +Make sure you have venv activated: + +```bash +source ../venv/bin/activate +``` + Make sure you have the required dev dependencies installed: -```sh + +```bash python3 -m pip install -r ../requirements-dev.txt ``` @@ -8,6 +18,7 @@ We assume that your green-metrics-tool is already set up to work on your machine file to determine which metric providers can be utilized in the tests. ## First time setup + run: `python3 setup-test-env.py` @@ -20,6 +31,7 @@ You will need to re-run this setup script if new metric providers are added or t significant way. ## Running + To run the tests, you need to first start the test containers, then run pytest, and afterwards stop the containers. There are a few scripts to make this easy. @@ -35,4 +47,4 @@ window run the pytest suite using `pytest`, and then stop the containers when yo Running a subset of tests using pytest is better explained within the documentation here: https://docs.pytest.org/en/7.2.x/how-to/usage.html -You can also do everything in one command using the `./run-tests.sh` script. \ No newline at end of file +You can also do everything in one command using the `./run-tests.sh` script.