From 6a3a21df7c9155f6e4b3b6d0dd562d3e5be9c077 Mon Sep 17 00:00:00 2001 From: jrunu <50096395+jrunu@users.noreply.github.com> Date: Fri, 9 May 2025 13:12:32 +0200 Subject: [PATCH] README.md: How to run tests locally --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index f5f9447..b923839 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,17 @@ To build a wheel from the sources: 3. `pip3 install dist/XXX.whl` +## How to run tests locally +The following commands create a local envrionment to run the python client test against a IRIS instance created with docker compose. +It requires [pytest](https://docs.pytest.org/en/stable/) for running the tests. + +1. Clone [iris-web](https://github.com/dfir-iris/iris-web) and [iris-client](https://github.com/dfir-iris/iris-client) +2. Copy the test .env over: `cp iris-client/dfir_iris_client/tests/resources/.env iris-web/.env` +3. Start the IRIS instance `docker compose -f iris-web/docker-compose.dev.yml up -d` +4. Read the .env into the shell environment to access the token: `set -a && source iris-web/.env && set +a` +5. Run the tests: `pytest iris-client/dfir_iris_client/tests/` +6. Tear down and remove volumes: `docker compose -f iris-web/docker-compose.dev.yml down --volumes` + ## Examples Some examples are available [here](https://github.com/dfir-iris/iris-client/tree/master/examples).