From 805fa98ec5b33466bbc79ad0296be6d3fe778f82 Mon Sep 17 00:00:00 2001 From: Ludovico Bianchi Date: Wed, 1 May 2024 18:16:43 -0500 Subject: [PATCH] Enable coverage collection --- .github/workflows/checks.yml | 9 +++++++++ requirements-dev.txt | 2 ++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f297608..e6a0412 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -59,6 +59,11 @@ jobs: os-version: ubuntu-22.04 - os: win64 os-version: windows-2022 + - install-mode: dev + python-version: "3.11" # choice of Python version is arbitrary among those in matrix + coverage: "true" + mpi: "true" + steps: - if: matrix.install-mode == 'dev' uses: actions/checkout@v4 @@ -78,6 +83,10 @@ jobs: - name: Set up IDAES solvers run: | idaes get-extensions --verbose + - if: matrix.coverage + name: Enable coverage for pytest + run: | + echo PYTEST_ADDOPTS="$PYTEST_ADDOPTS --cov-report=xml" >> $GITHUB_ENV - name: Run pytest run: | pip install pytest # ensure pytest is installed (should do nothing if already present from requirements-dev.txt) diff --git a/requirements-dev.txt b/requirements-dev.txt index f26c9e6..53f0e59 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,5 @@ black==24.3.0 +pytest-cov +coverage --editable .[testing,ray] watertap @ git+https://github.com/watertap-org/watertap@main