From 65f5ee37acc390a0ce45bf72fba9f7c584b16560 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 14 Oct 2024 10:18:01 +0200 Subject: [PATCH 1/3] Fix tests.yml doctest run and coverage reporting Signed-off-by: paul.profizi --- .github/workflows/tests.yml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c7a0b53771..0cbb68317c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -203,13 +203,29 @@ jobs: shell: bash run: pip list - - name: "Test Docstrings" - if: (inputs.DOCSTRING == 'true') && !((inputs.test_any == 'true') && (matrix.os == 'ubuntu-latest')) - uses: ansys/pydpf-actions/test_docstrings@v2.3 + - name: "Test API Docstrings" + shell: bash + working-directory: src + run: | + echo "TMP: "$TMP + echo "TEMP: "$TEMP + pytest --doctest-modules $DEBUG --junitxml=junit/test-doctests-results.xml ansys/dpf/core + + - name: "Kill all servers" + uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + + - name: "Upload Docstring Test Results to artifacts" + uses: actions/upload-artifact@v4 with: - MODULE: ${{env.MODULE}} - PACKAGE_NAME: ${{env.PACKAGE_NAME}} - working-directory: src + name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_doctest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }} + path: src/junit/test-doctests-results.xml + + - name: "Upload Docstring coverage to Codecov" + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} # required + name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_doctest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }}.xml + flags: doctest,${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}${{ inputs.test_any == 'true' && ',any' || '' }} - name: "Separate long Core tests" shell: pwsh From d16ce0ce34f265650ce2deb7f990d62e106400a6 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 14 Oct 2024 10:27:28 +0200 Subject: [PATCH 2/3] Restrict to non-retro Signed-off-by: paul.profizi --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0cbb68317c..7941a59566 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -206,6 +206,7 @@ jobs: - name: "Test API Docstrings" shell: bash working-directory: src + if: (inputs.DOCSTRING == 'true') run: | echo "TMP: "$TMP echo "TEMP: "$TEMP @@ -213,15 +214,18 @@ jobs: - name: "Kill all servers" uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + if: (inputs.DOCSTRING == 'true') - name: "Upload Docstring Test Results to artifacts" uses: actions/upload-artifact@v4 + if: (inputs.DOCSTRING == 'true') with: name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_doctest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }} path: src/junit/test-doctests-results.xml - name: "Upload Docstring coverage to Codecov" uses: codecov/codecov-action@v4 + if: (inputs.DOCSTRING == 'true') with: token: ${{ secrets.CODECOV_TOKEN }} # required name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_doctest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }}.xml From c14d594faea50e4c9ce752b1c28d12a23d468960 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 14 Oct 2024 16:44:16 +0200 Subject: [PATCH 3/3] Remove upload to codecov Signed-off-by: paul.profizi --- .github/workflows/tests.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7941a59566..2bfc9e5bf1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -223,14 +223,6 @@ jobs: name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_doctest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }} path: src/junit/test-doctests-results.xml - - name: "Upload Docstring coverage to Codecov" - uses: codecov/codecov-action@v4 - if: (inputs.DOCSTRING == 'true') - with: - token: ${{ secrets.CODECOV_TOKEN }} # required - name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_doctest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }}.xml - flags: doctest,${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}${{ inputs.test_any == 'true' && ',any' || '' }} - - name: "Separate long Core tests" shell: pwsh run: |