Skip to content

Commit 1684d14

Browse files
author
Zhe Yu
committed
chore: extra coverage args via env var.
1 parent 78495a9 commit 1684d14

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
EXTRA_LOCK_ARGS?=
22
EXTRA_DEPS?=
3+
EXTRA_COVERAGEPY_ARGS?=
34

45
LOADED_DOT_ENV=@if [ -f .env ] ; then source .env; fi;
56

@@ -24,7 +25,7 @@ multitest:
2425

2526
coverage:
2627
make deps; \
27-
pdm run coverage run -m pytest; \
28+
pdm run coverage run $(EXTRA_COVERAGEPY_ARGS) -m pytest; \
2829
pdm run coverage html; \
2930
pdm run coverage report -m
3031

docs/CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ Please take a look at [the database documentation](../src/vectorcode/database/RE
6666
which contains a brief introduction on the API design that explains what you'd need
6767
to do to add support for a new database.
6868

69+
### Coverage Across Mutiple Runs
70+
71+
If, for some reasons, you need to run the tests multiple times to get full coverage
72+
(maybe when there are conflicting dependency groups like chromadb 0.6.3 vs chromadb 1.x), you can pass `--append` flag to the `coverage` command.
73+
If you're using `make coverage`, you can set this flag via the `EXTRA_COVERAGEPY_ARGS` environment variable:
74+
```bash
75+
EXTRA_COVERAGEPY_ARGS="--append" make coverage
76+
```
77+
6978
## Neovim Plugin
7079

7180
At the moment, there isn't much to cover on here. As long as the code is

0 commit comments

Comments
 (0)