The project is a monorepo of several subprojects: queryzen-api and queryzen-client, the easiest
way to work with it in Pycharm or Jetbrains-IDEs is to open every project separately.
To run the tests of queryzen-client, you need a working backend, some tests are unit, most are integration.
We depend on two tools to develop and test:
- docker and docker compose to run tests and develop locally.
- uv, but other tools like pipx/pip could be used.
Follow the instructions to run the full test suite, which proves you have set up a correct environment to develop new features.
Clone the project:
git clone [email protected]:surister/queryzen.gitSet up environment:
# Path: ./queryzen/queryzen-api
$ uv syncRun django locally:
# Path: ./queryzen/queryzen-api
$ uv run python manage.py runseverIf it is the first time running, run the migrations:
# Path: ./queryzen/queryzen-api
$ uv run python manage.py migrateFor local development, the django api is run locally as it needs changes quickly, other components are more stale; those are run with a docker-compose.
# Path: ./queryzen/queryzen-api
docker compose -f docker-compose.yml up -dSet up environment:
# Path: ./queryzen/queryzen-client
$ uv syncRun tests:
# Path: ./queryzen/queryzen-client
uv run pytest --cov=queryzen --cov-report html .HTML with coverage will be created at queryzen/queryzen-client/htmlcov
Run lint:
# Path: ./queryzen/queryzen-client
uv run pylint .Tests in CI are run using an overridden production template, to run that locally:
# Path: ./queryzen/queryzen-api
docker compose -f docker-compose-ci.yml -f docker-compose-ci.override.yml up -d --build# Path: ./queryzen/queryzen-api
docker exec queryzen-api-django-1 bash -c "echo waiting 1s && sleep 1 && uv run python manage.py migrate"# Path: ./queryzen/queryzen-api
docker exec queryzen-api-client-1 bash -c "echo waiting 1s && sleep 1 && uv run pytest --cov-report=term-missing:skip-covered --cov-report=xml:/tmp/coverage.xml --junitxml=/tmp/pytest.xml --cov=queryzen tests/" | tee /tmp/pytest-coverage.txt