From d1bc2c2cccfcc6874a20314792e3814c93ed0cfd Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 17 May 2022 17:23:52 +0200 Subject: [PATCH 1/8] Adding coverage --- .github/workflows/ci.yml | 11 +++++++++-- codecov.yml | 19 +++++++++++++++++++ requirements_test.txt | 1 + 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8c308c1243..231858d5d4c 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=True --log-level=ERROR --junitxml=../tests/junit/test-results2.xml --reruns 2 . timeout-minutes: 10 - name: Kill all servers @@ -120,6 +120,13 @@ jobs: if "%ERRORLEVEL%"=="0"(taskkill /f /im Ans.Dpf.Grpc.exe) continue-on-error: true + - name: Print Coverage + run: coverage xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + if: matrix.python-version == '3.8' + - name: Publish Test Results uses: actions/upload-artifact@v2 with: diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000000..089c69daa8d --- /dev/null +++ b/codecov.yml @@ -0,0 +1,19 @@ +comment: + layout: "diff" + behavior: default + +coverage: + status: + project: false + patch: + default: + # basic + target: 50% + 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 \ 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 From 940762948fa846742d00533426c1f6ce9e0d8da7 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 17 May 2022 17:35:04 +0200 Subject: [PATCH 2/8] Adding coverage --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 231858d5d4c..2f25e6c3007 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,7 @@ jobs: - name: Test Core API 2 run: | cd local_server_test - pytest --cov=ansys.dpf.core --cov-report=xml --cov-report=html --cov-append=True --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 From 3ae81f70e4586a1b77cf6cf447a20cb38682bed5 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 17 May 2022 18:06:20 +0200 Subject: [PATCH 3/8] Adding coverage --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f25e6c3007..daf048e9cbf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,9 +120,6 @@ jobs: if "%ERRORLEVEL%"=="0"(taskkill /f /im Ans.Dpf.Grpc.exe) continue-on-error: true - - name: Print Coverage - run: coverage xml - - name: Upload coverage to Codecov uses: codecov/codecov-action@v2 if: matrix.python-version == '3.8' From d581facc1d44954df27dd39ca5aeaa59036250bd Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 17 May 2022 18:18:50 +0200 Subject: [PATCH 4/8] Adding coverage --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index daf048e9cbf..967192e5a92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,7 +122,6 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v2 - if: matrix.python-version == '3.8' - name: Publish Test Results uses: actions/upload-artifact@v2 From 69cc6b15b2a753a19fba7500524ec2fd5ef39bf6 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Wed, 18 May 2022 09:39:43 +0200 Subject: [PATCH 5/8] Adding coverage --- codecov.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 089c69daa8d..9de90f792f4 100644 --- a/codecov.yml +++ b/codecov.yml @@ -13,7 +13,6 @@ coverage: 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 \ No newline at end of file From ce4e61710efc04af40cd2285c95ace8f71a157ee Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Wed, 18 May 2022 09:41:39 +0200 Subject: [PATCH 6/8] Adding coverage --- codecov.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 9de90f792f4..aa20b640359 100644 --- a/codecov.yml +++ b/codecov.yml @@ -13,6 +13,8 @@ coverage: 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 \ No newline at end of file + - "tests" # ignore folder and all its contents + - "ansys/dpf/core/operators" # ignore folder and all its contents \ No newline at end of file From 2b5c79712ed6a028d8e90f7fabcebaf52eab3720 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Wed, 18 May 2022 09:58:21 +0200 Subject: [PATCH 7/8] Adding .coveragerc --- .coveragerc | 11 +++++++++++ .github/workflows/ci.yml | 4 ++-- codecov.yml | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000000..cf102fba0e3 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,11 @@ +[run] +omit = + /examples/*, + /docs/*, + /docker/*, + conftest.py, + /tests/*, + /.ci/*, + /ansys/dpf/core/operators/*, + + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 967192e5a92..ff69e5751a6 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 --cov=ansys.dpf.core --cov-report=xml --cov-report=html --log-level=ERROR --junitxml=junit/test-results1.xml --reruns 2 . + pytest --cov=ansys.dpf.core --cov-report=xml --cov-report=html --cov-config=.coveragerc --log-level=ERROR --junitxml=junit/test-results1.xml --reruns 2 . - name: Test Core API 2 run: | cd local_server_test - pytest --cov=ansys.dpf.core --cov-report=xml --cov-report=html --cov-append --log-level=ERROR --junitxml=../tests/junit/test-results2.xml --reruns 2 . + pytest --cov=ansys.dpf.core --cov-report=xml --cov-report=html --cov-append --cov-config=.coveragerc --log-level=ERROR --junitxml=../tests/junit/test-results2.xml --reruns 2 . timeout-minutes: 10 - name: Kill all servers diff --git a/codecov.yml b/codecov.yml index aa20b640359..11163ebe617 100644 --- a/codecov.yml +++ b/codecov.yml @@ -8,7 +8,8 @@ coverage: patch: default: # basic - target: 50% + target: auto + threshold: 10% if_not_found: success if_ci_failed: error if_no_uploads: error From 0a6d9bffa7d407a2bd7fbbe1abfbed90383570c2 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Wed, 18 May 2022 10:12:13 +0200 Subject: [PATCH 8/8] Removing .coveragerc --- .coveragerc | 11 ----------- .github/workflows/ci.yml | 4 ++-- 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index cf102fba0e3..00000000000 --- a/.coveragerc +++ /dev/null @@ -1,11 +0,0 @@ -[run] -omit = - /examples/*, - /docs/*, - /docker/*, - conftest.py, - /tests/*, - /.ci/*, - /ansys/dpf/core/operators/*, - - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff69e5751a6..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 --cov=ansys.dpf.core --cov-report=xml --cov-report=html --cov-config=.coveragerc --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 --cov=ansys.dpf.core --cov-report=xml --cov-report=html --cov-append --cov-config=.coveragerc --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