Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test instructions #365

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```