Skip to content
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
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v0.0.94
_commit: v0.0.94-3-g86b3af6
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
description: A web app that is hosted within a local intranet. Nuxt frontend, python
backend, docker-compose
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ dist

# Logs
*.log
*.log.*
**/logs/log*.txt
**/logs/*.log.*

# macOS dev cleanliness
**/.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion template/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ dist

# Logs
*.log
*.log.*
**/logs/log*.txt
**/logs/*.log.*

# macOS dev cleanliness
**/.DS_Store
Expand Down
14 changes: 12 additions & 2 deletions template/README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,19 @@ uv --directory=backend run python src/entrypoint.py

When running the unit test suite, the `pytest-recording` library records HTTP requests as cassettes. If you encounter errors about a missing cassette, pass `--record-mode=once` to the `pytest` command to perform a live HTTP request instead.{% endraw %}{% endif %}{% if has_backend %}{% raw %}

To (re)generate the client code this app for use in E2E tests of the backend:

To (re)generate the client code for this app for use in E2E tests of the backend:

First, regenerate the openapi.json file that will be used in the next step to generate the Python models:

```bash
uv --directory=backend run pytest tests/unit/test_basic_server_functionality.py --snapshot-update
```

Once created, use Kiota to regenerate all models based on the new openapi.json spec.

```bash
mkdir -p ./backend/tests/e2e/generated/open_api/backend && docker run --network host -v ./backend/tests/e2e/generated/open_api/backend:/app/output -v ./backend/tests/unit/__snapshots__/test_basic_server_functionality/test_openapi_schema.json:/app/openapi.json mcr.microsoft.com/openapi/kiota:{% endraw %}{{ kiota_cli_version }}{% raw %} generate -l python -c BackendClient -n client -d openapi.json --exclude-backward-compatible --clean-output --additional-data false && uv --directory=backend run python kiota_nullable_fixer.py ./tests/unit/__snapshots__/test_basic_server_functionality/test_openapi_schema.json ./tests/e2e/generated/open_api/backend
mkdir -p "./backend/tests/e2e/generated/open_api/backend" && docker run --network host -v "./backend/tests/e2e/generated/open_api/backend:/app/output" -v "./backend/tests/unit/__snapshots__/test_basic_server_functionality/test_openapi_schema.json:/app/openapi.json" mcr.microsoft.com/openapi/kiota:{% endraw %}{{ kiota_cli_version }}{% raw %} generate -l python -c BackendClient -n client -d openapi.json --exclude-backward-compatible --clean-output --additional-data false && uv --directory=backend run python kiota_nullable_fixer.py "./tests/unit/__snapshots__/test_basic_server_functionality/test_openapi_schema.json" "./tests/e2e/generated/open_api/backend"
```{% endraw %}{% endif %}{% if has_backend and backend_uses_graphql %}{% raw %}

To regenerate the GraphQL client code for the E2E test suite, run:
Expand Down
2 changes: 1 addition & 1 deletion template/pytest.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[pytest]
# Settings managed by the base template
norecursedirs = node_modules .precommit_cache .npm_cache .pipenv_cache venv .venv .history
addopts = --cov=src --cov-report html --cov-report term-missing:skip-covered --cov-config=../.coveragerc
addopts = --cov=src --cov-report html --cov-report term-missing:skip-covered --cov-config=./.coveragerc

log_cli = 1
log_cli_level = INFO
Expand Down