-
Notifications
You must be signed in to change notification settings - Fork 4
/
tox.ini
68 lines (60 loc) · 1.9 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
[tox]
skipsdist=True
skip_missing_interpreters = True
envlist = lint, unit
[vars]
src_path = {toxinidir}/spark8t/
tst_path = {toxinidir}/tests/
all_path = {[vars]src_path} {[vars]tst_path}
int_resources_path = tests/integration/resources/test-pyspark.py
[testenv]
allowlist_externals = poetry
sg
setenv =
PYTHONPATH = {toxinidir}:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
PY_COLORS=1
passenv =
PYTHONPATH
USER
[testenv:fmt]
description = Apply coding style standards to code
commands =
poetry install --only fmt --sync --no-cache
poetry run isort {[vars]all_path}
poetry run black {[vars]all_path}
[testenv:lint]
description = Check code against coding style standards
commands =
poetry install --only fmt,lint --sync --no-cache
poetry run codespell {[vars]all_path} pyproject.toml
poetry run flake8 {[vars]all_path}
poetry run isort --check-only --diff {[vars]all_path}
poetry run black --check --diff {[vars]all_path}
poetry run mypy --install-types --non-interactive {[vars]all_path} --exclude {[vars]int_resources_path}
[testenv:unit]
description = Run unit tests
commands =
poetry install --with unit --sync --no-cache
poetry export -f requirements.txt -o requirements.txt
poetry run pytest -vv tests/unittest
[testenv:integration]
description = Run integration tests
setenv =
IE_TEST=1
KUBECONFIG={env:HOME}/.kube/config
commands =
poetry install --with integration --sync --no-cache
poetry export -f requirements.txt -o requirements.txt
poetry run pytest -vv tests/integration
[testenv:all-tests]
description = Run unit tests
setenv =
IE_TEST=1
KUBECONFIG={env:HOME}/.kube/config
commands =
poetry install --with unit,integration --sync --no-cache
poetry export -f requirements.txt -o requirements.txt
poetry run pytest tests