Commit graph

12 commits

Author SHA1 Message Date
Alex Pyrgiotis
f16b42bb18
Ignore dev_scripts/envs for tests/lints
Ignore the `dev_scripts/envs` folder when running tests or linting code,
as it may contain files that are not owned by the current user. In this
case, we've seen that pytest/black etc. fail.

This typically happens when the user has run Dangerzone in a
containerized environment (see #286), and Podman created a directory
with files owned by the user in the nested container.
2023-01-16 18:48:09 +02:00
deeplow
84b8212e5d
Fix test instability: pytest in seq. podman<4.3.0
Instability in the automated tests sometimes would sometimes fail when
running "podman images --format {{.ID}}". It turns out that in versions
prior to podman 4.3.0, podman volumes (stored in
~/.local/share/contaiers) would get corrupted when multiple tests were
run in parallel.

The current solution is to wrap the test command to run sequentially in
versions prior to the fix and in parallel for versions after that.

Fixes #217
2023-01-09 11:54:24 +00:00
Alex Pyrgiotis
a14b4e9620
Fix a minor typo 2022-10-27 13:44:18 +01:00
Alex Pyrgiotis
03c3541bdc
tests: Run Mypy against tests
Run Mypy static checks against our tests. This brings them inline with
the rest of the codebase, and we have an extra level of certainty that
the tests (and unit tests in particular) will not significantly diverge
from the code they are testing.
2022-10-25 19:09:23 +03:00
deeplow
d5eefeab3d
report non-containerized code coverage 2022-09-13 13:17:22 +01:00
deeplow
9e3d404ed8
make test: add to Makefile & enabled parallel runs
parallel pytest via pytest-xdist
2022-09-13 13:08:01 +01:00
deeplow
092456434b
don't type check dev scripts 2022-08-22 12:28:48 +01:00
deeplow
463ff97b97
add type hints to container dz py code 2022-08-22 12:28:44 +01:00
deeplow
ec8bafa27c
add mypy lint check 2022-08-22 11:12:24 +01:00
deeplow
1f8e23f164
make mypy more pedantic
Borrow the mypy configuration from the securedrop-client Makefile
2022-08-22 10:30:40 +01:00
deeplow
75c4ee3d2b
add mypy lint to makefile 2022-08-22 10:30:38 +01:00
deeplow
6fc0e2c15f
add Makefile with linters (black & isort)
- borrowed makefile self-help code from SecureDrop
- considered windows dev env case: GNU make available via Cygwin
2022-08-22 10:03:57 +01:00