Skip to content

Commit

Permalink
Document tests dependencies (#565)
Browse files Browse the repository at this point in the history
* Add hint to README to install dev requirements before running tests

* Improve tests README
  • Loading branch information
davidkopp authored Nov 29, 2023
1 parent 01d0938 commit 76994cc
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/README.MD
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# Tests

## Pre-reqs
Make sure you have `pytest` and `pydantic` installed:
`pip install pytest pydantic`

Make sure you have venv activated:

```bash
source ../venv/bin/activate
```

Make sure you have the required dev dependencies installed:

```bash
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.

## First time setup

run:

`python3 setup-test-env.py`
Expand All @@ -18,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.

Expand All @@ -33,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.
You can also do everything in one command using the `./run-tests.sh` script.

0 comments on commit 76994cc

Please sign in to comment.