diff --git a/.coveragerc b/.coveragerc index a2957b48..5a845fb4 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,2 +1,5 @@ [run] -omit = depyf/explain/* +source = depyf + +[report] +include = depyf/* diff --git a/.github/workflows/test_pytorch.yml b/.github/workflows/test_pytorch.yml index a739f339..13f4177e 100644 --- a/.github/workflows/test_pytorch.yml +++ b/.github/workflows/test_pytorch.yml @@ -28,7 +28,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 pytest + python -m pip install flake8 pytest pytest-cov python -m pip install setuptools python -m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu python setup.py develop @@ -42,13 +42,18 @@ jobs: echo "success" - name: Test with pytest run: | - python tests/test_pytorch/test_mp.py - python tests/test_pytorch/test_no_graph.py - python tests/test_pytorch/test_irregular.py - python tests/test_pytorch/test_simple_graph.py - python tests/test_pytorch/test_cellvars.py + coverage run --append tests/test_pytorch/test_mp.py + coverage run --append tests/test_pytorch/test_no_graph.py + coverage run --append tests/test_pytorch/test_irregular.py + coverage run --append tests/test_pytorch/test_simple_graph.py + coverage run --append tests/test_pytorch/test_cellvars.py python tests/test_pytorch/spawn_tests.py python tests/test_pytorch/cmp_output.py python tests/test_pytorch/test_debug.py 2>&1 < tests/test_pytorch/debug_input.txt > tests/test_pytorch/debug_output.txt cat tests/test_pytorch/debug_output.txt - python tests/test_pytorch/check_debug_output.py \ No newline at end of file + python tests/test_pytorch/check_debug_output.py + + - name: Upload results to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/tests/test_pytorch/spawn_tests.py b/tests/test_pytorch/spawn_tests.py index 450306f6..de2474be 100644 --- a/tests/test_pytorch/spawn_tests.py +++ b/tests/test_pytorch/spawn_tests.py @@ -3,7 +3,7 @@ import os def task(): - subprocess.run("python tests/test_pytorch/test_pytorch.py", shell=True, input="c\n", text=True) + subprocess.run("coverage run --append tests/test_pytorch/test_pytorch.py", shell=True, input="c\n", text=True) if __name__ == '__main__':