Skip to content
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
37 changes: 35 additions & 2 deletions .github/workflows/all_tests_nnpdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ jobs:
- name: Test n3fit and validphys
shell: bash -l {0}
run: |
pytest --mpl --pyargs validphys n3fit --mpl-default-tolerance 18
pytest --cov=${PWD} --cov-config=pyproject.toml --mpl --pyargs validphys n3fit --mpl-default-tolerance 18
- name: Keep coverage file
if: startsWith(matrix.python-version, '3.12')
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: coverage-package-${{ matrix.os }}
path: .coverage


regression_tests:
runs-on: ubuntu-latest
Expand All @@ -40,7 +48,13 @@ jobs:
- name: Run regression tests
shell: bash -l {0}
run: |
pytest extra_tests/regression_checks.py
pytest --cov=${PWD} --cov-config=pyproject.toml extra_tests/regression_checks.py
- name: Keep coverage file
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: coverage-regression
path: .coverage

conda_tests:
strategy:
Expand Down Expand Up @@ -87,3 +101,22 @@ jobs:
run: |
cd n3fit/runcards/examples
n3fit Basic_runcard.yml 4

full_coverage:
needs: [run_package_tests, regression_tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_conda_pip
with:
nnpdf-extras: ""
- name: Install coverage
run: pip install coverage
- name: Download reports
uses: actions/download-artifact@v4
with:
path: reports
- name: Merge and show
run: |
coverage combine reports/**/.coverage
coverage report -i
19 changes: 18 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ seaborn = "*"
# tests
pytest = {version = "*", optional = true}
pytest-mpl = {version = "*", optional = true}
pytest-cov = {version = ">=6", optional = true}
hypothesis = {version = "*", optional = true}
# docs
sphinxcontrib-bibtex = {version = "*", optional = true}
Expand All @@ -102,7 +103,7 @@ pymongo = {version = "<4", optional = true}

# Optional dependencies
[tool.poetry.extras]
tests = ["pytest", "pytest-mpl", "hypothesis"]
tests = ["pytest", "pytest-mpl", "hypothesis", "pytest-cov"]
docs = ["sphinxcontrib-bibtex", "sphinx-rtd-theme", "sphinx", "tabulate"]
qed = ["fiatlux"]
nolha = ["pdfflow", "lhapdf-management"]
Expand Down Expand Up @@ -148,3 +149,19 @@ force_sort_within_sections = true

[tool.pytest.ini_options]
addopts = "--disable-warnings"

[tool.coverage.run]
omit = [
"*/local*",
"*/rule*",
"deprecated_functions.py",
"*/nnpdf_data/commondata/*",
"*/nnpdf_data/filter_utils/*",
"*test_*.py"
]
[tool.coverage.paths]
cipaths = [ # In order to combine files from both the ubuntu and macos runners
"./", # CI working directory
"/Users/runner/work/nnpdf/nnpdf",
"/home/runner/work/nnpdf/nnpdf"
]
Loading