Skip to content

Commit

Permalink
Add test instructions (#365)
Browse files Browse the repository at this point in the history
* Add test instructions

Signed-off-by: javiermtorres <[email protected]>
Co-authored-by: Peter Wilson <[email protected]>
  • Loading branch information
javiermtorres and peteski22 authored Nov 18, 2024
1 parent 9a89c11 commit c55de69
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lumigator/python/mzai/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ uv sync --dev && \
source .venv/bin/activate
```

## Test instructions

The backend needs to retrieve the location of the database used in tests via the `SQLALCHEMY_DATABASE_URL` enviroment variable. For simplicity, SQLite is used inside the test container. To run the tests, please use:

```bash
SQLALCHEMY_DATABASE_URL=sqlite:///local.db uv run pytest
```

Note that this will create an SQLite database file named `local.db` in the `backend` directory. Remove it before running another batch of tests.

## Data models

As an engineer/contributor, when you change a data model or add a new model which needs to be
Expand Down
23 changes: 22 additions & 1 deletion lumigator/python/mzai/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,29 @@ or
uv pip install lumigator-sdk
```


Now that you have the SDK installed, you can use it to communicate with Lumigator. You can run the
[example notebook](/notebooks/walkthrough.ipynb) for a platform API walkthrough, or follow the
[quickstart guide](https://mozilla-ai.github.io/lumigator/get-started/quickstart.html) in the
documentation.

## Test instructions

The SDK contains both unit tests (requiring no additional containers) and integration tests (requiring a live Lumigator backend). By default only unit tests are run.

To run unit tests, please use:

```bash
uv run pytest
```

To run integration tests, please use:

```bash
pushd ../../../../ # go back to the project root
make start-lumigator-build # wait until all containers are up and running
popd
uv run pytest -o python_files="int_test_*.py" # wait until all tests have passed; update and repeat...
pushd ../../../../ # go back to the project root
make local-down # wait until all containers are removed
popd
```

0 comments on commit c55de69

Please sign in to comment.