Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Specifies dependency version in tests #21

Merged
merged 1 commit into from
Jan 2, 2024
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: 2 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
channel: 1.28-strict/stable
juju-channel: 3.3/stable
- name: Run integration tests
run: tox -e integration
- name: Archive Tested Charm
Expand Down
21 changes: 21 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
black
codespell
coverage[toml]
cryptography
flake8 == 4.0.1
flake8-copyright
flake8-builtins
flake8-docstrings
isort
jsonschema
juju
mypy
ops
parameterized
pep8-naming
pyproject-flake8
pytest
pytest-operator
types-PyYAML
types-setuptools
types-toml
34 changes: 3 additions & 31 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,22 @@ setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
PY_COLORS=1
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
passenv =
PYTHONPATH
CHARM_BUILD_DIR
MODEL_SETTINGS

[testenv:fmt]
description = Apply coding style standards to code
deps =
black
isort
commands =
isort {[vars]all_path}
black {[vars]all_path}

[testenv:lint]
description = Check code against coding style standards
deps =
black
flake8 == 4.0.1
flake8-docstrings
flake8-copyright
flake8-builtins
pyproject-flake8
pep8-naming
isort
codespell
commands =
codespell {[vars]all_path}
pflake8 {[vars]all_path}
Expand All @@ -51,36 +41,18 @@ commands =

[testenv:static]
description = Run static analysis checks
deps =
-r{toxinidir}/requirements.txt
mypy
types-PyYAML
pytest
pytest-operator
juju
types-setuptools
types-toml
setenv =
PYTHONPATH = ""
commands =
mypy {[vars]all_path} {posargs}

[testenv:unit]
description = Run unit tests
deps =
pytest
coverage[toml]
-r{toxinidir}/requirements.txt
commands =
coverage run --source={[vars]src_path} -m pytest {[vars]unit_test_path} -v --tb native -s {posargs}
coverage report

[testenv:integration]
description = Run integration tests
deps =
pytest
juju<3.1
pytest-operator
-r{toxinidir}/requirements.txt
commands =
pytest --asyncio-mode=auto -v --tb native {[vars]integration_test_path} --log-cli-level=INFO -s {posargs}