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).