From cd0cbd2a54787cc826b49fb4ddba01c600a812fb Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 17 Sep 2025 17:38:35 +0200 Subject: [PATCH 01/37] fix: add codecove --- codecov.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..e6daa8018 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +coverage: + range: 60..100 + round: down + precision: 2 + status: + project: + default: + target: 90% + patch: off + + +codecov: + notify: + wait_for_ci: yes \ No newline at end of file From e17ab2251796f83f44f0b776aae9d1121963694c Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 17 Sep 2025 17:40:23 +0200 Subject: [PATCH 02/37] fix: add codecov secrets --- .github/actions/unit-test/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index ccc3300af..ab1075eb0 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -103,3 +103,10 @@ runs: name: coverage-html path: .cov/html retention-days: 7 + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + files: .cov/xml From 64513b5b420c8d688c4da09fb4e4ac4bf8699fe9 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 11:53:08 +0200 Subject: [PATCH 03/37] fix: combine coverage --- .github/actions/unit-test/action.yml | 38 +++++----- .github/workflows/ci_cd_pr.yml | 100 +++++++++++++++------------ 2 files changed, 76 insertions(+), 62 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index ab1075eb0..05bbfc0f1 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -36,6 +36,12 @@ inputs: default: "" type: string + coverage-file: + description: Coverage file path + required: false + default: ".cov/coverage" + type: string + runs: using: "composite" steps: @@ -72,9 +78,9 @@ runs: - name: Run pytest run: | if [ "${{ inputs.pytest-markers }}" = "" ]; then - pytest + export COVERAGE_FILE=${{ inputs.coverage-file }} && pytest else - pytest -m "${{ inputs.pytest-markers }}" + export COVERAGE_FILE=${{ inputs.coverage-file }} && pytest -m "${{ inputs.pytest-markers }}" fi shell: bash env: @@ -96,17 +102,17 @@ runs: name: server_output_tests.txt path: server_output.txt - - name: Upload coverage results - if: ${{ inputs.server-logs == 'true' }} - uses: actions/upload-artifact@v4 - with: - name: coverage-html - path: .cov/html - retention-days: 7 - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - files: .cov/xml + # - name: Upload coverage results + # if: ${{ inputs.server-logs == 'true' }} + # uses: actions/upload-artifact@v4 + # with: + # name: coverage-html + # path: .cov/html + # retention-days: 7 + + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + # env: + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + # with: + # files: .cov/xml diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index decaf7b45..31acd83f2 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -149,53 +149,61 @@ jobs: operating-system: ${{ matrix.os }} python-version: ${{ matrix.python-version }} - - run-testing: - name: Test the "run" subpackage - runs-on: ubuntu-latest - needs: [smoke-tests] - - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: ./.github/actions/unit-test - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - github-token: ${{ secrets.GITHUB_TOKEN }} - docker-image: ${{ env.PYDYNA_RUN_CONTAINER }} - pytest-markers: run - license-server: ${{ secrets.LICENSE_SERVER }} - - keyword-testing: - name: "Keyword testing" - runs-on: ${{ matrix.os }} - needs: [smoke-tests] - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - python-version: ['3.10', '3.11', '3.12', '3.13'] - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - - uses: ./.github/actions/unit-test - with: - python-version: ${{ matrix.python-version }} - github-token: ${{ secrets.GITHUB_TOKEN }} - pytest-markers: keywords - unit-tests: - name: "Testing" - runs-on: ubuntu-latest - needs: [run-testing, keyword-testing] - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: ./.github/actions/unit-test - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - github-token: ${{ secrets.GITHUB_TOKEN }} - server-logs: true + name: "Testing" + runs-on: ubuntu-latest + needs: [smoke-tests] + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ['3.10', '3.11', '3.12', '3.13'] + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: ./.github/actions/unit-test + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + github-token: ${{ secrets.GITHUB_TOKEN }} + docker-image: ${{ env.PYDYNA_RUN_CONTAINER }} + pytest-markers: run + license-server: ${{ secrets.LICENSE_SERVER }} + coverage-file: .cov/run + + - uses: ./.github/actions/unit-test + with: + python-version: ${{ matrix.python-version }} + github-token: ${{ secrets.GITHUB_TOKEN }} + pytest-markers: keywords + coverage-file: .cov/keywords + + - uses: ./.github/actions/unit-test + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + github-token: ${{ secrets.GITHUB_TOKEN }} + server-logs: true + coverage-file: .cov/unit-test + + - name: Merge coverage files + run: | + python -m pip install coverage + coverage combine .cov/ + coverage xml -o .cov/xml + coverage html -d .cov/html + shell: bash + + - name: Upload coverage results + uses: actions/upload-artifact@v4 + with: + name: coverage-html + path: .cov/html + + - name: "Upload coverage reports to Codecov" + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + files: .cov/xml + build-library: name: "Build library" From f1083cc9a2233b2bda8b3bcfc464011713d2e3f2 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 11:54:23 +0200 Subject: [PATCH 04/37] fix: combine coverage --- .github/workflows/ci_cd_pr.yml | 106 ++++++++++++++++----------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 31acd83f2..1cce0e5d8 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -150,59 +150,59 @@ jobs: python-version: ${{ matrix.python-version }} unit-tests: - name: "Testing" - runs-on: ubuntu-latest - needs: [smoke-tests] - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - python-version: ['3.10', '3.11', '3.12', '3.13'] - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: ./.github/actions/unit-test - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - github-token: ${{ secrets.GITHUB_TOKEN }} - docker-image: ${{ env.PYDYNA_RUN_CONTAINER }} - pytest-markers: run - license-server: ${{ secrets.LICENSE_SERVER }} - coverage-file: .cov/run - - - uses: ./.github/actions/unit-test - with: - python-version: ${{ matrix.python-version }} - github-token: ${{ secrets.GITHUB_TOKEN }} - pytest-markers: keywords - coverage-file: .cov/keywords - - - uses: ./.github/actions/unit-test - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - github-token: ${{ secrets.GITHUB_TOKEN }} - server-logs: true - coverage-file: .cov/unit-test - - - name: Merge coverage files - run: | - python -m pip install coverage - coverage combine .cov/ - coverage xml -o .cov/xml - coverage html -d .cov/html - shell: bash - - - name: Upload coverage results - uses: actions/upload-artifact@v4 - with: - name: coverage-html - path: .cov/html - - - name: "Upload coverage reports to Codecov" - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - files: .cov/xml + name: "Testing" + runs-on: ubuntu-latest + needs: [smoke-tests] + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ['3.10', '3.11', '3.12', '3.13'] + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: ./.github/actions/unit-test + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + github-token: ${{ secrets.GITHUB_TOKEN }} + docker-image: ${{ env.PYDYNA_RUN_CONTAINER }} + pytest-markers: run + license-server: ${{ secrets.LICENSE_SERVER }} + coverage-file: .cov/run + + - uses: ./.github/actions/unit-test + with: + python-version: ${{ matrix.python-version }} + github-token: ${{ secrets.GITHUB_TOKEN }} + pytest-markers: keywords + coverage-file: .cov/keywords + + - uses: ./.github/actions/unit-test + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + github-token: ${{ secrets.GITHUB_TOKEN }} + server-logs: true + coverage-file: .cov/unit-test + + - name: Merge coverage files + run: | + python -m pip install coverage + coverage combine .cov/ + coverage xml -o .cov/xml + coverage html -d .cov/html + shell: bash + + - name: Upload coverage results + uses: actions/upload-artifact@v4 + with: + name: coverage-html + path: .cov/html + + - name: "Upload coverage reports to Codecov" + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + files: .cov/xml build-library: From b9349192c99116a32ecc340f7c405a4300257e78 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 11:55:24 +0200 Subject: [PATCH 05/37] fix: cicd --- .github/workflows/ci_cd_pr.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 1cce0e5d8..45b857be5 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -154,10 +154,10 @@ jobs: runs-on: ubuntu-latest needs: [smoke-tests] strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - python-version: ['3.10', '3.11', '3.12', '3.13'] + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - uses: ./.github/actions/unit-test From d13f88d43b745f385ab492537753d513aee186f7 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Thu, 18 Sep 2025 09:56:20 +0000 Subject: [PATCH 06/37] chore: adding changelog file 909.added.md [dependabot-skip] --- doc/changelog/909.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog/909.added.md diff --git a/doc/changelog/909.added.md b/doc/changelog/909.added.md new file mode 100644 index 000000000..024ab838a --- /dev/null +++ b/doc/changelog/909.added.md @@ -0,0 +1 @@ +Add coverage From a2093d02e6bb0c5b4061bafacb4fd875fb9af352 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 11:56:42 +0200 Subject: [PATCH 07/37] fix: comment preline now --- .github/workflows/ci_cd_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 45b857be5..ab8792693 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -152,7 +152,7 @@ jobs: unit-tests: name: "Testing" runs-on: ubuntu-latest - needs: [smoke-tests] + # needs: [smoke-tests] strategy: fail-fast: false matrix: From 09a23fb15f71b85d3dff4599fc44ef1515cb0475 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 12:14:33 +0200 Subject: [PATCH 08/37] fix: update the python --- .github/workflows/ci_cd_pr.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index ab8792693..dbb3b8867 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -156,11 +156,13 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] + # os: [ubuntu-latest, windows-latest] python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: ./.github/actions/unit-test + + - name: Run test with "run" marker + uses: ./.github/actions/unit-test with: python-version: ${{ env.MAIN_PYTHON_VERSION }} github-token: ${{ secrets.GITHUB_TOKEN }} @@ -169,14 +171,16 @@ jobs: license-server: ${{ secrets.LICENSE_SERVER }} coverage-file: .cov/run - - uses: ./.github/actions/unit-test + - name: Run test with "keywords" marker + uses: ./.github/actions/unit-test with: python-version: ${{ matrix.python-version }} github-token: ${{ secrets.GITHUB_TOKEN }} pytest-markers: keywords coverage-file: .cov/keywords - - uses: ./.github/actions/unit-test + - name: Run test without marker + uses: ./.github/actions/unit-test with: python-version: ${{ env.MAIN_PYTHON_VERSION }} github-token: ${{ secrets.GITHUB_TOKEN }} From bf24bda9c2095fca5e7d790ee7dd9ea204f296cf Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 12:15:58 +0200 Subject: [PATCH 09/37] fix: update the python --- .github/workflows/ci_cd_pr.yml | 10 +++++----- tests/test_keywords.py | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index dbb3b8867..d1caed784 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -153,11 +153,11 @@ jobs: name: "Testing" runs-on: ubuntu-latest # needs: [smoke-tests] - strategy: - fail-fast: false - matrix: - # os: [ubuntu-latest, windows-latest] - python-version: ['3.10', '3.11', '3.12', '3.13'] + # strategy: + # fail-fast: false + # matrix: + # # os: [ubuntu-latest, windows-latest] + # python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 diff --git a/tests/test_keywords.py b/tests/test_keywords.py index f72d77e3c..606ad978b 100644 --- a/tests/test_keywords.py +++ b/tests/test_keywords.py @@ -209,12 +209,12 @@ def test_read_keyword_no_defaults(): assert m.n == None # LSPP default for `n` is 0. -@pytest.mark.keywords -def test_boundary_prescribed_motion_set(ref_string): - b = kwd.BoundaryPrescribedMotionSet() - assert b.write() == ref_string.test_boundary_prescribed_motion_set - b.loads(ref_string.test_boundary_prescribed_motion_set2) - assert b.lcid == 100 +# @pytest.mark.keywords +# def test_boundary_prescribed_motion_set(ref_string): +# b = kwd.BoundaryPrescribedMotionSet() +# assert b.write() == ref_string.test_boundary_prescribed_motion_set +# b.loads(ref_string.test_boundary_prescribed_motion_set2) +# assert b.lcid == 100 @pytest.mark.keywords From 608f27750e5bd52487266c1b0f88dfddcea23586 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 14:16:09 +0200 Subject: [PATCH 10/37] fix: update the image --- .github/actions/unit-test/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index 05bbfc0f1..cb6ff4203 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -102,6 +102,13 @@ runs: name: server_output_tests.txt path: server_output.txt + - name: Stop container + if: ${{ inputs.docker-image != '' && inputs.pytest-markers != 'keywords' }} + run: | + docker stop kw_server + docker rm kw_server + shell: bash + # - name: Upload coverage results # if: ${{ inputs.server-logs == 'true' }} # uses: actions/upload-artifact@v4 From 8657c427ab36d590d69f6f51388d64785fc77bac Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 15:50:14 +0200 Subject: [PATCH 11/37] fix: update the actions --- .github/actions/unit-test/action.yml | 24 +++++++++--------------- .github/workflows/ci_cd_pr.yml | 11 ----------- pyproject.toml | 5 +++++ 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index cb6ff4203..1ae723bcf 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -36,12 +36,6 @@ inputs: default: "" type: string - coverage-file: - description: Coverage file path - required: false - default: ".cov/coverage" - type: string - runs: using: "composite" steps: @@ -78,9 +72,9 @@ runs: - name: Run pytest run: | if [ "${{ inputs.pytest-markers }}" = "" ]; then - export COVERAGE_FILE=${{ inputs.coverage-file }} && pytest + pytest else - export COVERAGE_FILE=${{ inputs.coverage-file }} && pytest -m "${{ inputs.pytest-markers }}" + pytest -m "${{ inputs.pytest-markers }}" fi shell: bash env: @@ -109,13 +103,13 @@ runs: docker rm kw_server shell: bash - # - name: Upload coverage results - # if: ${{ inputs.server-logs == 'true' }} - # uses: actions/upload-artifact@v4 - # with: - # name: coverage-html - # path: .cov/html - # retention-days: 7 + - name: Upload coverage results + if: ${{ inputs.server-logs == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: coverage-html + path: .cov/html + retention-days: 7 # - name: Upload coverage to Codecov # uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index d1caed784..b381bb9cd 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -169,7 +169,6 @@ jobs: docker-image: ${{ env.PYDYNA_RUN_CONTAINER }} pytest-markers: run license-server: ${{ secrets.LICENSE_SERVER }} - coverage-file: .cov/run - name: Run test with "keywords" marker uses: ./.github/actions/unit-test @@ -177,7 +176,6 @@ jobs: python-version: ${{ matrix.python-version }} github-token: ${{ secrets.GITHUB_TOKEN }} pytest-markers: keywords - coverage-file: .cov/keywords - name: Run test without marker uses: ./.github/actions/unit-test @@ -185,15 +183,6 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} github-token: ${{ secrets.GITHUB_TOKEN }} server-logs: true - coverage-file: .cov/unit-test - - - name: Merge coverage files - run: | - python -m pip install coverage - coverage combine .cov/ - coverage xml -o .cov/xml - coverage html -d .cov/html - shell: bash - name: Upload coverage results uses: actions/upload-artifact@v4 diff --git a/pyproject.toml b/pyproject.toml index 4876180ad..6a0b9b5ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -119,6 +119,11 @@ src_paths = ["doc", "src", "tests"] [tool.coverage.run] source = ["ansys.dyna.core"] +omit = [ + "src/ansys/dyna/core/pre/*", + "src/ansys/dyna/core/solver/*", + "src/ansys/dyna/core/keywords/keyword_classes/auto/*" +] [tool.coverage.report] show_missing = true From 5e129d5126d4597aebcb73393b736f8133d6181a Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 16:07:16 +0200 Subject: [PATCH 12/37] fix: update the actions --- .github/actions/unit-test/action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index 1ae723bcf..c81489c39 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -111,9 +111,9 @@ runs: path: .cov/html retention-days: 7 - # - name: Upload coverage to Codecov - # uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 - # env: - # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - # with: - # files: .cov/xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + files: .cov/xml From 60f143a282df1372291f7c377071475e0f3513d2 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 16:24:11 +0200 Subject: [PATCH 13/37] fix: update the cicd --- .github/actions/unit-test/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index c81489c39..c077d674e 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -104,7 +104,7 @@ runs: shell: bash - name: Upload coverage results - if: ${{ inputs.server-logs == 'true' }} + if: ${{ inputs.server-logs == 'true' }} && [ "${{ inputs.pytest-markers }}" = "" ] uses: actions/upload-artifact@v4 with: name: coverage-html @@ -112,6 +112,7 @@ runs: retention-days: 7 - name: Upload coverage to Codecov + if: inputs.pytest-markers == "" uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 4698cf21ff4c38b9c4b25930d63b869525842aaa Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 16:26:50 +0200 Subject: [PATCH 14/37] fix: update the cicd --- .github/actions/unit-test/action.yml | 8 +++++++- .github/workflows/ci_cd_pr.yml | 15 ++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index c077d674e..6b68e667e 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -36,6 +36,12 @@ inputs: default: "" type: string + codecov-token: + description: Token for Codecov upload + required: false + default: "" + type: string + runs: using: "composite" steps: @@ -115,6 +121,6 @@ runs: if: inputs.pytest-markers == "" uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + CODECOV_TOKEN: ${{ inputs.codecov-token }} with: files: .cov/xml diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index b381bb9cd..b30303b9e 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -19,6 +19,7 @@ env: PACKAGE_NAMESPACE: 'ansys.dyna.core' DOCUMENTATION_CNAME: "dyna.docs.pyansys.com" PYDYNA_RUN_CONTAINER: ${{ github.event.inputs.PyDynaRunContainer || 'ghcr.io/ansys/pydyna-run:latest'}} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -183,19 +184,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} github-token: ${{ secrets.GITHUB_TOKEN }} server-logs: true - - - name: Upload coverage results - uses: actions/upload-artifact@v4 - with: - name: coverage-html - path: .cov/html - - - name: "Upload coverage reports to Codecov" - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - files: .cov/xml + codecov-token: ${{ secrets.CODECOV_TOKEN }} build-library: From 0af52f0be72dafd5a051e24ee0fd643bb1373e49 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 16:28:48 +0200 Subject: [PATCH 15/37] fix: update the cicd --- .github/actions/unit-test/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index 6b68e667e..1b2103260 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -110,7 +110,7 @@ runs: shell: bash - name: Upload coverage results - if: ${{ inputs.server-logs == 'true' }} && [ "${{ inputs.pytest-markers }}" = "" ] + if: ${{ inputs.server-logs == 'true' && !inputs.pytest-markers }} uses: actions/upload-artifact@v4 with: name: coverage-html @@ -118,9 +118,9 @@ runs: retention-days: 7 - name: Upload coverage to Codecov - if: inputs.pytest-markers == "" + if: ${{ !inputs.pytest-markers }} uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 env: CODECOV_TOKEN: ${{ inputs.codecov-token }} with: - files: .cov/xml + files: .cov/xml \ No newline at end of file From c8650b0c7caf01897b3ddaff48d79cabffde024c Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 16:37:09 +0200 Subject: [PATCH 16/37] fix: update the cicd for keyword matrix --- .github/workflows/ci_cd_pr.yml | 27 +++++++++++++++++++++------ tests/test_keywords.py | 12 ++++++------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index b30303b9e..6253ecc86 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -149,16 +149,31 @@ jobs: library-name: ${{ env.PACKAGE_NAME }} operating-system: ${{ matrix.os }} python-version: ${{ matrix.python-version }} + + + keyword-testing: + name: "Keyword testing for matrix" + needs: [smoke-tests] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ['3.10', '3.11', '3.12', '3.13'] + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - name: Run test with "keywords" marker + uses: ./.github/actions/unit-test + with: + python-version: ${{ matrix.python-version }} + github-token: ${{ secrets.GITHUB_TOKEN }} + pytest-markers: keywords unit-tests: name: "Testing" runs-on: ubuntu-latest - # needs: [smoke-tests] - # strategy: - # fail-fast: false - # matrix: - # # os: [ubuntu-latest, windows-latest] - # python-version: ['3.10', '3.11', '3.12', '3.13'] + needs: [keyword-testing] steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 diff --git a/tests/test_keywords.py b/tests/test_keywords.py index 606ad978b..f72d77e3c 100644 --- a/tests/test_keywords.py +++ b/tests/test_keywords.py @@ -209,12 +209,12 @@ def test_read_keyword_no_defaults(): assert m.n == None # LSPP default for `n` is 0. -# @pytest.mark.keywords -# def test_boundary_prescribed_motion_set(ref_string): -# b = kwd.BoundaryPrescribedMotionSet() -# assert b.write() == ref_string.test_boundary_prescribed_motion_set -# b.loads(ref_string.test_boundary_prescribed_motion_set2) -# assert b.lcid == 100 +@pytest.mark.keywords +def test_boundary_prescribed_motion_set(ref_string): + b = kwd.BoundaryPrescribedMotionSet() + assert b.write() == ref_string.test_boundary_prescribed_motion_set + b.loads(ref_string.test_boundary_prescribed_motion_set2) + assert b.lcid == 100 @pytest.mark.keywords From 99c9c05b578c0aef1a2055142b4ac1b4d9b483c1 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 16:38:21 +0200 Subject: [PATCH 17/37] fix: update the cicd for keyword matrix --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6a0b9b5ee..2e72ac044 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,8 +120,6 @@ src_paths = ["doc", "src", "tests"] [tool.coverage.run] source = ["ansys.dyna.core"] omit = [ - "src/ansys/dyna/core/pre/*", - "src/ansys/dyna/core/solver/*", "src/ansys/dyna/core/keywords/keyword_classes/auto/*" ] From c86bb99f236953cd2d690a58c04de5227fcf4f4f Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 16:57:08 +0200 Subject: [PATCH 18/37] fix: update the cicd for keyword matrix --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index e6daa8018..4c3f86183 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,5 +1,5 @@ coverage: - range: 60..100 + range: 75..100 round: down precision: 2 status: From 7b3151a5ebd22963bf79da2a25320f78ea9810bd Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 18 Sep 2025 17:07:29 +0200 Subject: [PATCH 19/37] fix: update the cicd for al tests --- .github/workflows/ci_cd_pr.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 6253ecc86..068b5d614 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -170,15 +170,16 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} pytest-markers: keywords - unit-tests: - name: "Testing" + run-testing: + name: Test the "run" subpackage runs-on: ubuntu-latest - needs: [keyword-testing] + needs: [smoke-tests] + steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - - name: Run test with "run" marker - uses: ./.github/actions/unit-test + + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: ./.github/actions/unit-test with: python-version: ${{ env.MAIN_PYTHON_VERSION }} github-token: ${{ secrets.GITHUB_TOKEN }} @@ -186,13 +187,12 @@ jobs: pytest-markers: run license-server: ${{ secrets.LICENSE_SERVER }} - - name: Run test with "keywords" marker - uses: ./.github/actions/unit-test - with: - python-version: ${{ matrix.python-version }} - github-token: ${{ secrets.GITHUB_TOKEN }} - pytest-markers: keywords - + unit-tests: + name: "Testing" + runs-on: ubuntu-latest + needs: [keyword-testing, run-testing, codegen-testing] + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Run test without marker uses: ./.github/actions/unit-test with: From 670caf0bb85e7027eb5abe9a32bb13ba465f79ae Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 10:47:23 +0200 Subject: [PATCH 20/37] fix: test viz --- .github/actions/unit-test/action.yml | 1 + .github/workflows/ci_cd_pr.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index 1b2103260..1f1b05c66 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -79,6 +79,7 @@ runs: run: | if [ "${{ inputs.pytest-markers }}" = "" ]; then pytest + pytest -m viz else pytest -m "${{ inputs.pytest-markers }}" fi diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 97e71e964..da022c0ea 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -190,7 +190,7 @@ jobs: unit-tests: name: "Testing" runs-on: ubuntu-latest - needs: [keyword-testing, run-testing, codegen-testing] + # needs: [keyword-testing, run-testing, codegen-testing] steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Run test without marker From 5b73796cdc5344e868c7883b74898b44f7703459 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 12:09:14 +0200 Subject: [PATCH 21/37] fix: coverage results --- .github/actions/unit-test/action.yml | 41 ++++++++++++++++------------ .github/workflows/ci_cd_pr.yml | 31 +++++++++++++++++++++ 2 files changed, 54 insertions(+), 18 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index 1f1b05c66..e612b09db 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -42,6 +42,12 @@ inputs: default: "" type: string + coverage-file: + description: Coverage file path + required: false + default: ".cov/xml" + type: string + runs: using: "composite" steps: @@ -78,10 +84,9 @@ runs: - name: Run pytest run: | if [ "${{ inputs.pytest-markers }}" = "" ]; then - pytest - pytest -m viz + export COVERAGE_FILE=${{ inputs.coverage-file }} && pytest else - pytest -m "${{ inputs.pytest-markers }}" + export COVERAGE_FILE=${{ inputs.coverage-file }} && pytest -m "${{ inputs.pytest-markers }}" fi shell: bash env: @@ -110,18 +115,18 @@ runs: docker rm kw_server shell: bash - - name: Upload coverage results - if: ${{ inputs.server-logs == 'true' && !inputs.pytest-markers }} - uses: actions/upload-artifact@v4 - with: - name: coverage-html - path: .cov/html - retention-days: 7 - - - name: Upload coverage to Codecov - if: ${{ !inputs.pytest-markers }} - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 - env: - CODECOV_TOKEN: ${{ inputs.codecov-token }} - with: - files: .cov/xml \ No newline at end of file + # - name: Upload coverage results + # if: ${{ inputs.server-logs == 'true' && !inputs.pytest-markers }} + # uses: actions/upload-artifact@v4 + # with: + # name: coverage-html + # path: .cov/html + # retention-days: 7 + + # - name: Upload coverage to Codecov + # if: ${{ !inputs.pytest-markers }} + # uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + # env: + # CODECOV_TOKEN: ${{ inputs.codecov-token }} + # with: + # files: .cov/xml \ No newline at end of file diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index da022c0ea..e76580322 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -169,6 +169,7 @@ jobs: python-version: ${{ matrix.python-version }} github-token: ${{ secrets.GITHUB_TOKEN }} pytest-markers: keywords + coverage-file: .cov/keywords run-testing: name: Test the "run" subpackage @@ -186,6 +187,7 @@ jobs: docker-image: ${{ env.PYDYNA_RUN_CONTAINER }} pytest-markers: run license-server: ${{ secrets.LICENSE_SERVER }} + coverage-file: .cov/run unit-tests: name: "Testing" @@ -200,7 +202,36 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} server-logs: true codecov-token: ${{ secrets.CODECOV_TOKEN }} + coverage-file: .cov/unittests + upload-coverage: + name: "Combine coverage" + runs-on: ubuntu-latest + needs: [keyword-testing, run-testing, unit-tests] + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - name: Combine coverage files + run: | + pip install coverage codecov + coverage combine .cov/keywords .cov/run .cov/unittests + coverage xml -o .cov/xml + coverage html -d .cov/html + codecov -f .cov/xml -t ${{ env.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports" + + - name: Upload coverage results + uses: actions/upload-artifact@v4 + with: + name: coverage-html + path: .cov/html + retention-days: 7 + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + env: + CODECOV_TOKEN: ${{ env.CODECOV_TOKEN }} + with: + files: .cov/xml build-library: name: "Build library" From 8d723716544c443bdc8fe2ad8d54dacc627b819c Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 12:10:18 +0200 Subject: [PATCH 22/37] fix: test early --- .github/workflows/ci_cd_pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index e76580322..c483ca2b2 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -153,7 +153,7 @@ jobs: keyword-testing: name: "Keyword testing for matrix" - needs: [smoke-tests] + # needs: [smoke-tests] runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -174,7 +174,7 @@ jobs: run-testing: name: Test the "run" subpackage runs-on: ubuntu-latest - needs: [smoke-tests] + # needs: [smoke-tests] steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 From 671272ffdbaeb775445c4382c7bf3a195cf4ee43 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 13:29:43 +0200 Subject: [PATCH 23/37] fix: test early --- .github/actions/unit-test/action.yml | 9 +++++++++ .github/workflows/ci_cd_pr.yml | 23 +++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index e612b09db..8f839c9b7 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -108,6 +108,13 @@ runs: name: server_output_tests.txt path: server_output.txt + - name: Upload coverage files + if: ${{ inputs.coverage-file != '' }} + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.coverage-file }}-coverage + path: .cov/${{ inputs.coverage-file }} + - name: Stop container if: ${{ inputs.docker-image != '' && inputs.pytest-markers != 'keywords' }} run: | @@ -115,6 +122,8 @@ runs: docker rm kw_server shell: bash + + # - name: Upload coverage results # if: ${{ inputs.server-logs == 'true' && !inputs.pytest-markers }} # uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index c483ca2b2..d36f07c37 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -169,7 +169,7 @@ jobs: python-version: ${{ matrix.python-version }} github-token: ${{ secrets.GITHUB_TOKEN }} pytest-markers: keywords - coverage-file: .cov/keywords + coverage-file: keywords run-testing: name: Test the "run" subpackage @@ -187,7 +187,7 @@ jobs: docker-image: ${{ env.PYDYNA_RUN_CONTAINER }} pytest-markers: run license-server: ${{ secrets.LICENSE_SERVER }} - coverage-file: .cov/run + coverage-file: run unit-tests: name: "Testing" @@ -202,7 +202,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} server-logs: true codecov-token: ${{ secrets.CODECOV_TOKEN }} - coverage-file: .cov/unittests + coverage-file: unittests upload-coverage: name: "Combine coverage" @@ -211,10 +211,25 @@ jobs: steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - name: Download coverage files + uses: actions/download-artifact@v4 + with: + name: keywords-coverage,run-coverage,unittests-coverage + path: .cov + - name: Combine coverage files run: | pip install coverage codecov - coverage combine .cov/keywords .cov/run .cov/unittests + # Only include files that exist + files="" + for f in .cov/keywords .cov/run .cov/unittests; do + [ -f "$f" ] && files="$files $f" + done + if [ -z "$files" ]; then + echo "No coverage files found to combine." + exit 1 + fi + coverage combine $files coverage xml -o .cov/xml coverage html -d .cov/html codecov -f .cov/xml -t ${{ env.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports" From f163bfb2771317262ee76ad769949753db11a9ee Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 13:38:03 +0200 Subject: [PATCH 24/37] fix: test early --- .github/actions/unit-test/action.yml | 1 - pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index 8f839c9b7..ed1e20552 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -109,7 +109,6 @@ runs: path: server_output.txt - name: Upload coverage files - if: ${{ inputs.coverage-file != '' }} uses: actions/upload-artifact@v4 with: name: ${{ inputs.coverage-file }}-coverage diff --git a/pyproject.toml b/pyproject.toml index 2e72ac044..9d0dce578 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,7 +129,7 @@ show_missing = true [tool.pytest.ini_options] minversion = "7.1" -addopts = "-ra --cov=ansys.dyna.core --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report term -vv" +addopts = "-ra --cov=ansys.dyna.core" testpaths = ["tests"] markers = """ run: tests that exercise the `run` subpackage From a61671d720406b9ecce6be399b88b037f5332318 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 13:41:14 +0200 Subject: [PATCH 25/37] fix: coverage files --- .github/actions/unit-test/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index ed1e20552..2b7cfabf9 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -84,9 +84,9 @@ runs: - name: Run pytest run: | if [ "${{ inputs.pytest-markers }}" = "" ]; then - export COVERAGE_FILE=${{ inputs.coverage-file }} && pytest + export COVERAGE_FILE=.cov/${{ inputs.coverage-file }} && pytest else - export COVERAGE_FILE=${{ inputs.coverage-file }} && pytest -m "${{ inputs.pytest-markers }}" + export COVERAGE_FILE=.cov/${{ inputs.coverage-file }} && pytest -m "${{ inputs.pytest-markers }}" fi shell: bash env: From 19b6970790adf91591bec82b4eb4b4882119ff1c Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 13:45:58 +0200 Subject: [PATCH 26/37] fix: coverage files --- .github/actions/unit-test/action.yml | 2 +- .github/workflows/ci_cd_pr.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index 2b7cfabf9..c123e9f0a 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -112,7 +112,7 @@ runs: uses: actions/upload-artifact@v4 with: name: ${{ inputs.coverage-file }}-coverage - path: .cov/${{ inputs.coverage-file }} + path: .cov/${{ inputs.coverage-file }}-${{ inputs.python-version }} - name: Stop container if: ${{ inputs.docker-image != '' && inputs.pytest-markers != 'keywords' }} diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index d36f07c37..bd92edb56 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -221,8 +221,9 @@ jobs: run: | pip install coverage codecov # Only include files that exist + files="" - for f in .cov/keywords .cov/run .cov/unittests; do + for f in .cov/keywords-${{ env.PYTHON_VERSION }} .cov/run-${{ env.PYTHON_VERSION }} .cov/unittests-${{ env.PYTHON_VERSION }}; do [ -f "$f" ] && files="$files $f" done if [ -z "$files" ]; then From 7e894d1c91f29f94decdfb497033e73da769ab1c Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 13:51:31 +0200 Subject: [PATCH 27/37] fix: coverage files --- .github/actions/unit-test/action.yml | 3 ++- .github/workflows/ci_cd_pr.yml | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index c123e9f0a..c739b5879 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -45,7 +45,7 @@ inputs: coverage-file: description: Coverage file path required: false - default: ".cov/xml" + default: "" type: string runs: @@ -109,6 +109,7 @@ runs: path: server_output.txt - name: Upload coverage files + if: ${{ !inputs.coverage-file }} uses: actions/upload-artifact@v4 with: name: ${{ inputs.coverage-file }}-coverage diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index bd92edb56..55351b173 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -169,7 +169,6 @@ jobs: python-version: ${{ matrix.python-version }} github-token: ${{ secrets.GITHUB_TOKEN }} pytest-markers: keywords - coverage-file: keywords run-testing: name: Test the "run" subpackage @@ -223,7 +222,7 @@ jobs: # Only include files that exist files="" - for f in .cov/keywords-${{ env.PYTHON_VERSION }} .cov/run-${{ env.PYTHON_VERSION }} .cov/unittests-${{ env.PYTHON_VERSION }}; do + for f in .cov/keywords .cov/run .cov/unittests; do [ -f "$f" ] && files="$files $f" done if [ -z "$files" ]; then From 7cffe17ef8ceb4ba6c38cfb927352ed242d821be Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 13:53:02 +0200 Subject: [PATCH 28/37] fix: coverage files --- .github/actions/unit-test/action.yml | 7 +++---- .github/workflows/ci_cd_pr.yml | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index c739b5879..139307b82 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -45,7 +45,7 @@ inputs: coverage-file: description: Coverage file path required: false - default: "" + default: ".cov/xml" type: string runs: @@ -109,11 +109,10 @@ runs: path: server_output.txt - name: Upload coverage files - if: ${{ !inputs.coverage-file }} uses: actions/upload-artifact@v4 with: - name: ${{ inputs.coverage-file }}-coverage - path: .cov/${{ inputs.coverage-file }}-${{ inputs.python-version }} + name: ${{ inputs.coverage-file }}-${{ inputs.python-version }} + path: .cov/${{ inputs.coverage-file }} - name: Stop container if: ${{ inputs.docker-image != '' && inputs.pytest-markers != 'keywords' }} diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 55351b173..4bef698fd 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -222,7 +222,7 @@ jobs: # Only include files that exist files="" - for f in .cov/keywords .cov/run .cov/unittests; do + for f in keywords-${{ env.PYTHON_VERSION }} run-${{ env.PYTHON_VERSION }} unittests-${{ env.PYTHON_VERSION }}; do [ -f "$f" ] && files="$files $f" done if [ -z "$files" ]; then From e5705eddb3594b1362f78defe76296357c39a19e Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 13:58:49 +0200 Subject: [PATCH 29/37] fix: coverage files and results --- .github/actions/unit-test/action.yml | 35 +++++++------------------ .github/workflows/ci_cd_pr.yml | 39 +++++++++++++--------------- 2 files changed, 27 insertions(+), 47 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index 139307b82..f78f376a3 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -83,11 +83,12 @@ runs: - name: Run pytest run: | - if [ "${{ inputs.pytest-markers }}" = "" ]; then - export COVERAGE_FILE=.cov/${{ inputs.coverage-file }} && pytest - else - export COVERAGE_FILE=.cov/${{ inputs.coverage-file }} && pytest -m "${{ inputs.pytest-markers }}" - fi + mkdir -p .cov + if [ "${{ inputs.pytest-markers }}" = "" ]; then + export COVERAGE_FILE=.cov/${{ inputs.coverage-file }} && pytest --cov --cov-report=xml:.cov/xml --cov-report=html:.cov/html + else + export COVERAGE_FILE=.cov/${{ inputs.coverage-file }} && pytest -m "${{ inputs.pytest-markers }}" --cov --cov-report=xml:.cov/xml --cov-report=html:.cov/html + fi shell: bash env: PYDYNA_RUN_CONTAINER: ${{ inputs.docker-image }} @@ -111,30 +112,12 @@ runs: - name: Upload coverage files uses: actions/upload-artifact@v4 with: - name: ${{ inputs.coverage-file }}-${{ inputs.python-version }} - path: .cov/${{ inputs.coverage-file }} + name: coverage-${{ inputs.coverage-file }}-${{ inputs.python-version }} + path: .cov/xml - name: Stop container if: ${{ inputs.docker-image != '' && inputs.pytest-markers != 'keywords' }} run: | docker stop kw_server docker rm kw_server - shell: bash - - - - # - name: Upload coverage results - # if: ${{ inputs.server-logs == 'true' && !inputs.pytest-markers }} - # uses: actions/upload-artifact@v4 - # with: - # name: coverage-html - # path: .cov/html - # retention-days: 7 - - # - name: Upload coverage to Codecov - # if: ${{ !inputs.pytest-markers }} - # uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 - # env: - # CODECOV_TOKEN: ${{ inputs.codecov-token }} - # with: - # files: .cov/xml \ No newline at end of file + shell: bash \ No newline at end of file diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 4bef698fd..ef946dafa 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -213,40 +213,37 @@ jobs: - name: Download coverage files uses: actions/download-artifact@v4 with: - name: keywords-coverage,run-coverage,unittests-coverage - path: .cov + # Download all coverage artifacts + pattern: '*-coverage' + path: .cov - name: Combine coverage files run: | - pip install coverage codecov - # Only include files that exist - - files="" - for f in keywords-${{ env.PYTHON_VERSION }} run-${{ env.PYTHON_VERSION }} unittests-${{ env.PYTHON_VERSION }}; do - [ -f "$f" ] && files="$files $f" - done - if [ -z "$files" ]; then - echo "No coverage files found to combine." - exit 1 - fi - coverage combine $files - coverage xml -o .cov/xml - coverage html -d .cov/html - codecov -f .cov/xml -t ${{ env.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports" + pip install coverage codecov + # Find all coverage files in .cov directory + files=$(find .cov -type f -name '*.coverage' -o -name 'coverage*' -o -name '*.xml') + if [ -z "$files" ]; then + echo "No coverage files found to combine." + exit 1 + fi + coverage combine $files + coverage xml -o .cov/xml + coverage html -d .cov/html + codecov -f .cov/xml -t ${{ env.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports" - name: Upload coverage results uses: actions/upload-artifact@v4 with: - name: coverage-html - path: .cov/html - retention-days: 7 + name: coverage-html + path: .cov/html + retention-days: 7 - name: Upload coverage to Codecov uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 env: CODECOV_TOKEN: ${{ env.CODECOV_TOKEN }} with: - files: .cov/xml + files: .cov/xml build-library: name: "Build library" From af1ff538aa820373f1115e62752e6aabadee5423 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 14:01:42 +0200 Subject: [PATCH 30/37] fix: coverage files and results --- .github/workflows/ci_cd_pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index ef946dafa..d3c269290 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -169,6 +169,7 @@ jobs: python-version: ${{ matrix.python-version }} github-token: ${{ secrets.GITHUB_TOKEN }} pytest-markers: keywords + coverage-file: keywords run-testing: name: Test the "run" subpackage From 4c626a56cb7e2523276902e6e470209ed2c9ef03 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 14:33:15 +0200 Subject: [PATCH 31/37] fix: coverage files and results --- .github/actions/unit-test/action.yml | 3 ++- .github/workflows/ci_cd_pr.yml | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index f78f376a3..481cb3fb3 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -45,7 +45,7 @@ inputs: coverage-file: description: Coverage file path required: false - default: ".cov/xml" + default: "" type: string runs: @@ -110,6 +110,7 @@ runs: path: server_output.txt - name: Upload coverage files + if: ${{ inputs.coverage-file }} uses: actions/upload-artifact@v4 with: name: coverage-${{ inputs.coverage-file }}-${{ inputs.python-version }} diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index d3c269290..ef946dafa 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -169,7 +169,6 @@ jobs: python-version: ${{ matrix.python-version }} github-token: ${{ secrets.GITHUB_TOKEN }} pytest-markers: keywords - coverage-file: keywords run-testing: name: Test the "run" subpackage From fcfc2ef5c5a9f0fee9283b25c7663960bea7f427 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 14:37:22 +0200 Subject: [PATCH 32/37] fix: coverage files without keywords --- .github/actions/unit-test/action.yml | 1 - .github/workflows/ci_cd_pr.yml | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index 481cb3fb3..64c4fb787 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -83,7 +83,6 @@ runs: - name: Run pytest run: | - mkdir -p .cov if [ "${{ inputs.pytest-markers }}" = "" ]; then export COVERAGE_FILE=.cov/${{ inputs.coverage-file }} && pytest --cov --cov-report=xml:.cov/xml --cov-report=html:.cov/html else diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index ef946dafa..f4a81a165 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -169,6 +169,7 @@ jobs: python-version: ${{ matrix.python-version }} github-token: ${{ secrets.GITHUB_TOKEN }} pytest-markers: keywords + coverage-file: keywords run-testing: name: Test the "run" subpackage @@ -206,7 +207,7 @@ jobs: upload-coverage: name: "Combine coverage" runs-on: ubuntu-latest - needs: [keyword-testing, run-testing, unit-tests] + needs: [run-testing, unit-tests] steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 From 09f195619c2c4d027899df07c126361bb742df24 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 14:46:16 +0200 Subject: [PATCH 33/37] fix: coverage files without keywords --- .github/workflows/ci_cd_pr.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index f4a81a165..db77bdccb 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -220,17 +220,18 @@ jobs: - name: Combine coverage files run: | - pip install coverage codecov - # Find all coverage files in .cov directory - files=$(find .cov -type f -name '*.coverage' -o -name 'coverage*' -o -name '*.xml') - if [ -z "$files" ]; then - echo "No coverage files found to combine." - exit 1 - fi - coverage combine $files - coverage xml -o .cov/xml - coverage html -d .cov/html - codecov -f .cov/xml -t ${{ env.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports" + pip install coverage codecov + # Ensure .cov directory exists + mkdir -p .cov + files=$(find .cov -type f -name '*.coverage' -o -name 'coverage*' -o -name '*.xml') + if [ -z "$files" ]; then + echo "No coverage files found to combine." + exit 1 + fi + coverage combine $files + coverage xml -o .cov/xml + coverage html -d .cov/html + codecov -f .cov/xml -t ${{ env.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports" - name: Upload coverage results uses: actions/upload-artifact@v4 From 75d57065ded4e2472713104674284e387452351c Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 15:01:05 +0200 Subject: [PATCH 34/37] fix: coverage files without keywords --- .github/actions/unit-test/action.yml | 6 +++--- .github/workflows/ci_cd_pr.yml | 24 +++++++++--------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/actions/unit-test/action.yml b/.github/actions/unit-test/action.yml index 64c4fb787..7a8eca168 100644 --- a/.github/actions/unit-test/action.yml +++ b/.github/actions/unit-test/action.yml @@ -109,11 +109,11 @@ runs: path: server_output.txt - name: Upload coverage files - if: ${{ inputs.coverage-file }} + if: ${{ inputs.coverage-file }} uses: actions/upload-artifact@v4 with: - name: coverage-${{ inputs.coverage-file }}-${{ inputs.python-version }} - path: .cov/xml + name: coverage-${{ inputs.coverage-file }}-${{ inputs.python-version }} + path: coverage.xml - name: Stop container if: ${{ inputs.docker-image != '' && inputs.pytest-markers != 'keywords' }} diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index db77bdccb..24fa225eb 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -214,24 +214,18 @@ jobs: - name: Download coverage files uses: actions/download-artifact@v4 with: - # Download all coverage artifacts - pattern: '*-coverage' - path: .cov + pattern: "coverage-*" + path: .cov - name: Combine coverage files run: | - pip install coverage codecov - # Ensure .cov directory exists - mkdir -p .cov - files=$(find .cov -type f -name '*.coverage' -o -name 'coverage*' -o -name '*.xml') - if [ -z "$files" ]; then - echo "No coverage files found to combine." - exit 1 - fi - coverage combine $files - coverage xml -o .cov/xml - coverage html -d .cov/html - codecov -f .cov/xml -t ${{ env.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports" + pip install coverage codecov + mkdir -p .cov + # Combine all the coverage.xml files from subfolders + coverage combine $(find .cov -name "xml") + coverage xml -o .cov/coverage.xml + coverage html -d .cov/html + codecov -f .cov/coverage.xml -t ${{ env.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports" - name: Upload coverage results uses: actions/upload-artifact@v4 From 9e5b6f9777f0feb084724b720eea5f3ee0eba1f5 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 15:08:04 +0200 Subject: [PATCH 35/37] fix: coverage files without keywords --- .github/workflows/ci_cd_pr.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 24fa225eb..da7e4a7cb 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -220,9 +220,7 @@ jobs: - name: Combine coverage files run: | pip install coverage codecov - mkdir -p .cov - # Combine all the coverage.xml files from subfolders - coverage combine $(find .cov -name "xml") + coverage combine .cov/*/coverage.xml coverage xml -o .cov/coverage.xml coverage html -d .cov/html codecov -f .cov/coverage.xml -t ${{ env.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports" From c1589b0d4bc4f6fe13acb5a7dbcdb8218ebd2687 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 15:11:39 +0200 Subject: [PATCH 36/37] fix: coverage files without keywords --- .github/workflows/ci_cd_pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index da7e4a7cb..152381d53 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -219,6 +219,7 @@ jobs: - name: Combine coverage files run: | + ls -la .cov pip install coverage codecov coverage combine .cov/*/coverage.xml coverage xml -o .cov/coverage.xml From 92bd6733b964e6c36a12c19df7874c53934408ce Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 19 Sep 2025 15:54:07 +0200 Subject: [PATCH 37/37] fix: coverage files --- .github/workflows/ci_cd_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 152381d53..62f53738d 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -219,7 +219,7 @@ jobs: - name: Combine coverage files run: | - ls -la .cov + ls -la pip install coverage codecov coverage combine .cov/*/coverage.xml coverage xml -o .cov/coverage.xml