Skip to content

Commit

Permalink
rework cov
Browse files Browse the repository at this point in the history
  • Loading branch information
nrbgt committed Oct 24, 2024
1 parent 3108241 commit 4de68ce
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
- run: pixi run setup-js
- run: touch node_modules/.cached-in-ci
- run: pixi run dist
- run: pixi run build-js-ext-cov
- uses: actions/upload-artifact@v4
with:
name: ipyelk-${{ github.run_number }}-dist
Expand All @@ -49,8 +48,8 @@ jobs:
with:
name: ipyelk-${{ github.run_number }}-build
path: |
build/labextensions-cov
build/tsc/.*.tsbuildinfo
lib
src/_d
.pixi/task-cache-v0
Expand All @@ -76,6 +75,7 @@ jobs:
with:
name: ipyelk-${{ github.run_number }}-build-cov
path: |
build/tsc/.*.tsbuildinfo.cov
build/labextensions-cov
.pixi/task-cache-v0
Expand Down Expand Up @@ -167,6 +167,9 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: ipyelk-${{ github.run_number }}-dist
- uses: actions/download-artifact@v4
with:
name: ipyelk-${{ github.run_number }}-build
- if: matrix.task == 'test'
uses: actions/download-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion atest/_resources/keywords/Server.robot
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Initialize Coverage Kernel
... run
... --parallel-mode
... --branch
... --source ipyelk
... --source ${ROOT}/src/ipyelk
... --context atest-${PABOTQUEUEINDEX}-${PABOTEXECUTIONPOOLID}-${CALLER_ID}
... --concurrency thread
... --data-file ${cov_path}${/}.coverage
Expand Down
9 changes: 5 additions & 4 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ outputs = ["dist/SHA256SUMS"]

# unit test ############################################################################
[feature.tasks-utest.tasks.pip-utest]
cmd = """pixi r -e utest pip-dist--"""
cmd = """pixi r -e utest pip-editable--"""
inputs = ["dist/*.whl"]
outputs = ["build/reports/pip-freeze/utest.txt"]

Expand All @@ -186,7 +186,7 @@ cmd = """
export
COVERAGE_FILE=$PIXI_PROJECT_ROOT/build/reports/utest/.coverage
&& pytest
--cov ipyelk
--cov $PIXI_PROJECT_ROOT/src/ipyelk
--cov-report html:build/reports/utest/htmlcov
--cov-report term-missing:skip-covered
--cov-context test
Expand Down Expand Up @@ -252,7 +252,7 @@ outputs = ["build/reports/utest-future/{pytest.html,pytest.xunit.xml}"]

# integration test #####################################################################
[feature.tasks-itest.tasks.pip-itest]
cmd = """pixi r -e itest pip-dist--"""
cmd = """pixi r -e itest pip-editable--"""
inputs = ["dist/*.whl"]
outputs = ["build/reports/pip-freeze/itest.txt"]

Expand Down Expand Up @@ -286,7 +286,7 @@ outputs = ["build/reports/itest-future/nbconvert/**/*.html"]

# acceptance test ######################################################################
[feature.tasks-atest.tasks.pip-atest]
cmd = """pixi r -e atest pip-dist--"""
cmd = """pixi r -e atest pip-editable--"""
inputs = ["dist/*.whl"]
outputs = ["build/reports/pip-freeze/atest.txt"]

Expand Down Expand Up @@ -314,6 +314,7 @@ outputs = [
[feature.tasks-atest.tasks.report-cov]
cmd = """python scripts/report-cov.py"""
inputs = [
"pyproject.toml",
".github/workflows/ci.yml",
"scripts/report-cov.py",
"build/reports/utest/.coverage",
Expand Down
11 changes: 3 additions & 8 deletions scripts/report-cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import platform
import re
import shutil
import site
import sys
import tempfile
from pathlib import Path
Expand Down Expand Up @@ -39,12 +38,6 @@
FAIL_UNDER = "0"

PYPROJECT = f"""
[tool.coverage.paths]
source = [
'{SRC}',
'{site.getsitepackages()[0]}',
]
[tool.coverage.html]
skip_empty = true
title = "ALL"
Expand Down Expand Up @@ -98,7 +91,9 @@ def py_cov() -> int:
kwargs: Any = {"cwd": td}
tdp = Path(td)
(tdp / "pyproject.toml").write_text(PYPROJECT, **UTF8)
call(["coverage", "combine", "--keep", *all_py_cov], **kwargs)
call(
["coverage", "combine", "--debug=pathmap", "--keep", *all_py_cov], **kwargs
)
rc = call(
[
"coverage",
Expand Down

0 comments on commit 4de68ce

Please sign in to comment.