diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 11d145c7af..586f3be9a8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -192,202 +192,220 @@ jobs: standalone_suffix: ${{ inputs.standalone_suffix }} ANSYS_VERSION : ${{inputs.ANSYS_VERSION}} - - name: "Check licences of packages" - uses: ansys/pydpf-actions/check-licenses@v2.3 - - - name: "Test import" + - name: "Check DPF installation folder structure" shell: bash run: | - python -m pip install dist/${{ steps.wheel.outputs.wheel_name }} - python -c "from ansys.dpf import core" - - - name: "Prepare Testing Environment" - uses: ansys/pydpf-actions/prepare_tests@v2.3 - with: - DEBUG: true - - # - name: "List installed packages" - # 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 - with: - MODULE: ${{env.MODULE}} - PACKAGE_NAME: ${{env.PACKAGE_NAME}} - working-directory: src + ls dpf-standalone/v${{inputs.ANSYS_VERSION}} + +# - name: "Check licences of packages" +# uses: ansys/pydpf-actions/check-licenses@v2.3 + +# - name: "Test import" +# shell: bash +# run: | +# python -m pip install dist/${{ steps.wheel.outputs.wheel_name }} +# python -c "from ansys.dpf import core" + +# - name: "Prepare Testing Environment" +# uses: ansys/pydpf-actions/prepare_tests@v2.3 +# with: +# DEBUG: true + +# # - name: "List installed packages" +# # 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 +# with: +# MODULE: ${{env.MODULE}} +# PACKAGE_NAME: ${{env.PACKAGE_NAME}} +# working-directory: src - # - name: "Separate long Core tests" - # shell: pwsh - # run: | - # .github\workflows\scripts\separate_long_core_tests.ps1 +# # - name: "Separate long Core tests" +# # shell: pwsh +# # run: | +# # .github\workflows\scripts\separate_long_core_tests.ps1 - # - name: "Set pytest arguments" - # shell: bash - # run: | - # echo "COVERAGE=--cov=ansys.dpf.${{env.MODULE}} --cov-report=xml --cov-report=html --log-level=ERROR --cov-append" >> $GITHUB_ENV - # echo "RERUNS=--reruns 2 --reruns-delay 1" >> $GITHUB_ENV +# # - name: "Set pytest arguments" +# # shell: bash +# # run: | +# # echo "COVERAGE=--cov=ansys.dpf.${{env.MODULE}} --cov-report=xml --cov-report=html --log-level=ERROR --cov-append" >> $GITHUB_ENV +# # echo "RERUNS=--reruns 2 --reruns-delay 1" >> $GITHUB_ENV - # - name: "Set environment variable to allow test targets access DPF server installation" - # shell: bash - # run: | - # echo "VIRTUALENV_SYSTEM_SITE_PACKAGES=true" >> $GITHUB_ENV +# - name: "Set environment variable to allow test targets access DPF server installation" +# shell: bash +# run: | +# echo "ANSYS_DPF_PATH=dpf-standalone/v${{inputs.ANSYS_VERSION}}" >> $GITHUB_ENV +# # echo "VIRTUALENV_SYSTEM_SITE_PACKAGES=true" >> $GITHUB_ENV - - name: "Organize test files" - shell: bash - run: | - tox -e pretest,kill-servers +# - name: "Organize test files" +# shell: bash +# run: | +# tox -e pretest,kill-servers - # - name: "Run pytest targets sequentially at once" - # shell: bash - # run: | - # tox --installpkg dist/ansys_dpf_core* -x testenv.pass_env+=VIRTUALENV_SYSTEM_SITE_PACKAGES - - - name: "Test API" - shell: bash - run: | - tox -e test-api --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-api.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test API test_launcher" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 2 - max_attempts: 2 - shell: bash - command: | - tox -e test-launcher --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-launcher.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test API test_server" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 5 - max_attempts: 2 - shell: bash - command: | - tox -e test-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-server.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test API test_local_server" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 2 - max_attempts: 2 - shell: bash - command: | - tox -e test-local_server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-local_server.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test API test_multi_server" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 5 - max_attempts: 2 - shell: bash - command: | - tox -e test-multi_server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-multi_server.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test API test_remote_workflow" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 4 - max_attempts: 3 - shell: bash - command: | - tox -e test-remote_workflow --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-remote_workflow.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test API test_remote_operator" - shell: bash - working-directory: test_remote_operator - run: | - tox -e test-remote_operator --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-remote_operator.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test API test_workflow" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 3 - max_attempts: 4 - retry_wait_seconds: 15 - shell: bash - command: | - tox -e test-workflow --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-workflow.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test API test_service" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 3 - max_attempts: 2 - shell: bash - command: | - tox -e test-service --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-service.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test API Entry" - shell: bash - run: | - tox -e test-api_entry --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-api_entry.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - timeout-minutes: 30 - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test API test_custom_type_field" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 2 - max_attempts: 2 - shell: bash - command: | - tox -e test-custom_type_field --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-custom_type_field.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test Operators" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 2 - max_attempts: 2 - shell: bash - command: | - tox -e test-operators --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-operators.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Upload Test Results" - uses: actions/upload-artifact@v4 - with: - name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }} - path: tests/junit/test-results.xml - - - name: "Upload coverage to Codecov" - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} # required - name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }}.xml - flags: ${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}${{ inputs.test_any == 'true' && ',any' || '' }} +# # - name: "Run pytest targets sequentially at once" +# # shell: bash +# # run: | +# # tox --installpkg dist/ansys_dpf_core* -x testenv.pass_env+=VIRTUALENV_SYSTEM_SITE_PACKAGES + +# - name: "Test API" +# shell: bash +# run: | +# tox -e test-api --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-api --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-api.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Test API test_launcher" +# uses: nick-fields/retry@v3 +# with: +# timeout_minutes: 2 +# max_attempts: 2 +# shell: bash +# command: | +# tox -e test-launcher --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-launcher --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-launcher.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Test API test_server" +# uses: nick-fields/retry@v3 +# with: +# timeout_minutes: 5 +# max_attempts: 2 +# shell: bash +# command: | +# tox -e test-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-server.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Test API test_local_server" +# uses: nick-fields/retry@v3 +# with: +# timeout_minutes: 2 +# max_attempts: 2 +# shell: bash +# command: | +# tox -e test-local_server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-local_server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-local_server.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Test API test_multi_server" +# uses: nick-fields/retry@v3 +# with: +# timeout_minutes: 5 +# max_attempts: 2 +# shell: bash +# command: | +# tox -e test-multi_server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-multi_server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-multi_server.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Test API test_remote_workflow" +# uses: nick-fields/retry@v3 +# with: +# timeout_minutes: 4 +# max_attempts: 3 +# shell: bash +# command: | +# tox -e test-remote_workflow --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-remote_workflow --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-remote_workflow.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Test API test_remote_operator" +# shell: bash +# working-directory: test_remote_operator +# run: | +# tox -e test-remote_operator --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-remote_operator --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-remote_operator.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Test API test_workflow" +# uses: nick-fields/retry@v3 +# with: +# timeout_minutes: 3 +# max_attempts: 4 +# retry_wait_seconds: 15 +# shell: bash +# command: | +# tox -e test-workflow --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-workflow --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-workflow.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Test API test_service" +# uses: nick-fields/retry@v3 +# with: +# timeout_minutes: 3 +# max_attempts: 2 +# shell: bash +# command: | +# tox -e test-service --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-service --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-service.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Test API Entry" +# shell: bash +# run: | +# tox -e test-api_entry --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-api_entry --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-api_entry.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' +# timeout-minutes: 30 + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Test API test_custom_type_field" +# uses: nick-fields/retry@v3 +# with: +# timeout_minutes: 2 +# max_attempts: 2 +# shell: bash +# command: | +# tox -e test-custom_type_field --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-custom_type_field --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-custom_type_field.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Test Operators" +# uses: nick-fields/retry@v3 +# with: +# timeout_minutes: 2 +# max_attempts: 2 +# shell: bash +# command: | +# tox -e test-operators --installpkg dist/${{ steps.wheel.outputs.wheel_name }} +# # tox -e test-operators --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:test-operators.deps+='dpf-standalone/v${{inputs.ANSYS_VERSION}}' + +# # - name: "Kill all servers" +# # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + +# - name: "Upload Test Results" +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }} +# path: tests/junit/test-results.xml + +# - name: "Upload coverage to Codecov" +# uses: codecov/codecov-action@v4 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} # required +# name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }}.xml +# flags: ${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}${{ inputs.test_any == 'true' && ',any' || '' }}