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

Use tox to manage the test suite #7

Merged
merged 2 commits into from
Jul 12, 2023
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
3 changes: 2 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[run]
source = dsp
parallel = true
source = dsp, tests
relative_files = True

[report]
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,18 @@ jobs:
steps:
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: |
3.11
3.10
3.9
3.8
- uses: actions/checkout@v3
with:
fetch-depth: 0 # For sonar
- name: Install dependencies
run: |
pip install .
pip install pytest pytest-cov pandas
run: pip install tox
- name: Run tests
run: |
pytest --cov=dsp --cov-report xml:coverage.xml
run: tox

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ zip_safe = True
include_package_data = True

[options.extras_require]
dev = pytest
dev = tox

[options.package_data]
* = README.md
Expand Down
57 changes: 57 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[tox]
min_version = 4.3.5

envlist =
coverage_erase
py{3.11, 3.10, 3.9, 3.8}
coverage_report
docs

skip_missing_interpreters = True
isolated_build = True


[testenv]
description = Test
package = wheel
wheel_build_env = build_wheel

depends =
py{3.11, 3.10, 3.9, 3.8}: coverage_erase
deps =
coverage
pandas
pytest
commands =
coverage run -m pytest


[testenv:docs]
description = Test documentation builds
skipsdist = true
skip_install = true
deps =
sphinx
cvxpy
commands = sphinx-build -aEnqb html docs/ build/docs


[testenv:coverage_erase]
description = Erase coverage files
skipsdist = true
skip_install = true
deps = coverage
commands = coverage erase


[testenv:coverage_report]
description = Report coverage
depends =
py{3.11, 3.10, 3.9, 3.8}
skipsdist = true
skip_install = true
deps = coverage
commands_pre =
coverage combine
coverage html --fail-under=0
commands = coverage report