Skip to content

Commit

Permalink
Pin test requirements and replace flake8 with pylint
Browse files Browse the repository at this point in the history
as the former had conflicting dependencies with other packages.
This pinning is needed as sometimes installing test dependencies
is super slow in CI/CD because pip has to resolve a matching set
of versions (I observed even a >20 minutes running time and a timeout).
  • Loading branch information
gdubicki committed Dec 15, 2022
1 parent 5823795 commit bc8b2f1
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Test
run: |
pytest --cov=. --cov-report=xml --strict-markers --mypy -v puppetboard test
flake8 -v .
pylint --errors-only puppetboard test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ You're advised to do this inside a virtualenv specifically created to work on Pu
You can run the tests with:
```bash
pytest --cov=. --cov-report=xml --strict-markers --mypy puppetboard test
flake8 -v .
pylint --errors-only puppetboard test
```

You can run the app it in development mode by simply executing:
Expand Down
4 changes: 4 additions & 0 deletions pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[tool.pylint."messages control"]

disable = no-member

34 changes: 17 additions & 17 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
-r requirements.txt
pep8
coverage
mock
pytest>=7,<8
flake8>=5.0.4,<6
pytest-flake8>=1.1.1,<2
pytest-cov
pytest-mock
pytest-mypy
pytest-randomly
cov-core
beautifulsoup4
bandit
mypy
types-requests
types-setuptools
types-toml
pep8==1.7.1
coverage==6.5.0
mock==4.0.3
pytest==7.2.0
pylint==2.15.8
pytest-pylint==0.19.0
pytest-cov==4.0.0
pytest-mock==3.10.0
pytest-mypy==0.10.2
pytest-randomly==3.12.0
cov-core==1.15.0
beautifulsoup4==4.11.1
bandit==1.7.4
mypy==0.991
types-requests==2.28.11.5
types-setuptools==65.6.0.2
types-toml==0.10.8.1
4 changes: 0 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
[bdist_wheel]
universal = 1

[flake8]
max-line-length=100
exclude=venv,dist,build

[mypy]
ignore_missing_imports=True
ignore_errors=False
Expand Down
5 changes: 2 additions & 3 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from puppetboard.core import get_friendly_error


# flake8: noqa
@pytest.mark.parametrize("raw_message,friendly_message", [
("Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation "
"Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating "
Expand All @@ -32,8 +31,8 @@
Error while evaluating a Method call:
Could not find class ::profiles::snapshot_restore
…in …/qa/manifests/site.pp, line: 31, column: 7.
…in …/qa/manifests/site.pp, line: 31, column: 7.
"""),
])
def test_get_friendly_error(raw_message, friendly_message):
Expand Down

0 comments on commit bc8b2f1

Please sign in to comment.