Skip to content

Commit

Permalink
🧪 Add code coverage to CI testing (#1067)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell authored Nov 13, 2023
1 parent 5783d92 commit a8ab520
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 4 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ jobs:
python -m pip freeze
- name: Run pytest
run: |
python -m pytest -v --ignore=tests/benchmarks -m "not jstest" tests
python -m pytest -v --ignore=tests/benchmarks -m "not jstest" --cov=sphinx_needs --cov-report=xml --cov-report=term-missing tests
coverage xml
- name: Upload to Codecov
if: github.repository == 'useblocks/sphinx-needs' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: sphinx-need-pytests
flags: pytests
file: ./coverage.xml
fail_ci_if_error: true

tests-js:
name: "JS py${{ matrix.python-version }} sphinx~=${{ matrix.sphinx-version }} ${{ matrix.os }}"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ _build
.cache/
.pytest_cache
.coverage
coverage.xml
.doctrees
docs/github_images/
.eggs/
Expand Down
89 changes: 87 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ matplotlib = { version = ">=3.3.0", optional = true }

# [project.optional-dependencies.test]
pytest = { version = "^7", optional = true }
pytest-cov = { version = "^4", optional = true }
lxml = { version = "^4.6.5", optional = true }
requests-mock = { version = ">=1.9.3", optional = true }
responses = { version = "^0.22.0", optional = true }
Expand All @@ -68,7 +69,17 @@ sphinx-immaterial = { version="0.11.7", optional = true }

[tool.poetry.extras]
plotting = ["matplotlib"]
test = ["matplotlib", "pytest", "syrupy", "sphinxcontrib-plantuml", "requests-mock", "lxml", "responses", "pytest-xprocess"]
test = [
"matplotlib",
"pytest",
"pytest-cov",
"syrupy",
"sphinxcontrib-plantuml",
"requests-mock",
"lxml",
"responses",
"pytest-xprocess"
]
test-parallel = ["pytest-xdist"]
benchmark = ["pytest-benchmark", "memray"]
docs = [
Expand Down

0 comments on commit a8ab520

Please sign in to comment.