diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8c308c1243..967192e5a92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,12 +104,12 @@ jobs: Copy-Item -Path ".\test_local_server.py",".\test_multi_server.py", ".\test_workflow.py" -Destination ".\..\local_server_test\" Copy-Item -Path ".\conftest.py" -Destination ".\..\local_server_test\conftest.py" Remove-Item -Path ".\test_local_server.py",".\test_multi_server.py", ".\test_workflow.py" - pytest --log-level=ERROR --junitxml=junit/test-results1.xml --reruns 2 . + pytest --cov=ansys.dpf.core --cov-report=xml --cov-report=html --log-level=ERROR --junitxml=junit/test-results1.xml --reruns 2 . - name: Test Core API 2 run: | cd local_server_test - pytest --log-level=ERROR --junitxml=../tests/junit/test-results2.xml --reruns 2 . + pytest --cov=ansys.dpf.core --cov-report=xml --cov-report=html --cov-append --log-level=ERROR --junitxml=../tests/junit/test-results2.xml --reruns 2 . timeout-minutes: 10 - name: Kill all servers @@ -120,6 +120,9 @@ jobs: if "%ERRORLEVEL%"=="0"(taskkill /f /im Ans.Dpf.Grpc.exe) continue-on-error: true + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + - name: Publish Test Results uses: actions/upload-artifact@v2 with: diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000000..11163ebe617 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,21 @@ +comment: + layout: "diff" + behavior: default + +coverage: + status: + project: false + patch: + default: + # basic + target: auto + threshold: 10% + if_not_found: success + if_ci_failed: error + if_no_uploads: error + ignore: + - "examples" # ignore folder and all its contents + - "docs" # ignore folder and all its contents + - "docker" # ignore folder and all its contents + - "tests" # ignore folder and all its contents + - "ansys/dpf/core/operators" # ignore folder and all its contents \ No newline at end of file diff --git a/requirements_test.txt b/requirements_test.txt index d3da4307ede..33ed6c8703d 100755 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -4,3 +4,4 @@ pytest-rerunfailures matplotlib==3.2 vtk<9.1.0 pyvista>=0.24.0 +coverage