generated from IWANABETHATGUY/tower-lsp-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
test: | ||
#!/usr/bin/env bash | ||
cd testing | ||
command -v uv || (echo 'uv package manager not found; exiting.' && exit 1) | ||
test -d .venv || uv venv | ||
. .venv/bin/activate | ||
uv pip compile requirements.in -o requirements.txt | ||
uv pip sync requirements.txt | ||
cargo build | ||
pytest -vv --color=yes | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
End-to-end testing for odoo-lsp. | ||
|
||
## Running tests | ||
|
||
Make sure [uv] and [just] are installed, then run `just test`. | ||
These same tests are also run in CI, so it's recommended to add them after a bug fix to prevent regressions. | ||
|
||
[uv]: https://docs.astral.sh/uv/ | ||
[just]: https://github.com/casey/just | ||
|
||
## Creating tests | ||
|
||
See [fixtures/basic/foo/models.py](fixtures/basic/foo/models.py) for an example how to write tests. | ||
You can use the below command to quickly scaffold a test case. (TODO) | ||
|
||
```shell | ||
pip install -U setuptools uv | ||
uv venv | ||
source .venv/bin/activate | ||
uv pip compile requirements.in > requirements.txt | ||
uv pip sync requirements.txt | ||
python scaffold.py fixtures/testcase [foo bar ...] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[tool.pytest.ini_options] | ||
timeout = 30 | ||
session_timeout = 600 | ||
session_timeout = 600 | ||
|
||
[tool.pyright] | ||
venv = ".venv" |