From 11aa6715d63bcce3fe4a179f174c72255a78bd7e Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 22 Jan 2025 14:35:26 +0100 Subject: [PATCH 01/59] feat: documentation building --- .github/workflows/docs.yml | 121 ++++++++++++++++++------------------- tox.ini | 6 ++ 2 files changed, 65 insertions(+), 62 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c1fab71c7d..bce355d487 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -73,34 +73,29 @@ jobs: with: python-version: ${{ inputs.python_version }} - - name: "Create virtual environment in the current workspace" - shell: pwsh - run: python -m venv .venv --system-site-packages + # - name: "Create virtual environment in the current workspace" + # shell: pwsh + # run: python -m venv .venv --system-site-packages - - name: "Update PATH for virtual environment" - run: | - echo "${{ github.workspace }}\.venv\Scripts" >> $env:GITHUB_PATH + # - name: "Update PATH for virtual environment" + # run: | + # echo "${{ github.workspace }}\.venv\Scripts" >> $env:GITHUB_PATH - - name: "Update pip to the latest version" + - name: "Update pip to the latest version and install tox" shell: pwsh run: | python -m pip install -U pip + python -m pip install tox - - name: "Install requirements" - shell: pwsh - run: | - python -m pip install -r requirements/requirements_build.txt + # - name: "Install requirements" + # shell: pwsh + # run: | + # python -m pip install -r requirements/requirements_build.txt - name: "Build the wheel" shell: pwsh run: | - $os = "${{ matrix.os }}" - if ($os -eq "ubuntu-latest") { - $platform = "manylinux_2_17" - } else { - $platform = "win" - } - python .ci/build_wheel.py -p $platform -w + tox -e build-wheel -- win - name: "Expose the wheel" shell: bash @@ -111,10 +106,10 @@ jobs: echo ${name} echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT - - name: "Install package wheel" - shell: pwsh - run: | - python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] + # - name: "Install package wheel" + # shell: bash + # run: | + # python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] - name: "Install DPF" id: set-server-path @@ -131,6 +126,7 @@ jobs: shell: pwsh working-directory: tests run: | + python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] python -c "from ansys.dpf import core" - name: "Setup headless display" @@ -143,53 +139,54 @@ jobs: run: | choco install pandoc - - name: "Install documentation packages for Python" - shell: pwsh - run: | - python -m pip install -r requirements/requirements_docs.txt + # - name: "Install documentation packages for Python" + # shell: pwsh + # run: | + # python -m pip install -r requirements/requirements_docs.txt - - name: "Kill all servers" - uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + # - name: "Kill all servers" + # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - name: "Ensure VTK compatibility" - shell: pwsh - run: | - python -m pip uninstall --yes vtk - python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==${{ env.VTK_OSMESA_VERSION }} + # - name: "Ensure VTK compatibility" + # shell: pwsh + # run: | + # python -m pip uninstall --yes vtk + # python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==${{ env.VTK_OSMESA_VERSION }} - - name: "List installed packages" - shell: pwsh - run: | - python -m pip list + # - name: "List installed packages" + # shell: pwsh + # run: | + # python -m pip list - name: "Build HTML Documentation" - shell: cmd /D /E:ON /V:OFF /C "CALL "{0}"" - working-directory: .ci - run: | - build_doc.bat > ..\doc\log.txt && type ..\doc\log.txt 2>&1 - timeout-minutes: 60 - env: - MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} - - - name: "Check for success" + # shell: cmd /D /E:ON /V:OFF /C "CALL "{0}"" + # working-directory: .ci shell: bash - working-directory: doc run: | - case `grep -F "build succeeded" log.txt >/dev/null; echo $?` in - 0) - echo "Build succeeded!" - exit 0;; - 1) - echo "Documentation generation failed, please check previous step!" - exit 1;; - *) - echo "An error occurred while checking success of the previous step!" - exit 1;; - esac - - - name: "Kill all servers" - uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - if: always() + tox -e doc-html --installpkg dist/ansys_dpf_core* + # timeout-minutes: 60 + # env: + # MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} + + # - name: "Check for success" + # shell: bash + # working-directory: doc + # run: | + # case `grep -F "build succeeded" log.txt >/dev/null; echo $?` in + # 0) + # echo "Build succeeded!" + # exit 0;; + # 1) + # echo "Documentation generation failed, please check previous step!" + # exit 1;; + # *) + # echo "An error occurred while checking success of the previous step!" + # exit 1;; + # esac + + # - name: "Kill all servers" + # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + # if: always() - name: "Retrieve package version" shell: bash diff --git a/tox.ini b/tox.ini index efaa78ea11..173f7a5fd0 100644 --- a/tox.ini +++ b/tox.ini @@ -122,6 +122,9 @@ setenv = skip_install = clean: True +extras = + html: plotting + deps = links,html: -r requirements/requirements_docs.txt @@ -173,5 +176,8 @@ description = Environment for custom build of package wheels skip_install = True +deps = + -r requirements/requirements_build.txt + commands = python .ci/build_wheel.py -p {posargs:{on_platform}} -w From 2d7b82b71efa2305d50eb338f4662c5387dad624 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 22 Jan 2025 14:56:37 +0100 Subject: [PATCH 02/59] ci: test import fix --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bce355d487..6a243cd7e6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -123,8 +123,8 @@ jobs: uses: ansys/pydpf-actions/check-licenses@v2.3 - name: "Test import" - shell: pwsh - working-directory: tests + shell: bash + # working-directory: tests run: | python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] python -c "from ansys.dpf import core" From a47dc7cfb7be530eaa9990bdea07086ceddad1ae Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 22 Jan 2025 15:16:42 +0100 Subject: [PATCH 03/59] ci: add more environment variables --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 173f7a5fd0..49eebb6200 100644 --- a/tox.ini +++ b/tox.ini @@ -26,6 +26,8 @@ pass_env = ANSYS_DPF_ACCEPT_LA ANSYSLMD_LICENSE_FILE AWP_ROOT242 + AWP_ROOT251 + AWP_ROOT252 [testenv:pretest] description = Environment to kill servers and organize test files prior to testing From bc92ba7c0d1f46eb401a15ac438c304072336443 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 22 Jan 2025 16:31:28 +0100 Subject: [PATCH 04/59] ci: test fix --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6a243cd7e6..5d5ccc2731 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -163,7 +163,7 @@ jobs: # working-directory: .ci shell: bash run: | - tox -e doc-html --installpkg dist/ansys_dpf_core* + tox -e doc-html --installpkg dist/ansys_dpf_core* -x testenv:doc-html.pass_env+=VIRTUALENV_SYSTEM_SITE_PACKAGES # timeout-minutes: 60 # env: # MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} From bb17635d0dc2a1e30c25ef142c499912748cee0c Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 22 Jan 2025 16:41:59 +0100 Subject: [PATCH 05/59] ci: test fix --- .github/workflows/docs.yml | 2 +- tox.ini | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5d5ccc2731..6a243cd7e6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -163,7 +163,7 @@ jobs: # working-directory: .ci shell: bash run: | - tox -e doc-html --installpkg dist/ansys_dpf_core* -x testenv:doc-html.pass_env+=VIRTUALENV_SYSTEM_SITE_PACKAGES + tox -e doc-html --installpkg dist/ansys_dpf_core* # timeout-minutes: 60 # env: # MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} diff --git a/tox.ini b/tox.ini index 49eebb6200..7b3a41f81d 100644 --- a/tox.ini +++ b/tox.ini @@ -26,8 +26,7 @@ pass_env = ANSYS_DPF_ACCEPT_LA ANSYSLMD_LICENSE_FILE AWP_ROOT242 - AWP_ROOT251 - AWP_ROOT252 + VIRTUALENV_SYSTEM_SITE_PACKAGES [testenv:pretest] description = Environment to kill servers and organize test files prior to testing From ac8dc8f849f14418c105e591f1b44b28014f84a5 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 22 Jan 2025 17:09:53 +0100 Subject: [PATCH 06/59] ci: test fix --- .github/workflows/docs.yml | 1 + tox.ini | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6a243cd7e6..0e960d30fc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -45,6 +45,7 @@ env: PACKAGE_NAME: ansys-dpf-core MODULE: core VTK_OSMESA_VERSION: "9.2.20230527.dev0" + MODE: LEGACY jobs: doc-style: name: "Check doc style" diff --git a/tox.ini b/tox.ini index 7b3a41f81d..beeb771d6c 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,9 @@ pass_env = ANSYS_DPF_ACCEPT_LA ANSYSLMD_LICENSE_FILE AWP_ROOT242 - VIRTUALENV_SYSTEM_SITE_PACKAGES + AWP_ROOT251 + AWP_ROOT252 + [testenv:pretest] description = Environment to kill servers and organize test files prior to testing From 7e3e4196fdf53164215024745232081e2fd0c352 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Thu, 23 Jan 2025 15:53:09 +0100 Subject: [PATCH 07/59] ci: test fix --- .github/workflows/docs.yml | 3 +-- tox.ini | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0e960d30fc..7b5489db88 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -45,7 +45,6 @@ env: PACKAGE_NAME: ansys-dpf-core MODULE: core VTK_OSMESA_VERSION: "9.2.20230527.dev0" - MODE: LEGACY jobs: doc-style: name: "Check doc style" @@ -164,7 +163,7 @@ jobs: # working-directory: .ci shell: bash run: | - tox -e doc-html --installpkg dist/ansys_dpf_core* + tox -e doc-html --installpkg dist/ansys_dpf_core* -x testenv:doc-html.setenv+='VIRTUALENV_SYSTEM_SITE_PACKAGES=true' # timeout-minutes: 60 # env: # MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} diff --git a/tox.ini b/tox.ini index beeb771d6c..eb7cbce426 100644 --- a/tox.ini +++ b/tox.ini @@ -25,10 +25,7 @@ pass_env = MODULE ANSYS_DPF_ACCEPT_LA ANSYSLMD_LICENSE_FILE - AWP_ROOT242 - AWP_ROOT251 - AWP_ROOT252 - + AWP_ROOT* [testenv:pretest] description = Environment to kill servers and organize test files prior to testing From 8cb38dd79b83342dffb416a5989b7bb49c54868e Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 24 Jan 2025 12:06:41 +0100 Subject: [PATCH 08/59] ci: doc.yml updated --- .github/workflows/docs.yml | 68 +--------------------------------- doc/source/conf.py | 2 + src/ansys/dpf/core/misc.py | 18 ++++----- src/ansys/dpf/gate/load_api.py | 6 +-- tox.ini | 1 + 5 files changed, 17 insertions(+), 78 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7b5489db88..836454452a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -73,29 +73,16 @@ jobs: with: python-version: ${{ inputs.python_version }} - # - name: "Create virtual environment in the current workspace" - # shell: pwsh - # run: python -m venv .venv --system-site-packages - - # - name: "Update PATH for virtual environment" - # run: | - # echo "${{ github.workspace }}\.venv\Scripts" >> $env:GITHUB_PATH - - name: "Update pip to the latest version and install tox" shell: pwsh run: | python -m pip install -U pip python -m pip install tox - # - name: "Install requirements" - # shell: pwsh - # run: | - # python -m pip install -r requirements/requirements_build.txt - - name: "Build the wheel" shell: pwsh run: | - tox -e build-wheel -- win + tox -e build-wheel - name: "Expose the wheel" shell: bash @@ -106,11 +93,6 @@ jobs: echo ${name} echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT - # - name: "Install package wheel" - # shell: bash - # run: | - # python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] - - name: "Install DPF" id: set-server-path uses: ansys/pydpf-actions/install-dpf-server@v2.3 @@ -124,9 +106,8 @@ jobs: - name: "Test import" shell: bash - # working-directory: tests run: | - python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] + python -m pip install dist/${{ steps.wheel.outputs.wheel_name }} python -c "from ansys.dpf import core" - name: "Setup headless display" @@ -139,54 +120,9 @@ jobs: run: | choco install pandoc - # - name: "Install documentation packages for Python" - # shell: pwsh - # run: | - # python -m pip install -r requirements/requirements_docs.txt - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - # - name: "Ensure VTK compatibility" - # shell: pwsh - # run: | - # python -m pip uninstall --yes vtk - # python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==${{ env.VTK_OSMESA_VERSION }} - - # - name: "List installed packages" - # shell: pwsh - # run: | - # python -m pip list - - name: "Build HTML Documentation" - # shell: cmd /D /E:ON /V:OFF /C "CALL "{0}"" - # working-directory: .ci - shell: bash run: | tox -e doc-html --installpkg dist/ansys_dpf_core* -x testenv:doc-html.setenv+='VIRTUALENV_SYSTEM_SITE_PACKAGES=true' - # timeout-minutes: 60 - # env: - # MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} - - # - name: "Check for success" - # shell: bash - # working-directory: doc - # run: | - # case `grep -F "build succeeded" log.txt >/dev/null; echo $?` in - # 0) - # echo "Build succeeded!" - # exit 0;; - # 1) - # echo "Documentation generation failed, please check previous step!" - # exit 1;; - # *) - # echo "An error occurred while checking success of the previous step!" - # exit 1;; - # esac - - # - name: "Kill all servers" - # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - # if: always() - name: "Retrieve package version" shell: bash diff --git a/doc/source/conf.py b/doc/source/conf.py index 40622c67f3..4329ef94e4 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -62,6 +62,8 @@ ignored_pattern += f"|{example_name}" ignored_pattern += "|11-server_types.py" ignored_pattern += "|06-distributed_stress_averaging.py" +# ignored_pattern += "|02-python_operators_with_dependencies.py" +ignored_pattern += "|00-fluids_model.py" ignored_pattern += r")" # Autoapi ignore pattern diff --git a/src/ansys/dpf/core/misc.py b/src/ansys/dpf/core/misc.py index 13ccee9d62..325f006a05 100644 --- a/src/ansys/dpf/core/misc.py +++ b/src/ansys/dpf/core/misc.py @@ -174,15 +174,15 @@ def find_ansys(): if latest_install: return latest_install - base_path = None - if os.name == "nt": - base_path = Path(os.environ["PROGRAMFILES"]) / "ANSYS INC" - elif os.name == "posix": - for path in [Path("/usr/ansys_inc"), Path("/ansys_inc")]: - if path.is_dir(): - base_path = path - else: - raise OSError(f"Unsupported OS {os.name}") + # base_path = None + # if os.name == "nt": + # base_path = Path(os.environ["PROGRAMFILES"]) / "ANSYS INC" + # elif os.name == "posix": + # for path in [Path("/usr/ansys_inc"), Path("/ansys_inc")]: + # if path.is_dir(): + # base_path = path + # else: + # raise OSError(f"Unsupported OS {os.name}") if base_path is None: return base_path diff --git a/src/ansys/dpf/gate/load_api.py b/src/ansys/dpf/gate/load_api.py index bbaf1ee251..d15f058324 100644 --- a/src/ansys/dpf/gate/load_api.py +++ b/src/ansys/dpf/gate/load_api.py @@ -72,9 +72,9 @@ def _find_latest_ansys_versions(): if len(path_per_version) > 0: return path_per_version[sorted(path_per_version)[-1]] # If none was found, find the path to the latest local ANSYS install - path_per_version = _paths_to_dpf_in_unified_installs() - if len(path_per_version) > 0: - return path_per_version[sorted(path_per_version)[-1]] + # path_per_version = _paths_to_dpf_in_unified_installs() + # if len(path_per_version) > 0: + # return path_per_version[sorted(path_per_version)[-1]] def _paths_to_dpf_server_library_installs() -> dict: diff --git a/tox.ini b/tox.ini index eb7cbce426..31623f5b6e 100644 --- a/tox.ini +++ b/tox.ini @@ -26,6 +26,7 @@ pass_env = ANSYS_DPF_ACCEPT_LA ANSYSLMD_LICENSE_FILE AWP_ROOT* + ANSYS_DPF_PATH [testenv:pretest] description = Environment to kill servers and organize test files prior to testing From bde31f865395dee7da5f86ea27e93226220460fb Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 24 Jan 2025 12:19:00 +0100 Subject: [PATCH 09/59] ci: fix docs.yml --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 836454452a..0a6d319d0d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -121,6 +121,7 @@ jobs: choco install pandoc - name: "Build HTML Documentation" + shell: bash run: | tox -e doc-html --installpkg dist/ansys_dpf_core* -x testenv:doc-html.setenv+='VIRTUALENV_SYSTEM_SITE_PACKAGES=true' From 6c010c69c854223bf7600db0017f405f06342bd2 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 24 Jan 2025 13:31:42 +0100 Subject: [PATCH 10/59] ci: tests.yml update --- .github/workflows/tests.yml | 348 +++++++++++++++++---------------- doc/source/conf.py | 2 - src/ansys/dpf/core/misc.py | 18 +- src/ansys/dpf/gate/load_api.py | 6 +- tox.ini | 10 +- 5 files changed, 201 insertions(+), 183 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1a4b7ce5b9..b70d9ace00 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,15 +15,15 @@ on: wheel: required: false type: string - default: false + default: 'false' wheelhouse: required: false type: string - default: false + default: 'false' DOCSTRING: required: false type: string - default: true + default: 'true' standalone_suffix: description: "Suffix of the branch on standalone" required: false @@ -33,7 +33,7 @@ on: description: "Test the any version of the wheel" required: false type: string - default: false + default: 'false' # Can be called manually workflow_dispatch: inputs: @@ -114,8 +114,14 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: "Install requirements" - run: pip install -r requirements/requirements_build.txt + - name: "Update pip to the latest version and install tox" + shell: pwsh + run: | + python -m pip install -U pip + python -m pip install tox + + # - name: "Install requirements" + # run: pip install -r requirements/requirements_build.txt - name: "Build the wheel" shell: bash @@ -127,7 +133,7 @@ jobs: else export platform="win" fi - python .ci/build_wheel.py -p $platform -w + tox -e build-wheel -- $platform - name: "Expose the wheel" shell: bash @@ -173,10 +179,10 @@ jobs: path: ${{ steps.wheelhouse.outputs.name }} retention-days: 7 - - name: "Install package wheel" - shell: bash - run: | - pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] + # - name: "Install package wheel" + # shell: bash + # run: | + # pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] - name: "Install DPF" id: set-server-path @@ -191,17 +197,21 @@ jobs: - name: "Test import" shell: bash - working-directory: tests - run: python -c "from ansys.dpf import core" + 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: "Prepare Testing Environment" + # uses: ansys/pydpf-actions/prepare_tests@v2.3 + # with: + # DEBUG: true - - name: "List installed packages" - shell: bash - run: pip list + # - name: "List installed packages" + # shell: bash + # run: pip list + + - name: "Setup headless display" + uses: pyvista/setup-headless-display-action@v3 - name: "Test Docstrings" if: (inputs.DOCSTRING == 'true') && !((inputs.test_any == 'true') && (matrix.os == 'ubuntu-latest')) @@ -211,154 +221,160 @@ jobs: 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: "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: "Test API" - shell: bash - working-directory: tests - run: | - pytest $DEBUG $COVERAGE $RERUNS --junitxml=junit/test-results.xml . - - - 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: | - pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results2.xml test_launcher/. - - - 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: | - pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results3.xml test_server/. - - - 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: | - pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results4.xml test_local_server/. - - - 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: | - pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results5.xml test_multi_server/. - - - 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: | - pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results6.xml test_remote_workflow/. - - - 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: | - pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results7.xml . - - - 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: | - pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results8.xml test_workflow/. - - - 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: | - pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results9.xml test_service/. - - - name: "Kill all servers" - uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - - - name: "Test API Entry" + - name: "Run pytest targets sequentially" shell: bash - working-directory: tests run: | - cd entry - pytest $DEBUG $COVERAGE $RERUNS --junitxml=../junit/test-results10.xml . - 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: | - pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results11.xml test_custom_type_field/. - - - 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: | - pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results12.xml tests/operators/. - - - name: "Kill all servers" - uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + echo "VIRTUALENV_SYSTEM_SITE_PACKAGES=true" >> $GITHUB_ENV + tox -x testenv.pass_env+=VIRTUALENV_SYSTEM_SITE_PACKAGES + + # - 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: "Test API" + # shell: bash + # working-directory: tests + # run: | + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=junit/test-results.xml . + + # - 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: | + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results2.xml test_launcher/. + + # - 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: | + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results3.xml test_server/. + + # - 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: | + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results4.xml test_local_server/. + + # - 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: | + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results5.xml test_multi_server/. + + # - 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: | + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results6.xml test_remote_workflow/. + + # - 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: | + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results7.xml . + + # - 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: | + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results8.xml test_workflow/. + + # - 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: | + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results9.xml test_service/. + + # - name: "Kill all servers" + # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 + + # - name: "Test API Entry" + # shell: bash + # working-directory: tests + # run: | + # cd entry + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../junit/test-results10.xml . + # 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: | + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results11.xml test_custom_type_field/. + + # - 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: | + # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results12.xml tests/operators/. + + # - name: "Kill all servers" + # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - name: "Upload Test Results" uses: actions/upload-artifact@v4 diff --git a/doc/source/conf.py b/doc/source/conf.py index 4329ef94e4..40622c67f3 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -62,8 +62,6 @@ ignored_pattern += f"|{example_name}" ignored_pattern += "|11-server_types.py" ignored_pattern += "|06-distributed_stress_averaging.py" -# ignored_pattern += "|02-python_operators_with_dependencies.py" -ignored_pattern += "|00-fluids_model.py" ignored_pattern += r")" # Autoapi ignore pattern diff --git a/src/ansys/dpf/core/misc.py b/src/ansys/dpf/core/misc.py index 325f006a05..13ccee9d62 100644 --- a/src/ansys/dpf/core/misc.py +++ b/src/ansys/dpf/core/misc.py @@ -174,15 +174,15 @@ def find_ansys(): if latest_install: return latest_install - # base_path = None - # if os.name == "nt": - # base_path = Path(os.environ["PROGRAMFILES"]) / "ANSYS INC" - # elif os.name == "posix": - # for path in [Path("/usr/ansys_inc"), Path("/ansys_inc")]: - # if path.is_dir(): - # base_path = path - # else: - # raise OSError(f"Unsupported OS {os.name}") + base_path = None + if os.name == "nt": + base_path = Path(os.environ["PROGRAMFILES"]) / "ANSYS INC" + elif os.name == "posix": + for path in [Path("/usr/ansys_inc"), Path("/ansys_inc")]: + if path.is_dir(): + base_path = path + else: + raise OSError(f"Unsupported OS {os.name}") if base_path is None: return base_path diff --git a/src/ansys/dpf/gate/load_api.py b/src/ansys/dpf/gate/load_api.py index d15f058324..bbaf1ee251 100644 --- a/src/ansys/dpf/gate/load_api.py +++ b/src/ansys/dpf/gate/load_api.py @@ -72,9 +72,9 @@ def _find_latest_ansys_versions(): if len(path_per_version) > 0: return path_per_version[sorted(path_per_version)[-1]] # If none was found, find the path to the latest local ANSYS install - # path_per_version = _paths_to_dpf_in_unified_installs() - # if len(path_per_version) > 0: - # return path_per_version[sorted(path_per_version)[-1]] + path_per_version = _paths_to_dpf_in_unified_installs() + if len(path_per_version) > 0: + return path_per_version[sorted(path_per_version)[-1]] def _paths_to_dpf_server_library_installs() -> dict: diff --git a/tox.ini b/tox.ini index 31623f5b6e..287a6322be 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ [tox] description = Default tox environment list and core configurations -envlist = pretest,test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,operators},posttest +envlist = pretest,test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators},posttest isolated_build_env = build @@ -51,7 +51,7 @@ commands = [testenv:posttest] description = Environment to kill servers and revert test files to original state after testing -depends = pretest, test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,operators} +depends = pretest, test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators} deps = psutil @@ -70,7 +70,7 @@ commands = python -c "import psutil; proc_name = 'Ans.Dpf.Grpc'; nb_procs = len([proc.kill() for proc in psutil.process_iter() if proc_name in proc.name()]); \ print(f'Killed \{nb_procs} \{proc_name} processes.')" -[testenv:test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,operators}] +[testenv:test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators}] description = Environment where project testing configuration is defined depends = pretest @@ -90,6 +90,8 @@ setenv = remote_operator: JUNITXML = --junitxml=tests/junit/test-results7.xml workflow: JUNITXML = --junitxml=tests/junit/test-results8.xml service: JUNITXML = --junitxml=tests/junit/test-results9.xml + api_entry: JUNITXML = --junitxml=../junit/test-results10.xml + custom_type_field: = --junitxml=../tests/junit/test-results11.xml operators: JUNITXML = --junitxml=../tests/junit/test-results12.xml # Tests sets @@ -102,6 +104,8 @@ setenv = remote_operator: PYTEST_PYTHON_FILES = test_remote_operator workflow: PYTEST_PYTHON_FILES = test_workflow service: PYTEST_PYTHON_FILES = test_service + api_entry: PYTEST_PYTHON_FILES = tests/entry + custom_type_field: PYTEST_PYTHON_FILES = test_custom_type_field operators: PYTEST_PYTHON_FILES = tests/operators deps = From d595c7546492d5aae42724c31f48491aad884d63 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 24 Jan 2025 14:37:37 +0100 Subject: [PATCH 11/59] ci: test another fix --- .github/workflows/tests.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b70d9ace00..d06e7910f3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -201,18 +201,15 @@ jobs: 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: "Prepare Testing Environment" + uses: ansys/pydpf-actions/prepare_tests@v2.3 + with: + DEBUG: true # - name: "List installed packages" # shell: bash # run: pip list - - name: "Setup headless display" - uses: pyvista/setup-headless-display-action@v3 - - name: "Test Docstrings" if: (inputs.DOCSTRING == 'true') && !((inputs.test_any == 'true') && (matrix.os == 'ubuntu-latest')) uses: ansys/pydpf-actions/test_docstrings@v2.3 @@ -221,10 +218,14 @@ jobs: PACKAGE_NAME: ${{env.PACKAGE_NAME}} working-directory: src - - name: "Run pytest targets sequentially" + - name: "Set environment variable to pass to tox targets" shell: bash run: | echo "VIRTUALENV_SYSTEM_SITE_PACKAGES=true" >> $GITHUB_ENV + + - name: "Run pytest targets sequentially" + shell: bash + run: | tox -x testenv.pass_env+=VIRTUALENV_SYSTEM_SITE_PACKAGES # - name: "Separate long Core tests" From b57210487820085d1fd1ec0709469bd73e9df3bd Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 24 Jan 2025 14:50:36 +0100 Subject: [PATCH 12/59] ci: test another fix --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 287a6322be..052b4f1623 100644 --- a/tox.ini +++ b/tox.ini @@ -112,7 +112,7 @@ deps = -r requirements/requirements_test.txt commands = - pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} + python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} [testenv:doc-{clean,links,html}] description = Environment for documentation generation @@ -162,7 +162,7 @@ commands = html: [shutil.rmtree(p) for p in ['{env:SOURCE_DIR}/_temp'] if exists(p)]" # Build documentation - html,links: sphinx-build -b {env:BUILDER} {env:SOURCE_DIR} {env:BUILD_DIR}/{env:BUILDER} {env:BUILDER_OPTS} + html,links: {env_bin_dir}/sphinx-build -b {env:BUILDER} {env:SOURCE_DIR} {env:BUILD_DIR}/{env:BUILDER} {env:BUILDER_OPTS} # Patch pyVista issue with elemental plots by copying necessary images html: python -c "\ From 71a8b8468156846dea12798d11a508e828fe1557 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 24 Jan 2025 16:50:58 +0100 Subject: [PATCH 13/59] ci: little optimization and separating tests --- .github/workflows/docs.yml | 2 +- .github/workflows/tests.yml | 204 ++++++++++++++++++------------------ tox.ini | 50 +++++---- 3 files changed, 128 insertions(+), 128 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0a6d319d0d..3ee19d9f69 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -123,7 +123,7 @@ jobs: - name: "Build HTML Documentation" shell: bash run: | - tox -e doc-html --installpkg dist/ansys_dpf_core* -x testenv:doc-html.setenv+='VIRTUALENV_SYSTEM_SITE_PACKAGES=true' + tox -e doc-html --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:doc-html.setenv+='VIRTUALENV_SYSTEM_SITE_PACKAGES=true' - name: "Retrieve package version" shell: bash diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d06e7910f3..679ca390b3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -217,162 +217,164 @@ jobs: MODULE: ${{env.MODULE}} PACKAGE_NAME: ${{env.PACKAGE_NAME}} working-directory: src - - - name: "Set environment variable to pass to tox targets" - shell: bash - run: | - echo "VIRTUALENV_SYSTEM_SITE_PACKAGES=true" >> $GITHUB_ENV - - - name: "Run pytest targets sequentially" - shell: bash - run: | - tox -x testenv.pass_env+=VIRTUALENV_SYSTEM_SITE_PACKAGES - + # - 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: "Test API" + + - name: "Set environment variable to allow test targets access DPF server installation" + shell: bash + run: | + echo "VIRTUALENV_SYSTEM_SITE_PACKAGES=true" >> $GITHUB_ENV + + - name: "Organize test files" + shell: bash + run: | + tox -e pretest,kill-servers + + # - name: "Run pytest targets sequentially at once" # shell: bash - # working-directory: tests # run: | - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=junit/test-results.xml . + # tox --installpkg dist/ansys_dpf_core* -x testenv.pass_env+=VIRTUALENV_SYSTEM_SITE_PACKAGES + + - name: "Test API" + shell: bash + run: | + tox -e test-api,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} # - 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: | - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results2.xml test_launcher/. + - name: "Test API test_launcher" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 2 + max_attempts: 2 + shell: bash + command: | + tox -e test-launcher,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} # - 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: | - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results3.xml test_server/. + - name: "Test API test_server" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 5 + max_attempts: 2 + shell: bash + command: | + tox -e test-server,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} # - 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: | - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results4.xml test_local_server/. + - 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,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} # - 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: | - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results5.xml test_multi_server/. + - 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,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} # - 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: | - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results6.xml test_remote_workflow/. + - 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,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} # - 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: | - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results7.xml . + - name: "Test API test_remote_operator" + shell: bash + working-directory: test_remote_operator + run: | + tox -e test-remote_operator,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} # - 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: | - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results8.xml test_workflow/. + - 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,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} # - 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: | - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results9.xml test_service/. + - name: "Test API test_service" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 3 + max_attempts: 2 + shell: bash + command: | + tox -e test-service,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} # - name: "Kill all servers" # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - # - name: "Test API Entry" - # shell: bash - # working-directory: tests - # run: | - # cd entry - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../junit/test-results10.xml . - # timeout-minutes: 30 + - name: "Test API Entry" + shell: bash + run: | + tox -e test-api_entry,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + 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: | - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results11.xml test_custom_type_field/. + - 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,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} # - 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: | - # pytest $DEBUG $COVERAGE $RERUNS --junitxml=../tests/junit/test-results12.xml tests/operators/. + - name: "Test Operators" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 2 + max_attempts: 2 + shell: bash + command: | + tox -e test-operators,kill-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} # - name: "Kill all servers" # uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 diff --git a/tox.ini b/tox.ini index 052b4f1623..4116124edc 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ [tox] description = Default tox environment list and core configurations -envlist = pretest,test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators},posttest +envlist = pretest,test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators},posttest,kill-servers isolated_build_env = build @@ -27,9 +27,23 @@ pass_env = ANSYSLMD_LICENSE_FILE AWP_ROOT* ANSYS_DPF_PATH + VIRTUALENV_SYSTEM_SITE_PACKAGES -[testenv:pretest] -description = Environment to kill servers and organize test files prior to testing +[testenv:build-wheel] +description = Environment for custom build of package wheels + +skip_install = True + +deps = + -r requirements/requirements_build.txt + +commands = + python .ci/build_wheel.py -p {posargs:{on_platform}} -w + +[testenv:kill-servers] +description = Environment for clearing running servers + +depends = pretest,test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators},posttest deps = psutil @@ -37,11 +51,15 @@ deps = skip_install = True commands = - # Clear any running servers that may be locking resources python -c "import psutil; proc_name = 'Ans.Dpf.Grpc'; nb_procs = len([proc.kill() for proc in psutil.process_iter() if proc_name in proc.name()]); \ print(f'Killed \{nb_procs} \{proc_name} processes.')" - # Organize test files +[testenv:pretest] +description = Environment to organize test files prior to testing + +skip_install = True + +commands = python -c "\ import os, shutil; \ test_data=['test_launcher','test_server','test_local_server','test_multi_server','test_workflow','test_remote_workflow','test_remote_operator','test_service','test_custom_type_field']; \ @@ -49,27 +67,19 @@ commands = [os.remove(f'tests/\{d}.py') for d in test_data if os.path.exists(f'tests/\{d}.py')]" [testenv:posttest] -description = Environment to kill servers and revert test files to original state after testing +description = Environment to revert test files to original state after testing depends = pretest, test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators} -deps = - psutil - skip_install = True commands = - # Revert project layout to previous state python -c "\ import os, shutil; \ test_data=['test_launcher','test_server','test_local_server','test_multi_server','test_workflow','test_remote_workflow','test_remote_operator','test_service', 'test_custom_type_field']; \ [shutil.move(f'\{d}/\{d}.py', f'tests/\{d}.py') for d in test_data if os.path.exists(f'\{d}/\{d}.py')]; \ [shutil.rmtree(d) for d in test_data if os.path.exists(d)]" - # Clear any running servers that may be locking resources - python -c "import psutil; proc_name = 'Ans.Dpf.Grpc'; nb_procs = len([proc.kill() for proc in psutil.process_iter() if proc_name in proc.name()]); \ - print(f'Killed \{nb_procs} \{proc_name} processes.')" - [testenv:test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators}] description = Environment where project testing configuration is defined @@ -170,19 +180,7 @@ commands = html: [(shutil.copy(src, 'build/html/_images') if os.path.exists(src) else print(f'Source not found: {src}')) for src in \ html: glob.glob('{env:SOURCE_DIR}/examples/04-advanced/02-volume_averaged_stress/*') + glob.glob('{env:SOURCE_DIR}/examples/12-fluids/02-fluids_results/*')]" - commands_post = # Clear any running servers that may be locking resources html,links: python -c "import psutil; proc_name = 'Ans.Dpf.Grpc'; nb_procs = len([proc.kill() for proc in psutil.process_iter() if proc_name in proc.name()]); \ html,links: print(f'Killed \{nb_procs} \{proc_name} processes.')" - -[testenv:build-wheel] -description = Environment for custom build of package wheels - -skip_install = True - -deps = - -r requirements/requirements_build.txt - -commands = - python .ci/build_wheel.py -p {posargs:{on_platform}} -w From 58f66f2a7c1a682489be186b91ba058ef2b8f1ac Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 24 Jan 2025 17:26:08 +0100 Subject: [PATCH 14/59] ci: another fix, very moody tests --- .github/workflows/tests.yml | 32 ++++++++++++++++---------------- tox.ini | 8 ++++---- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 679ca390b3..11d145c7af 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -229,10 +229,10 @@ jobs: # 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 "VIRTUALENV_SYSTEM_SITE_PACKAGES=true" >> $GITHUB_ENV - name: "Organize test files" shell: bash @@ -247,7 +247,7 @@ jobs: - name: "Test API" shell: bash run: | - tox -e test-api,kill-server --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 @@ -259,7 +259,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-launcher,kill-server --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 @@ -271,7 +271,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-server,kill-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 @@ -283,7 +283,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-local_server,kill-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 @@ -295,7 +295,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-multi_server,kill-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 @@ -307,7 +307,7 @@ jobs: max_attempts: 3 shell: bash command: | - tox -e test-remote_workflow,kill-server --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 @@ -316,7 +316,7 @@ jobs: shell: bash working-directory: test_remote_operator run: | - tox -e test-remote_operator,kill-server --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 @@ -329,7 +329,7 @@ jobs: retry_wait_seconds: 15 shell: bash command: | - tox -e test-workflow,kill-server --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 @@ -341,7 +341,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-service,kill-server --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 @@ -349,7 +349,7 @@ jobs: - name: "Test API Entry" shell: bash run: | - tox -e test-api_entry,kill-server --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" @@ -362,7 +362,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-custom_type_field,kill-server --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 @@ -374,7 +374,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-operators,kill-server --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 diff --git a/tox.ini b/tox.ini index 4116124edc..384a56426a 100644 --- a/tox.ini +++ b/tox.ini @@ -43,7 +43,7 @@ commands = [testenv:kill-servers] description = Environment for clearing running servers -depends = pretest,test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators},posttest +depends = test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators} deps = psutil @@ -100,9 +100,9 @@ setenv = remote_operator: JUNITXML = --junitxml=tests/junit/test-results7.xml workflow: JUNITXML = --junitxml=tests/junit/test-results8.xml service: JUNITXML = --junitxml=tests/junit/test-results9.xml - api_entry: JUNITXML = --junitxml=../junit/test-results10.xml - custom_type_field: = --junitxml=../tests/junit/test-results11.xml - operators: JUNITXML = --junitxml=../tests/junit/test-results12.xml + api_entry: JUNITXML = --junitxml=tests/junit/test-results10.xml + custom_type_field: = --junitxml=tests/junit/test-results11.xml + operators: JUNITXML = --junitxml=tests/junit/test-results12.xml # Tests sets api: PYTEST_PYTHON_FILES = tests From f55effdebb526bfa37937ba8c8f17eff3339ea37 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Mon, 27 Jan 2025 09:08:35 +0100 Subject: [PATCH 15/59] ci: ANSYS_DPF_PATH approach --- .github/workflows/tests.yml | 51 +++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 11d145c7af..1860eeda45 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -192,6 +192,12 @@ jobs: standalone_suffix: ${{ inputs.standalone_suffix }} ANSYS_VERSION : ${{inputs.ANSYS_VERSION}} + - name: "Set ANSYS_DPF_PATH environment variable" + shell: bash + run: | + export ANSYS_DPF_PATH=dpf-standalone/v${{inputs.ANSYS_VERSION}}/ansys/dpf/* + echo $ANSYS_DPF_PATH >> $GITHUB_ENV + - name: "Check licences of packages" uses: ansys/pydpf-actions/check-licenses@v2.3 @@ -229,10 +235,11 @@ jobs: # 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 @@ -247,7 +254,8 @@ jobs: - 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}}' + 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 @@ -259,7 +267,8 @@ jobs: 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}}' + 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 @@ -271,7 +280,8 @@ jobs: 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}}' + 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 @@ -283,7 +293,8 @@ jobs: 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}}' + 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 @@ -295,7 +306,8 @@ jobs: 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}}' + 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 @@ -307,7 +319,8 @@ jobs: 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}}' + 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 @@ -316,7 +329,8 @@ jobs: 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}}' + 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 @@ -329,7 +343,8 @@ jobs: 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}}' + 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 @@ -341,7 +356,8 @@ jobs: 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}}' + 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 @@ -349,7 +365,8 @@ jobs: - 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}}' + 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" @@ -362,7 +379,8 @@ jobs: 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}}' + 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 @@ -374,7 +392,8 @@ jobs: 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}}' + 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 From aa9edc099ef57c629d5aa99684ffe7141b691f28 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Mon, 27 Jan 2025 12:07:12 +0100 Subject: [PATCH 16/59] ci: another fix --- .github/workflows/tests.yml | 37 +++++++++++++++++++------------------ tox.ini | 6 ++++++ 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1860eeda45..c9c9fcb6c4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -195,8 +195,9 @@ jobs: - name: "Set ANSYS_DPF_PATH environment variable" shell: bash run: | - export ANSYS_DPF_PATH=dpf-standalone/v${{inputs.ANSYS_VERSION}}/ansys/dpf/* - echo $ANSYS_DPF_PATH >> $GITHUB_ENV + ANSYS_DPF_PATH=$(echo dpf-standalone/v${{inputs.ANSYS_VERSION}}/ansys/dpf/*) + echo "ANSYS_DPF_PATH=$ANSYS_DPF_PATH" >> $GITHUB_ENV +# tree $ANSYS_DPF_PATH - name: "Check licences of packages" uses: ansys/pydpf-actions/check-licenses@v2.3 @@ -235,10 +236,10 @@ jobs: # 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 "ANSYS_DPF_PATH=dpf-standalone/v${{inputs.ANSYS_VERSION}}" >> $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" @@ -254,7 +255,7 @@ jobs: - name: "Test API" shell: bash run: | - tox -e test-api --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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" @@ -267,7 +268,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-launcher --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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" @@ -280,7 +281,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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" @@ -293,7 +294,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-local_server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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" @@ -306,7 +307,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-multi_server --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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" @@ -319,7 +320,7 @@ jobs: max_attempts: 3 shell: bash command: | - tox -e test-remote_workflow --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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" @@ -329,7 +330,7 @@ jobs: shell: bash working-directory: test_remote_operator run: | - tox -e test-remote_operator --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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" @@ -343,7 +344,7 @@ jobs: retry_wait_seconds: 15 shell: bash command: | - tox -e test-workflow --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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" @@ -356,7 +357,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-service --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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" @@ -365,7 +366,7 @@ jobs: - name: "Test API Entry" shell: bash run: | - tox -e test-api_entry --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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 @@ -379,7 +380,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-custom_type_field --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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" @@ -392,7 +393,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-operators --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e kill-servers,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" diff --git a/tox.ini b/tox.ini index 384a56426a..72f5bbd78e 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,7 @@ pass_env = AWP_ROOT* ANSYS_DPF_PATH VIRTUALENV_SYSTEM_SITE_PACKAGES + * [testenv:build-wheel] description = Environment for custom build of package wheels @@ -121,7 +122,12 @@ setenv = deps = -r requirements/requirements_test.txt +allowlist_externals = * + commands = + # Ensure vtk compatibility + python -m pip uninstall --yes vtk + python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0 python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} [testenv:doc-{clean,links,html}] From f7a2d7764c6089ce3ad7914b1b20690aeb2c6c31 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Mon, 27 Jan 2025 16:46:54 +0100 Subject: [PATCH 17/59] fix: attempting another fix --- tox.ini | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 72f5bbd78e..4a85695bba 100644 --- a/tox.ini +++ b/tox.ini @@ -28,7 +28,6 @@ pass_env = AWP_ROOT* ANSYS_DPF_PATH VIRTUALENV_SYSTEM_SITE_PACKAGES - * [testenv:build-wheel] description = Environment for custom build of package wheels @@ -122,12 +121,16 @@ setenv = deps = -r requirements/requirements_test.txt -allowlist_externals = * +pass_env = + PACKAGE_NAME + MODULE + ANSYS_DPF_ACCEPT_LA + ANSYSLMD_LICENSE_FILE + AWP_ROOT* + ANSYS_DPF_PATH + VIRTUALENV_SYSTEM_SITE_PACKAGES commands = - # Ensure vtk compatibility - python -m pip uninstall --yes vtk - python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0 python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} [testenv:doc-{clean,links,html}] From 4495e9216a454586ba9784737ccf8569683ca210 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 29 Jan 2025 14:28:05 +0100 Subject: [PATCH 18/59] ci: another fix --- .github/workflows/tests.yml | 163 ++++++++++++++---------------------- tox.ini | 55 ++++++++---- 2 files changed, 99 insertions(+), 119 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c9c9fcb6c4..bb064b488c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -120,9 +120,6 @@ jobs: python -m pip install -U pip python -m pip install tox - # - name: "Install requirements" - # run: pip install -r requirements/requirements_build.txt - - name: "Build the wheel" shell: bash run: | @@ -179,11 +176,6 @@ jobs: path: ${{ steps.wheelhouse.outputs.name }} retention-days: 7 - # - name: "Install package wheel" - # shell: bash - # run: | - # pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] - - name: "Install DPF" id: set-server-path uses: ansys/pydpf-actions/install-dpf-server@v2.3 @@ -192,13 +184,6 @@ jobs: standalone_suffix: ${{ inputs.standalone_suffix }} ANSYS_VERSION : ${{inputs.ANSYS_VERSION}} - - name: "Set ANSYS_DPF_PATH environment variable" - shell: bash - run: | - ANSYS_DPF_PATH=$(echo dpf-standalone/v${{inputs.ANSYS_VERSION}}/ansys/dpf/*) - echo "ANSYS_DPF_PATH=$ANSYS_DPF_PATH" >> $GITHUB_ENV -# tree $ANSYS_DPF_PATH - - name: "Check licences of packages" uses: ansys/pydpf-actions/check-licenses@v2.3 @@ -211,11 +196,7 @@ jobs: - name: "Prepare Testing Environment" uses: ansys/pydpf-actions/prepare_tests@v2.3 with: - DEBUG: true - - # - name: "List installed packages" - # shell: bash - # run: pip list + DEBUG: true - name: "Test Docstrings" if: (inputs.DOCSTRING == 'true') && !((inputs.test_any == 'true') && (matrix.os == 'ubuntu-latest')) @@ -225,41 +206,19 @@ jobs: 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: "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 "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: "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 kill-servers,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 + if [ $MODE == 'PIP' ]; then + tox -e test-api,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-api,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi - name: "Test API test_launcher" uses: nick-fields/retry@v3 @@ -268,11 +227,11 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e kill-servers,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 + if [ $MODE == 'PIP' ]; then + tox -e test-launcher,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-launcher,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi - name: "Test API test_server" uses: nick-fields/retry@v3 @@ -281,11 +240,11 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e kill-servers,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 + if [ $MODE == 'PIP' ]; then + tox -e test-server,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-server,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi - name: "Test API test_local_server" uses: nick-fields/retry@v3 @@ -294,11 +253,11 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e kill-servers,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 + if [ $MODE == 'PIP' ]; then + tox -e test-local_server,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-local_server,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi - name: "Test API test_multi_server" uses: nick-fields/retry@v3 @@ -307,11 +266,11 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e kill-servers,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 + if [ $MODE == 'PIP' ]; then + tox -e test-multi_server,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-multi_server,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi - name: "Test API test_remote_workflow" uses: nick-fields/retry@v3 @@ -320,21 +279,21 @@ jobs: max_attempts: 3 shell: bash command: | - tox -e kill-servers,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 + if [ $MODE == 'PIP' ]; then + tox -e test-remote_workflow,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-remote_workflow,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi - name: "Test API test_remote_operator" shell: bash working-directory: test_remote_operator run: | - tox -e kill-servers,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 + if [ $MODE == 'PIP' ]; then + tox -e test-remote_operator,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-remote_operator,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi - name: "Test API test_workflow" uses: nick-fields/retry@v3 @@ -344,11 +303,11 @@ jobs: retry_wait_seconds: 15 shell: bash command: | - tox -e kill-servers,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 + if [ $MODE == 'PIP' ]; then + tox -e test-workflow,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-workflow,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi - name: "Test API test_service" uses: nick-fields/retry@v3 @@ -357,22 +316,22 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e kill-servers,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 + if [ $MODE == 'PIP' ]; then + tox -e test-service,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-service,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi - name: "Test API Entry" shell: bash run: | - tox -e kill-servers,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}}' + if [ $MODE == 'PIP' ]; then + tox -e test-api_entry,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-api_entry,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi 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: @@ -380,11 +339,11 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e kill-servers,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 + if [ $MODE == 'PIP' ]; then + tox -e test-custom_type_field,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-custom_type_field,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi - name: "Test Operators" uses: nick-fields/retry@v3 @@ -393,11 +352,11 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e kill-servers,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 + if [ $MODE == 'PIP' ]; then + tox -e test-operators,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + else + tox -e test-operators,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + fi - name: "Upload Test Results" uses: actions/upload-artifact@v4 diff --git a/tox.ini b/tox.ini index 4a85695bba..8434e12eaa 100644 --- a/tox.ini +++ b/tox.ini @@ -2,18 +2,37 @@ # Usage instructions: -# `tox` will run all tests sequentially, `tox --parallel` will run all tests in parallel (much faster). -# Run specific selection of tests with `tox -e pretest,,posttest` e.g., `tox -e pretest,test-api,test-launcher,posttest` -# `--parallel` flag can be passed when running specific selections. +# `tox` will run all "envlist" tests sequentially, `tox --parallel` same tests in parallel (much faster). +# "othertests" are advisable to run sequentially as parallel running can lead to segmentation faults and weird errors. Hence, +# the reason for their separation. `tox -m othertests` will run these tests sequentially. + +# Run specific selection of tests with `tox -e pretest,,posttest,kill-servers` e.g., `tox -e pretest,test-api,test-launcher,posttest,kill-servers` +# `--parallel` flag can also be passed when running specific selections. # For packaging, build wheels for specific platform with `tox -e build-wheel -- `. # If `tox -e build-wheel` is run without passing a platform, tox will automatically build the ffl wheels based on the operating system # on which it is executing: windows -> "win_amd64", linux -> "manylinux_2_17_x86_64", mac -> "any" +# For html documentation generation, run `tox -e doc-html`. To clean previously existing documentation before generating +# a new one, run `tox -e doc-clean,doc-html` + +# Current tox configuration can automatically detect DPF server installation in these cases: +# - Unified install +# - if ANSYS_DPF_PATH is set and points to a valid DPF server installation +# Which means invoking tox with previous commands necessitate having a server available via above methods + +# Understandably for development purposes, more flexibility may be desired and there are various ways of invoking tox to achieve desired effects. +# For example, to use a standalone dpf server (present in ansys_dpf_server_win_v2025.1.pre0/ directory) in editable mode in each tox environment, +# you can do something like `tox -m othertests -x testenv.deps+="-e ansys_dpf_server_win_v2025.1.pre0"`. +# The tox documentation should be consulted for a quick overview of different CLI flags that can be used to customize invocation. + [tox] description = Default tox environment list and core configurations -envlist = pretest,test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators},posttest,kill-servers +envlist = pretest,test-{api,launcher,server,local_server,multi_server,api_entry,custom_type_field,operators},posttest,kill-servers + +labels = + othertests = pretest,test-{workflow,remote_workflow,remote_operator,service},posttest,kill-servers isolated_build_env = build @@ -27,7 +46,9 @@ pass_env = ANSYSLMD_LICENSE_FILE AWP_ROOT* ANSYS_DPF_PATH - VIRTUALENV_SYSTEM_SITE_PACKAGES + +deps = + -r requirements/requirements_test.txt [testenv:build-wheel] description = Environment for custom build of package wheels @@ -59,6 +80,10 @@ description = Environment to organize test files prior to testing skip_install = True +deps = + +commands_pre = + commands = python -c "\ import os, shutil; \ @@ -73,6 +98,10 @@ depends = pretest, test-{api,launcher,server,local_server,multi_server,remote_wo skip_install = True +deps = + +commands_pre = + commands = python -c "\ import os, shutil; \ @@ -101,7 +130,7 @@ setenv = workflow: JUNITXML = --junitxml=tests/junit/test-results8.xml service: JUNITXML = --junitxml=tests/junit/test-results9.xml api_entry: JUNITXML = --junitxml=tests/junit/test-results10.xml - custom_type_field: = --junitxml=tests/junit/test-results11.xml + custom_type_field: JUNITXML = --junitxml=tests/junit/test-results11.xml operators: JUNITXML = --junitxml=tests/junit/test-results12.xml # Tests sets @@ -118,17 +147,8 @@ setenv = custom_type_field: PYTEST_PYTHON_FILES = test_custom_type_field operators: PYTEST_PYTHON_FILES = tests/operators -deps = - -r requirements/requirements_test.txt - -pass_env = - PACKAGE_NAME - MODULE - ANSYS_DPF_ACCEPT_LA - ANSYSLMD_LICENSE_FILE - AWP_ROOT* - ANSYS_DPF_PATH - VIRTUALENV_SYSTEM_SITE_PACKAGES + TEMP = {env_tmp_dir} + TMP = {env_tmp_dir} commands = python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} @@ -150,6 +170,7 @@ extras = html: plotting deps = + clean: links,html: -r requirements/requirements_docs.txt commands_pre = From a1a68f59c38c4dfd66a2a6ea788ae51f0a05a66c Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 29 Jan 2025 15:43:39 +0100 Subject: [PATCH 19/59] ci: another fix --- .github/workflows/tests.yml | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bb064b488c..bfbd544fe9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -215,9 +215,9 @@ jobs: shell: bash run: | if [ $MODE == 'PIP' ]; then - tox -e test-api,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-api,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-api,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-api,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - name: "Test API test_launcher" @@ -228,9 +228,9 @@ jobs: shell: bash command: | if [ $MODE == 'PIP' ]; then - tox -e test-launcher,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-launcher,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-launcher,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-launcher,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - name: "Test API test_server" @@ -241,9 +241,9 @@ jobs: shell: bash command: | if [ $MODE == 'PIP' ]; then - tox -e test-server,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-server,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - name: "Test API test_local_server" @@ -254,9 +254,9 @@ jobs: shell: bash command: | if [ $MODE == 'PIP' ]; then - tox -e test-local_server,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-local_server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-local_server,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-local_server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - name: "Test API test_multi_server" @@ -267,9 +267,9 @@ jobs: shell: bash command: | if [ $MODE == 'PIP' ]; then - tox -e test-multi_server,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-multi_server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-multi_server,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-multi_server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - name: "Test API test_remote_workflow" @@ -280,9 +280,9 @@ jobs: shell: bash command: | if [ $MODE == 'PIP' ]; then - tox -e test-remote_workflow,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-remote_workflow,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - name: "Test API test_remote_operator" @@ -290,9 +290,9 @@ jobs: working-directory: test_remote_operator run: | if [ $MODE == 'PIP' ]; then - tox -e test-remote_operator,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-remote_operator,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-remote_operator,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-remote_operator,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - name: "Test API test_workflow" @@ -304,9 +304,9 @@ jobs: shell: bash command: | if [ $MODE == 'PIP' ]; then - tox -e test-workflow,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-workflow,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - name: "Test API test_service" @@ -317,18 +317,18 @@ jobs: shell: bash command: | if [ $MODE == 'PIP' ]; then - tox -e test-service,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-service,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-service,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-service,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - name: "Test API Entry" shell: bash run: | if [ $MODE == 'PIP' ]; then - tox -e test-api_entry,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-api_entry,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-api_entry,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-api_entry,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi timeout-minutes: 30 @@ -340,9 +340,9 @@ jobs: shell: bash command: | if [ $MODE == 'PIP' ]; then - tox -e test-custom_type_field,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-custom_type_field,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-custom_type_field,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-custom_type_field,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - name: "Test Operators" @@ -353,9 +353,9 @@ jobs: shell: bash command: | if [ $MODE == 'PIP' ]; then - tox -e test-operators,kill-servers -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-operators,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" else - tox -e test-operators,kill-servers -x --installpkg dist/${{ steps.wheel.outputs.wheel_name }} + tox -e test-operators,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - name: "Upload Test Results" From 56fc675a501e659779be908a688e1e9cca031f2b Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 29 Jan 2025 16:10:01 +0100 Subject: [PATCH 20/59] ci: another fix --- .github/workflows/tests.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bfbd544fe9..4f0c447e31 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -272,19 +272,6 @@ jobs: tox -e test-multi_server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - - name: "Test API test_remote_workflow" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 4 - max_attempts: 3 - shell: bash - command: | - if [ $MODE == 'PIP' ]; then - tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi - - name: "Test API test_remote_operator" shell: bash working-directory: test_remote_operator @@ -358,6 +345,19 @@ jobs: tox -e test-operators,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi + - name: "Test API test_remote_workflow" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 4 + max_attempts: 3 + shell: bash + command: | + if [ $MODE == 'PIP' ]; then + tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" + else + tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" + fi + - name: "Upload Test Results" uses: actions/upload-artifact@v4 with: From 41ad21e7dfea634aed29ae476c6b0364ad6d1eaa Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 29 Jan 2025 16:51:25 +0100 Subject: [PATCH 21/59] ci: another fix --- .github/workflows/tests.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4f0c447e31..238892f2e2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -272,9 +272,21 @@ jobs: tox -e test-multi_server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi + - name: "Test API test_remote_workflow" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 4 + max_attempts: 3 + shell: bash + command: | + if [ $MODE == 'PIP' ]; then + tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" + else + tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" + fi + - name: "Test API test_remote_operator" shell: bash - working-directory: test_remote_operator run: | if [ $MODE == 'PIP' ]; then tox -e test-remote_operator,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" @@ -345,19 +357,6 @@ jobs: tox -e test-operators,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" fi - - name: "Test API test_remote_workflow" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 4 - max_attempts: 3 - shell: bash - command: | - if [ $MODE == 'PIP' ]; then - tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi - - name: "Upload Test Results" uses: actions/upload-artifact@v4 with: From 1052d4d1f0d95ee2f0e219f9a5779213df23b009 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 29 Jan 2025 18:02:02 +0100 Subject: [PATCH 22/59] ci: another fix --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 238892f2e2..b5e995bcb8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -299,7 +299,7 @@ jobs: with: timeout_minutes: 3 max_attempts: 4 - retry_wait_seconds: 15 + # retry_wait_seconds: 15 shell: bash command: | if [ $MODE == 'PIP' ]; then From b4847b09d2ef71018ab9a75079518ffc2bebfcbd Mon Sep 17 00:00:00 2001 From: moe-ad Date: Thu, 30 Jan 2025 10:39:57 +0100 Subject: [PATCH 23/59] ci: another fix --- .github/workflows/tests.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b5e995bcb8..fb1634a9f7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -223,7 +223,7 @@ jobs: - name: "Test API test_launcher" uses: nick-fields/retry@v3 with: - timeout_minutes: 2 + timeout_minutes: 10 max_attempts: 2 shell: bash command: | @@ -236,7 +236,7 @@ jobs: - name: "Test API test_server" uses: nick-fields/retry@v3 with: - timeout_minutes: 5 + timeout_minutes: 10 max_attempts: 2 shell: bash command: | @@ -249,7 +249,7 @@ jobs: - name: "Test API test_local_server" uses: nick-fields/retry@v3 with: - timeout_minutes: 2 + timeout_minutes: 10 max_attempts: 2 shell: bash command: | @@ -262,7 +262,7 @@ jobs: - name: "Test API test_multi_server" uses: nick-fields/retry@v3 with: - timeout_minutes: 5 + timeout_minutes: 10 max_attempts: 2 shell: bash command: | @@ -275,7 +275,7 @@ jobs: - name: "Test API test_remote_workflow" uses: nick-fields/retry@v3 with: - timeout_minutes: 4 + timeout_minutes: 10 max_attempts: 3 shell: bash command: | @@ -297,7 +297,7 @@ jobs: - name: "Test API test_workflow" uses: nick-fields/retry@v3 with: - timeout_minutes: 3 + timeout_minutes: 10 max_attempts: 4 # retry_wait_seconds: 15 shell: bash @@ -311,7 +311,7 @@ jobs: - name: "Test API test_service" uses: nick-fields/retry@v3 with: - timeout_minutes: 3 + timeout_minutes: 10 max_attempts: 2 shell: bash command: | @@ -334,7 +334,7 @@ jobs: - name: "Test API test_custom_type_field" uses: nick-fields/retry@v3 with: - timeout_minutes: 2 + timeout_minutes: 10 max_attempts: 2 shell: bash command: | @@ -347,7 +347,7 @@ jobs: - name: "Test Operators" uses: nick-fields/retry@v3 with: - timeout_minutes: 2 + timeout_minutes: 10 max_attempts: 2 shell: bash command: | From 6562b8493ef9b40b79b1c580056b2af39a9b69e2 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Thu, 30 Jan 2025 11:20:39 +0100 Subject: [PATCH 24/59] ci: another fix --- .github/workflows/tests.yml | 85 ++++++++++--------------------------- 1 file changed, 22 insertions(+), 63 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fb1634a9f7..fc66c6da88 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -205,7 +205,16 @@ jobs: MODULE: ${{env.MODULE}} PACKAGE_NAME: ${{env.PACKAGE_NAME}} working-directory: src - + + - name: "Set tox extra CLI flags" + shell: bash + run: | + if [ $MODE == 'PIP' ]; then + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + else + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + fi + - name: "Organize test files" shell: bash run: | @@ -214,11 +223,7 @@ jobs: - name: "Test API" shell: bash run: | - if [ $MODE == 'PIP' ]; then - tox -e test-api,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-api,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi + tox -e test-api,kill-servers $TOX_EXTRA_ARG - name: "Test API test_launcher" uses: nick-fields/retry@v3 @@ -227,11 +232,7 @@ jobs: max_attempts: 2 shell: bash command: | - if [ $MODE == 'PIP' ]; then - tox -e test-launcher,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-launcher,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi + tox -e test-launcher,kill-servers $TOX_EXTRA_ARG - name: "Test API test_server" uses: nick-fields/retry@v3 @@ -240,11 +241,7 @@ jobs: max_attempts: 2 shell: bash command: | - if [ $MODE == 'PIP' ]; then - tox -e test-server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi + tox -e test-server,kill-servers $TOX_EXTRA_ARG - name: "Test API test_local_server" uses: nick-fields/retry@v3 @@ -253,11 +250,7 @@ jobs: max_attempts: 2 shell: bash command: | - if [ $MODE == 'PIP' ]; then - tox -e test-local_server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-local_server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi + tox -e test-local_server,kill-servers $TOX_EXTRA_ARG - name: "Test API test_multi_server" uses: nick-fields/retry@v3 @@ -266,11 +259,7 @@ jobs: max_attempts: 2 shell: bash command: | - if [ $MODE == 'PIP' ]; then - tox -e test-multi_server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-multi_server,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi + tox -e test-multi_server,kill-servers $TOX_EXTRA_ARG - name: "Test API test_remote_workflow" uses: nick-fields/retry@v3 @@ -279,34 +268,21 @@ jobs: max_attempts: 3 shell: bash command: | - if [ $MODE == 'PIP' ]; then - tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-remote_workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi + tox -e test-remote_workflow,kill-servers $TOX_EXTRA_ARG - name: "Test API test_remote_operator" shell: bash run: | - if [ $MODE == 'PIP' ]; then - tox -e test-remote_operator,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-remote_operator,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi + tox -e test-remote_operator,kill-servers $TOX_EXTRA_ARG - name: "Test API test_workflow" uses: nick-fields/retry@v3 with: timeout_minutes: 10 max_attempts: 4 - # retry_wait_seconds: 15 shell: bash command: | - if [ $MODE == 'PIP' ]; then - tox -e test-workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-workflow,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi + tox -e test-workflow,kill-servers $TOX_EXTRA_ARG - name: "Test API test_service" uses: nick-fields/retry@v3 @@ -315,21 +291,12 @@ jobs: max_attempts: 2 shell: bash command: | - if [ $MODE == 'PIP' ]; then - tox -e test-service,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-service,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi + tox -e test-service,kill-servers $TOX_EXTRA_ARG - name: "Test API Entry" shell: bash run: | - if [ $MODE == 'PIP' ]; then - tox -e test-api_entry,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-api_entry,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi - timeout-minutes: 30 + tox -e test-api_entry,kill-servers $TOX_EXTRA_ARG - name: "Test API test_custom_type_field" uses: nick-fields/retry@v3 @@ -338,11 +305,7 @@ jobs: max_attempts: 2 shell: bash command: | - if [ $MODE == 'PIP' ]; then - tox -e test-custom_type_field,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-custom_type_field,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi + tox -e test-custom_type_field,kill-servers $TOX_EXTRA_ARG - name: "Test Operators" uses: nick-fields/retry@v3 @@ -351,11 +314,7 @@ jobs: max_attempts: 2 shell: bash command: | - if [ $MODE == 'PIP' ]; then - tox -e test-operators,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - else - tox -e test-operators,kill-servers --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" - fi + tox -e test-operators,kill-servers $TOX_EXTRA_ARG - name: "Upload Test Results" uses: actions/upload-artifact@v4 From 0ea6e4ab09ebdb26dda75432f4fa22e0facad310 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Thu, 30 Jan 2025 11:35:04 +0100 Subject: [PATCH 25/59] ci: another fix --- .github/workflows/tests.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fc66c6da88..ead95522b1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -206,7 +206,8 @@ jobs: PACKAGE_NAME: ${{env.PACKAGE_NAME}} working-directory: src - - name: "Set tox extra CLI flags" + - name: "Set tox extra CLI arguments" + id: tox-cli-arguments shell: bash run: | if [ $MODE == 'PIP' ]; then @@ -223,7 +224,7 @@ jobs: - name: "Test API" shell: bash run: | - tox -e test-api,kill-servers $TOX_EXTRA_ARG + tox -e test-api,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_launcher" uses: nick-fields/retry@v3 @@ -232,7 +233,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-launcher,kill-servers $TOX_EXTRA_ARG + tox -e test-launcher,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_server" uses: nick-fields/retry@v3 @@ -241,7 +242,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-server,kill-servers $TOX_EXTRA_ARG + tox -e test-server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_local_server" uses: nick-fields/retry@v3 @@ -250,7 +251,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-local_server,kill-servers $TOX_EXTRA_ARG + tox -e test-local_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_multi_server" uses: nick-fields/retry@v3 @@ -259,7 +260,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-multi_server,kill-servers $TOX_EXTRA_ARG + tox -e test-multi_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_remote_workflow" uses: nick-fields/retry@v3 @@ -268,12 +269,12 @@ jobs: max_attempts: 3 shell: bash command: | - tox -e test-remote_workflow,kill-servers $TOX_EXTRA_ARG + tox -e test-remote_workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_remote_operator" shell: bash run: | - tox -e test-remote_operator,kill-servers $TOX_EXTRA_ARG + tox -e test-remote_operator,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_workflow" uses: nick-fields/retry@v3 @@ -282,7 +283,7 @@ jobs: max_attempts: 4 shell: bash command: | - tox -e test-workflow,kill-servers $TOX_EXTRA_ARG + tox -e test-workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_service" uses: nick-fields/retry@v3 @@ -291,12 +292,12 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-service,kill-servers $TOX_EXTRA_ARG + tox -e test-service,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API Entry" shell: bash run: | - tox -e test-api_entry,kill-servers $TOX_EXTRA_ARG + tox -e test-api_entry,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_custom_type_field" uses: nick-fields/retry@v3 @@ -305,7 +306,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-custom_type_field,kill-servers $TOX_EXTRA_ARG + tox -e test-custom_type_field,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test Operators" uses: nick-fields/retry@v3 @@ -314,7 +315,7 @@ jobs: max_attempts: 2 shell: bash command: | - tox -e test-operators,kill-servers $TOX_EXTRA_ARG + tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Upload Test Results" uses: actions/upload-artifact@v4 From 7f46d0df249d31579fd7322a9e9bcc2fdacb6a57 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Thu, 30 Jan 2025 12:53:42 +0100 Subject: [PATCH 26/59] ci: avoid unnecessary windows runner tox env installation --- .github/workflows/tests.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ead95522b1..f8c22f5b59 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -91,7 +91,7 @@ jobs: tests: name: "Tests" needs: setup - timeout-minutes: 35 + timeout-minutes: 45 runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -211,9 +211,17 @@ jobs: shell: bash run: | if [ $MODE == 'PIP' ]; then - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + else + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}"' >> "$GITHUB_OUTPUT" + fi else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + else + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }}' >> "$GITHUB_OUTPUT" + fi fi - name: "Organize test files" From 26398fd8f96798a7da5f40c60bb5a0a01f189179 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Thu, 30 Jan 2025 14:04:07 +0100 Subject: [PATCH 27/59] ci: increase timeout minutes --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f8c22f5b59..4569f9045b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -91,7 +91,7 @@ jobs: tests: name: "Tests" needs: setup - timeout-minutes: 45 + timeout-minutes: 60 runs-on: ${{ matrix.os }} strategy: fail-fast: false From 8e3e701fde98df786022d720aa3338585eabb69e Mon Sep 17 00:00:00 2001 From: moe-ad Date: Thu, 30 Jan 2025 17:09:49 +0100 Subject: [PATCH 28/59] ci: increase timeout minutes --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4569f9045b..6302852283 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -91,7 +91,7 @@ jobs: tests: name: "Tests" needs: setup - timeout-minutes: 60 + timeout-minutes: 120 runs-on: ${{ matrix.os }} strategy: fail-fast: false From dc78e90fb737aab295422a887e63ad6d7aac4a98 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 31 Jan 2025 09:22:15 +0100 Subject: [PATCH 29/59] ci: activate uv and pytest-xdist --- .github/workflows/tests.yml | 10 +++++----- tox.ini | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6302852283..743aa395b0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -118,7 +118,7 @@ jobs: shell: pwsh run: | python -m pip install -U pip - python -m pip install tox + python -m pip install -U tox tox-uv - name: "Build the wheel" shell: bash @@ -212,15 +212,15 @@ jobs: run: | if [ $MODE == 'PIP' ]; then if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" -- -n auto' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}"' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -- -n auto' >> "$GITHUB_OUTPUT" fi else if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" -- -n auto' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }}' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -- -n auto' >> "$GITHUB_OUTPUT" fi fi diff --git a/tox.ini b/tox.ini index 8434e12eaa..225e425dea 100644 --- a/tox.ini +++ b/tox.ini @@ -49,6 +49,7 @@ pass_env = deps = -r requirements/requirements_test.txt + pytest-xdist [testenv:build-wheel] description = Environment for custom build of package wheels @@ -151,7 +152,7 @@ setenv = TMP = {env_tmp_dir} commands = - python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} + python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} {posargs} [testenv:doc-{clean,links,html}] description = Environment for documentation generation From fb4ea950b3ae0a63de53626e9e7570ebea12b65d Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 31 Jan 2025 09:22:15 +0100 Subject: [PATCH 30/59] ci: activate uv and pytest-xdist --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 225e425dea..19cfdf53a4 100644 --- a/tox.ini +++ b/tox.ini @@ -39,6 +39,8 @@ isolated_build_env = build [testenv] description = Default configuration for test environments, unless overridden +uv_seed = true + pass_env = PACKAGE_NAME MODULE From 1bef49e4fde1f4f9d6a167590764e16b4836952c Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 31 Jan 2025 12:06:28 +0100 Subject: [PATCH 31/59] ci: cache .tox directory --- .github/workflows/docs.yml | 2 +- .github/workflows/tests.yml | 13 +++++++++++-- tox.ini | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3ee19d9f69..fe41436285 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -77,7 +77,7 @@ jobs: shell: pwsh run: | python -m pip install -U pip - python -m pip install tox + python -m pip install tox tox-uv - name: "Build the wheel" shell: pwsh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 743aa395b0..7207a028f1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -120,6 +120,15 @@ jobs: python -m pip install -U pip python -m pip install -U tox tox-uv + - name: Cache + uses: actions/cache@v4 + with: + path: | + .tox + key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ inputs.ANSYS_VERSION }}-${{ hashFiles('requirements/*', 'pyproject.toml') }} + restore-keys: | + ${{ matrix.os }}-${{ matrix.python-version }}-${{ inputs.ANSYS_VERSION }}- + - name: "Build the wheel" shell: bash run: | @@ -212,13 +221,13 @@ jobs: run: | if [ $MODE == 'PIP' ]; then if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" -- -n auto' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -- -n auto' >> "$GITHUB_OUTPUT" fi else if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" -- -n auto' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -- -n auto' >> "$GITHUB_OUTPUT" fi diff --git a/tox.ini b/tox.ini index 19cfdf53a4..d7755b7d92 100644 --- a/tox.ini +++ b/tox.ini @@ -72,6 +72,8 @@ depends = test-{api,launcher,server,local_server,multi_server,remote_workflow,re deps = psutil +commands_pre = + skip_install = True commands = From c7eec153aef19b015167e71a0d83b37fa73240f0 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 31 Jan 2025 12:15:10 +0100 Subject: [PATCH 32/59] ci: modify CLI flags --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7207a028f1..efbd0c6ba4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -221,13 +221,13 @@ jobs: run: | if [ $MODE == 'PIP' ]; then if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -- -n auto' >> "$GITHUB_OUTPUT" fi else if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -- -n auto' >> "$GITHUB_OUTPUT" fi From 69051690b32fdc5272dc3996c23b1af0b78ad410 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 31 Jan 2025 12:46:04 +0100 Subject: [PATCH 33/59] ci: remove pytest-xdist --- .github/workflows/tests.yml | 4 ++-- tox.ini | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index efbd0c6ba4..229a874c02 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -223,13 +223,13 @@ jobs: if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -- -n auto' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}"' >> "$GITHUB_OUTPUT" fi else if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -- -n auto' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }}' >> "$GITHUB_OUTPUT" fi fi diff --git a/tox.ini b/tox.ini index d7755b7d92..48cfcd2966 100644 --- a/tox.ini +++ b/tox.ini @@ -51,7 +51,6 @@ pass_env = deps = -r requirements/requirements_test.txt - pytest-xdist [testenv:build-wheel] description = Environment for custom build of package wheels From 80b9ffb3f544173ef3333386a3742be4f521ed1a Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 31 Jan 2025 14:01:25 +0100 Subject: [PATCH 34/59] ci: trigger workflow for caches usage investigation From 40bb5a5abd5adf0d1d7734fcee095f772a36c6e0 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 31 Jan 2025 15:42:27 +0100 Subject: [PATCH 35/59] ci: check influence of multiple tox invocation --- .github/workflows/tests.yml | 201 ++++++++++++++++++------------------ tox.ini | 1 + 2 files changed, 104 insertions(+), 98 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 229a874c02..5654d25f0a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -233,106 +233,111 @@ jobs: fi fi - - name: "Organize test files" + - name: "Run all tests sequentially" shell: bash run: | - tox -e pretest,kill-servers - - - name: "Test API" - shell: bash - run: | - tox -e test-api,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_launcher" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-launcher,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_server" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_local_server" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-local_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_multi_server" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-multi_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_remote_workflow" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 3 - shell: bash - command: | - tox -e test-remote_workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_remote_operator" - shell: bash - run: | - tox -e test-remote_operator,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_workflow" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 4 - shell: bash - command: | - tox -e test-workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_service" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-service,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API Entry" - shell: bash - run: | - tox -e test-api_entry,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_custom_type_field" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-custom_type_field,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test Operators" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + tox -m alltestsci ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Organize test files" + # shell: bash + # run: | + # tox -e pretest,kill-servers + + # - name: "Test API" + # shell: bash + # run: | + # tox -e test-api,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_launcher" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-launcher,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_server" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_local_server" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-local_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_multi_server" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-multi_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_remote_workflow" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 3 + # shell: bash + # command: | + # tox -e test-remote_workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_remote_operator" + # shell: bash + # run: | + # tox -e test-remote_operator,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_workflow" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 4 + # shell: bash + # command: | + # tox -e test-workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_service" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-service,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API Entry" + # shell: bash + # run: | + # tox -e test-api_entry,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_custom_type_field" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-custom_type_field,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test Operators" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Upload Test Results" uses: actions/upload-artifact@v4 diff --git a/tox.ini b/tox.ini index 48cfcd2966..44bcfbf500 100644 --- a/tox.ini +++ b/tox.ini @@ -33,6 +33,7 @@ envlist = pretest,test-{api,launcher,server,local_server,multi_server,api_entry, labels = othertests = pretest,test-{workflow,remote_workflow,remote_operator,service},posttest,kill-servers + alltestsci = pretest,test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators} isolated_build_env = build From 78a278bc50f41c392195c64304e8e65ecfc6055d Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 31 Jan 2025 16:46:47 +0100 Subject: [PATCH 36/59] ci: another possible optimization --- .github/workflows/tests.yml | 4 ++-- requirements/requirements_test.txt | 1 + tox.ini | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5654d25f0a..6e770ab99a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -223,13 +223,13 @@ jobs: if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}"' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -- -n logical' >> "$GITHUB_OUTPUT" fi else if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }}' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -- -n logical' >> "$GITHUB_OUTPUT" fi fi diff --git a/requirements/requirements_test.txt b/requirements/requirements_test.txt index 2a1218b197..5501bacabe 100644 --- a/requirements/requirements_test.txt +++ b/requirements/requirements_test.txt @@ -6,5 +6,6 @@ pytest==8.3.4 pytest-cov==5.0.0 pytest-order==1.3.0 pytest-rerunfailures==15.0 +pytest-xdist==3.6.1 pyvista==0.44.2 vtk==9.3.1 diff --git a/tox.ini b/tox.ini index 44bcfbf500..d957799928 100644 --- a/tox.ini +++ b/tox.ini @@ -52,6 +52,7 @@ pass_env = deps = -r requirements/requirements_test.txt + psutil [testenv:build-wheel] description = Environment for custom build of package wheels @@ -158,6 +159,10 @@ setenv = commands = python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} {posargs} +command_post = + python -c "import psutil; proc_name = 'Ans.Dpf.Grpc'; nb_procs = len([proc.kill() for proc in psutil.process_iter() if proc_name in proc.name()]); \ + print(f'Killed \{nb_procs} \{proc_name} processes.')" + [testenv:doc-{clean,links,html}] description = Environment for documentation generation From dfdf03b9644dbc4dc99c83158b19964e9979b57b Mon Sep 17 00:00:00 2001 From: moe-ad Date: Sun, 2 Feb 2025 11:50:08 +0100 Subject: [PATCH 37/59] ci: another fix --- .github/workflows/tests.yml | 74 +++++++++++++++++++++++++++++++------ tox.ini | 6 --- 2 files changed, 62 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6e770ab99a..229a5fa4ed 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -223,31 +223,81 @@ jobs: if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -- -n logical' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}"' >> "$GITHUB_OUTPUT" fi else if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -- -n logical' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }}' >> "$GITHUB_OUTPUT" fi fi - - name: "Run all tests sequentially" + - name: "Organize test files" shell: bash run: | - tox -m alltestsci ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + tox -e pretest,kill-servers - # - name: "Organize test files" - # shell: bash - # run: | - # tox -e pretest,kill-servers + - name: "Test API" + shell: bash + run: | + tox -e test-api,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - # - name: "Test API" - # shell: bash - # run: | - # tox -e test-api,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + - name: "Test API test_launcher" + shell: bash + run: | + tox -e test-launcher,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + - name: "Test API test_server" + shell: bash + run: | + tox -e test-server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API test_local_server" + shell: bash + run: | + tox -e test-local_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API test_multi_server" + shell: bash + run: | + tox -e test-multi_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API test_remote_workflow" + shell: bash + run: | + tox -e test-remote_workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API test_remote_operator" + shell: bash + run: | + tox -e test-remote_operator,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API test_workflow" + shell: bash + run: | + tox -e test-workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API test_service" + shell: bash + run: | + tox -e test-service,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API Entry" + shell: bash + run: | + tox -e test-api_entry,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API test_custom_type_field" + shell: bash + run: | + tox -e test-custom_type_field,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test Operators" + shell: bash + run: | + tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + # - name: "Test API test_launcher" # uses: nick-fields/retry@v3 # with: diff --git a/tox.ini b/tox.ini index d957799928..48cfcd2966 100644 --- a/tox.ini +++ b/tox.ini @@ -33,7 +33,6 @@ envlist = pretest,test-{api,launcher,server,local_server,multi_server,api_entry, labels = othertests = pretest,test-{workflow,remote_workflow,remote_operator,service},posttest,kill-servers - alltestsci = pretest,test-{api,launcher,server,local_server,multi_server,remote_workflow,remote_operator,workflow,service,api_entry,custom_type_field,operators} isolated_build_env = build @@ -52,7 +51,6 @@ pass_env = deps = -r requirements/requirements_test.txt - psutil [testenv:build-wheel] description = Environment for custom build of package wheels @@ -159,10 +157,6 @@ setenv = commands = python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} {posargs} -command_post = - python -c "import psutil; proc_name = 'Ans.Dpf.Grpc'; nb_procs = len([proc.kill() for proc in psutil.process_iter() if proc_name in proc.name()]); \ - print(f'Killed \{nb_procs} \{proc_name} processes.')" - [testenv:doc-{clean,links,html}] description = Environment for documentation generation From 913c1174a34be78cc0db8f0d6121900a49477c9d Mon Sep 17 00:00:00 2001 From: moe-ad Date: Sun, 2 Feb 2025 13:07:58 +0100 Subject: [PATCH 38/59] ci: another test --- .github/workflows/tests.yml | 191 +++++++++++++----------------------- 1 file changed, 68 insertions(+), 123 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 229a5fa4ed..4d700b809f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -221,15 +221,15 @@ jobs: run: | if [ $MODE == 'PIP' ]; then if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" -- -n auto' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}"' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -- -n auto' >> "$GITHUB_OUTPUT" fi else if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" -- -n auto' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }}' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -- -n auto' >> "$GITHUB_OUTPUT" fi fi @@ -242,31 +242,51 @@ jobs: shell: bash run: | tox -e test-api,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - + - name: "Test API test_launcher" - shell: bash - run: | - tox -e test-launcher,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-launcher,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_server" - shell: bash - run: | - tox -e test-server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_local_server" - shell: bash - run: | - tox -e test-local_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-local_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_multi_server" - shell: bash - run: | - tox -e test-multi_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-multi_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_remote_workflow" - shell: bash - run: | - tox -e test-remote_workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 3 + shell: bash + command: | + tox -e test-remote_workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_remote_operator" shell: bash @@ -274,14 +294,22 @@ jobs: tox -e test-remote_operator,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_workflow" - shell: bash - run: | - tox -e test-workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 4 + shell: bash + command: | + tox -e test-workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_service" - shell: bash - run: | - tox -e test-service,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-service,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API Entry" shell: bash @@ -289,105 +317,22 @@ jobs: tox -e test-api_entry,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_custom_type_field" - shell: bash - run: | - tox -e test-custom_type_field,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-custom_type_field,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test Operators" - shell: bash - run: | - tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_launcher" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-launcher,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_server" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_local_server" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-local_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_multi_server" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-multi_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_remote_workflow" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 3 - # shell: bash - # command: | - # tox -e test-remote_workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_remote_operator" - # shell: bash - # run: | - # tox -e test-remote_operator,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_workflow" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 4 - # shell: bash - # command: | - # tox -e test-workflow,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_service" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-service,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API Entry" - # shell: bash - # run: | - # tox -e test-api_entry,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_custom_type_field" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-custom_type_field,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test Operators" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Upload Test Results" uses: actions/upload-artifact@v4 From d3057fc83cd8d9cf52775c2e2c6f4f270b6c3d58 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Sun, 2 Feb 2025 14:26:44 +0100 Subject: [PATCH 39/59] ci: another test --- .github/workflows/tests.yml | 129 +++++++++++++++++++----------------- tox.ini | 5 +- 2 files changed, 70 insertions(+), 64 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4d700b809f..2e6429ae5a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -221,63 +221,68 @@ jobs: run: | if [ $MODE == 'PIP' ]; then if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" -- -n auto' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -- -n auto' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}"' >> "$GITHUB_OUTPUT" fi else if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0" -- -n auto' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else - echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -- -n auto' >> "$GITHUB_OUTPUT" + echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }}' >> "$GITHUB_OUTPUT" fi fi - name: "Organize test files" shell: bash run: | - tox -e pretest,kill-servers + tox -e pretest + + - name: "Run parallel tests" + shell: bash + run: | + tox run-parallel -m ciparalleltests ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API" shell: bash run: | tox -e test-api,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - name: "Test API test_launcher" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-launcher,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_server" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_local_server" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-local_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_multi_server" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-multi_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + # - name: "Test API test_launcher" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-launcher,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_server" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_local_server" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-local_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_multi_server" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-multi_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_remote_workflow" uses: nick-fields/retry@v3 @@ -311,28 +316,28 @@ jobs: command: | tox -e test-service,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - name: "Test API Entry" - shell: bash - run: | - tox -e test-api_entry,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test API test_custom_type_field" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-custom_type_field,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - - name: "Test Operators" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 2 - shell: bash - command: | - tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + # - name: "Test API Entry" + # shell: bash + # run: | + # tox -e test-api_entry,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test API test_custom_type_field" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-custom_type_field,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + # - name: "Test Operators" + # uses: nick-fields/retry@v3 + # with: + # timeout_minutes: 10 + # max_attempts: 2 + # shell: bash + # command: | + # tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Upload Test Results" uses: actions/upload-artifact@v4 diff --git a/tox.ini b/tox.ini index 48cfcd2966..00bc44efbb 100644 --- a/tox.ini +++ b/tox.ini @@ -33,7 +33,8 @@ envlist = pretest,test-{api,launcher,server,local_server,multi_server,api_entry, labels = othertests = pretest,test-{workflow,remote_workflow,remote_operator,service},posttest,kill-servers - + ciparalleltests = test-{launcher,server,local_server,multi_server,api_entry,custom_type_field,operators},kill-servers + isolated_build_env = build [testenv] @@ -120,7 +121,7 @@ depends = pretest setenv = # Pytest extra arguments - COVERAGE = --cov=ansys.dpf.core --cov-report=xml --cov-report=html --log-level=ERROR --cov-append + COVERAGE = --cov=ansys.dpf.core --cov-report=xml --cov-report=html --cov-append RERUNS = --reruns=2 --reruns-delay=1 DEBUG = -v -s --durations=10 --durations-min=1.0 From b9a552aede4116db70c2f0e378fca8ce1bb13645 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Sun, 2 Feb 2025 16:55:56 +0100 Subject: [PATCH 40/59] ci: stable implementation --- .github/workflows/tests.yml | 121 +++++++++++++++++------------------- tox.ini | 3 +- 2 files changed, 59 insertions(+), 65 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2e6429ae5a..9a46ac59fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -120,7 +120,7 @@ jobs: python -m pip install -U pip python -m pip install -U tox tox-uv - - name: Cache + - name: Cache tox environments uses: actions/cache@v4 with: path: | @@ -238,51 +238,46 @@ jobs: run: | tox -e pretest - - name: "Run parallel tests" - shell: bash - run: | - tox run-parallel -m ciparalleltests ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - name: "Test API" shell: bash run: | tox -e test-api,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - # - name: "Test API test_launcher" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-launcher,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_server" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_local_server" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-local_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_multi_server" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-multi_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + - name: "Test API test_launcher" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-launcher,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API test_server" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API test_local_server" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-local_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API test_multi_server" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-multi_server,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Test API test_remote_workflow" uses: nick-fields/retry@v3 @@ -316,28 +311,28 @@ jobs: command: | tox -e test-service,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - # - name: "Test API Entry" - # shell: bash - # run: | - # tox -e test-api_entry,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test API test_custom_type_field" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-custom_type_field,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - # - name: "Test Operators" - # uses: nick-fields/retry@v3 - # with: - # timeout_minutes: 10 - # max_attempts: 2 - # shell: bash - # command: | - # tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + - name: "Test API Entry" + shell: bash + run: | + tox -e test-api_entry,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test API test_custom_type_field" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-custom_type_field,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} + + - name: "Test Operators" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 2 + shell: bash + command: | + tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - name: "Upload Test Results" uses: actions/upload-artifact@v4 diff --git a/tox.ini b/tox.ini index 00bc44efbb..b98ef70eb4 100644 --- a/tox.ini +++ b/tox.ini @@ -33,7 +33,6 @@ envlist = pretest,test-{api,launcher,server,local_server,multi_server,api_entry, labels = othertests = pretest,test-{workflow,remote_workflow,remote_operator,service},posttest,kill-servers - ciparalleltests = test-{launcher,server,local_server,multi_server,api_entry,custom_type_field,operators},kill-servers isolated_build_env = build @@ -121,7 +120,7 @@ depends = pretest setenv = # Pytest extra arguments - COVERAGE = --cov=ansys.dpf.core --cov-report=xml --cov-report=html --cov-append + COVERAGE = --cov=ansys.dpf.core --cov-report=xml --cov-report=html --log-level=ERROR --cov-append RERUNS = --reruns=2 --reruns-delay=1 DEBUG = -v -s --durations=10 --durations-min=1.0 From 78bea21f80cd891402fe3d69d95ef0df2522a0a4 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Mon, 3 Feb 2025 11:45:29 +0100 Subject: [PATCH 41/59] ci: larger runners testing time improvements --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9a46ac59fd..a7b38db59f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -97,7 +97,7 @@ jobs: fail-fast: false matrix: python-version: ${{ fromJSON(needs.setup.outputs.python_versions) }} - os: ["windows-latest", "ubuntu-latest"] + os: ["windows-latest", "public-ubuntu-latest-16-cores"] steps: - uses: actions/checkout@v4 @@ -134,7 +134,7 @@ jobs: run: | if [ ${{ inputs.test_any }} == 'true' ]; then export platform="any" - elif [ ${{ matrix.os }} == "ubuntu-latest" ]; then + elif [ ${{ matrix.os }} == "public-ubuntu-latest-16-cores" ]; then export platform="manylinux_2_17" else export platform="win" @@ -220,13 +220,13 @@ jobs: shell: bash run: | if [ $MODE == 'PIP' ]; then - if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then + if [ ${{ matrix.os }} == 'public-ubuntu-latest-16-cores' ]; then echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}"' >> "$GITHUB_OUTPUT" fi else - if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then + if [ ${{ matrix.os }} == 'public-ubuntu-latest-16-cores' ]; then echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }}' >> "$GITHUB_OUTPUT" From 61138af29a37db99ea6d24114a9a512f762eb40f Mon Sep 17 00:00:00 2001 From: moe-ad Date: Mon, 3 Feb 2025 14:38:18 +0100 Subject: [PATCH 42/59] ci: empty commit to see caching effect From eb1e27339b8c5a7ee946af2536d29efff84654b4 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Mon, 3 Feb 2025 21:21:17 +0100 Subject: [PATCH 43/59] ci: run without coverage and junit --- .github/workflows/tests.yml | 8 ++++---- requirements/requirements_test.txt | 1 - tox.ini | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a7b38db59f..9a46ac59fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -97,7 +97,7 @@ jobs: fail-fast: false matrix: python-version: ${{ fromJSON(needs.setup.outputs.python_versions) }} - os: ["windows-latest", "public-ubuntu-latest-16-cores"] + os: ["windows-latest", "ubuntu-latest"] steps: - uses: actions/checkout@v4 @@ -134,7 +134,7 @@ jobs: run: | if [ ${{ inputs.test_any }} == 'true' ]; then export platform="any" - elif [ ${{ matrix.os }} == "public-ubuntu-latest-16-cores" ]; then + elif [ ${{ matrix.os }} == "ubuntu-latest" ]; then export platform="manylinux_2_17" else export platform="win" @@ -220,13 +220,13 @@ jobs: shell: bash run: | if [ $MODE == 'PIP' ]; then - if [ ${{ matrix.os }} == 'public-ubuntu-latest-16-cores' ]; then + if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}" -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.deps+="-e dpf-standalone/v${{inputs.ANSYS_VERSION}}"' >> "$GITHUB_OUTPUT" fi else - if [ ${{ matrix.os }} == 'public-ubuntu-latest-16-cores' ]; then + if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv.commands_pre+="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"' >> "$GITHUB_OUTPUT" else echo 'TOX_EXTRA_ARG=--installpkg dist/${{ steps.wheel.outputs.wheel_name }}' >> "$GITHUB_OUTPUT" diff --git a/requirements/requirements_test.txt b/requirements/requirements_test.txt index 5501bacabe..2a1218b197 100644 --- a/requirements/requirements_test.txt +++ b/requirements/requirements_test.txt @@ -6,6 +6,5 @@ pytest==8.3.4 pytest-cov==5.0.0 pytest-order==1.3.0 pytest-rerunfailures==15.0 -pytest-xdist==3.6.1 pyvista==0.44.2 vtk==9.3.1 diff --git a/tox.ini b/tox.ini index b98ef70eb4..30917f852e 100644 --- a/tox.ini +++ b/tox.ini @@ -155,7 +155,7 @@ setenv = TMP = {env_tmp_dir} commands = - python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} {posargs} + python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:RERUNS} #{env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} {posargs} [testenv:doc-{clean,links,html}] description = Environment for documentation generation From 20d4dd8b9fa77369edc9f06aa866773889793cb5 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Mon, 3 Feb 2025 21:58:22 +0100 Subject: [PATCH 44/59] ci: run without coverage only --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 30917f852e..d235d4a088 100644 --- a/tox.ini +++ b/tox.ini @@ -155,7 +155,7 @@ setenv = TMP = {env_tmp_dir} commands = - python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:RERUNS} #{env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} {posargs} + python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:RERUNS} {env:JUNITXML} #{env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} {posargs} [testenv:doc-{clean,links,html}] description = Environment for documentation generation From 6f79b6652a044bdae7d34a101e0d82f7e9eb335c Mon Sep 17 00:00:00 2001 From: moe-ad Date: Mon, 3 Feb 2025 22:34:57 +0100 Subject: [PATCH 45/59] ci: run with pytest-cov version bumped --- requirements/requirements_test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements_test.txt b/requirements/requirements_test.txt index 2a1218b197..a86ea71a61 100644 --- a/requirements/requirements_test.txt +++ b/requirements/requirements_test.txt @@ -3,7 +3,7 @@ coverage==7.6.8 imageio==2.36.0 imageio-ffmpeg==0.5.1 pytest==8.3.4 -pytest-cov==5.0.0 +pytest-cov==6.0.0 pytest-order==1.3.0 pytest-rerunfailures==15.0 pyvista==0.44.2 From 1380b72475bebc57e1ef9d7aa72d3eb01900b82d Mon Sep 17 00:00:00 2001 From: moe-ad Date: Mon, 3 Feb 2025 22:48:14 +0100 Subject: [PATCH 46/59] ci: run with pytest-cov version bumped --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index d235d4a088..df5b63b25d 100644 --- a/tox.ini +++ b/tox.ini @@ -155,7 +155,7 @@ setenv = TMP = {env_tmp_dir} commands = - python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:RERUNS} {env:JUNITXML} #{env:DEBUG} {env:COVERAGE} {env:RERUNS} {env:JUNITXML} {posargs} + python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:RERUNS} {env:JUNITXML} {env:COVERAGE} {posargs} [testenv:doc-{clean,links,html}] description = Environment for documentation generation From 60418f3c21fb055f2a91350e9e226c799840d899 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Mon, 3 Feb 2025 23:20:04 +0100 Subject: [PATCH 47/59] ci: test a fix --- tox.ini | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index df5b63b25d..5f8d499e6b 100644 --- a/tox.ini +++ b/tox.ini @@ -42,12 +42,13 @@ description = Default configuration for test environments, unless overridden uv_seed = true pass_env = - PACKAGE_NAME - MODULE - ANSYS_DPF_ACCEPT_LA - ANSYSLMD_LICENSE_FILE - AWP_ROOT* - ANSYS_DPF_PATH + * + ; PACKAGE_NAME + ; MODULE + ; ANSYS_DPF_ACCEPT_LA + ; ANSYSLMD_LICENSE_FILE + ; AWP_ROOT* + ; ANSYS_DPF_PATH deps = -r requirements/requirements_test.txt From 182d6566b8d80d9dbc4efb9168133ffc1853bbca Mon Sep 17 00:00:00 2001 From: moe-ad Date: Mon, 3 Feb 2025 23:55:03 +0100 Subject: [PATCH 48/59] ci: bump coverage version --- requirements/requirements_test.txt | 2 +- tox.ini | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/requirements/requirements_test.txt b/requirements/requirements_test.txt index a86ea71a61..7db4fb9f78 100644 --- a/requirements/requirements_test.txt +++ b/requirements/requirements_test.txt @@ -1,5 +1,5 @@ ansys-platform-instancemanagement==1.1.2 -coverage==7.6.8 +coverage==7.6.10 imageio==2.36.0 imageio-ffmpeg==0.5.1 pytest==8.3.4 diff --git a/tox.ini b/tox.ini index 5f8d499e6b..df5b63b25d 100644 --- a/tox.ini +++ b/tox.ini @@ -42,13 +42,12 @@ description = Default configuration for test environments, unless overridden uv_seed = true pass_env = - * - ; PACKAGE_NAME - ; MODULE - ; ANSYS_DPF_ACCEPT_LA - ; ANSYSLMD_LICENSE_FILE - ; AWP_ROOT* - ; ANSYS_DPF_PATH + PACKAGE_NAME + MODULE + ANSYS_DPF_ACCEPT_LA + ANSYSLMD_LICENSE_FILE + AWP_ROOT* + ANSYS_DPF_PATH deps = -r requirements/requirements_test.txt From 4b6382256a90f98719680f2a829445b7b323a3a9 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Tue, 4 Feb 2025 09:38:46 +0100 Subject: [PATCH 49/59] ci: remove coverage dep --- requirements/requirements_test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements_test.txt b/requirements/requirements_test.txt index 7db4fb9f78..962dd25fcd 100644 --- a/requirements/requirements_test.txt +++ b/requirements/requirements_test.txt @@ -1,5 +1,5 @@ ansys-platform-instancemanagement==1.1.2 -coverage==7.6.10 +# coverage==7.6.10 imageio==2.36.0 imageio-ffmpeg==0.5.1 pytest==8.3.4 From 815c9eb0117d37c21f150a1178451ebfb04ea6f4 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Tue, 4 Feb 2025 10:09:45 +0100 Subject: [PATCH 50/59] ci: check if coverage is using compiled C extensions --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index df5b63b25d..ba1f952be5 100644 --- a/tox.ini +++ b/tox.ini @@ -155,6 +155,7 @@ setenv = TMP = {env_tmp_dir} commands = + coverage --version python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:RERUNS} {env:JUNITXML} {env:COVERAGE} {posargs} [testenv:doc-{clean,links,html}] From 6d6fa88fab8bce43926c524b7f4c55d324133676 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Tue, 4 Feb 2025 11:18:47 +0100 Subject: [PATCH 51/59] ci: check effect of html/xml reporting --- requirements/requirements_test.txt | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/requirements_test.txt b/requirements/requirements_test.txt index 962dd25fcd..7db4fb9f78 100644 --- a/requirements/requirements_test.txt +++ b/requirements/requirements_test.txt @@ -1,5 +1,5 @@ ansys-platform-instancemanagement==1.1.2 -# coverage==7.6.10 +coverage==7.6.10 imageio==2.36.0 imageio-ffmpeg==0.5.1 pytest==8.3.4 diff --git a/tox.ini b/tox.ini index ba1f952be5..34e3cb0477 100644 --- a/tox.ini +++ b/tox.ini @@ -120,7 +120,7 @@ depends = pretest setenv = # Pytest extra arguments - COVERAGE = --cov=ansys.dpf.core --cov-report=xml --cov-report=html --log-level=ERROR --cov-append + COVERAGE = --cov=ansys.dpf.core --log-level=ERROR --cov-append #--cov-report=xml --cov-report=html RERUNS = --reruns=2 --reruns-delay=1 DEBUG = -v -s --durations=10 --durations-min=1.0 From cb79b6c0cc687ed0e0a2e2a525fa171390ca31e5 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Tue, 4 Feb 2025 12:39:22 +0100 Subject: [PATCH 52/59] ci: use system-wide coverage/pytest-cov --- tox.ini | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 34e3cb0477..f86d9b2ed5 100644 --- a/tox.ini +++ b/tox.ini @@ -50,7 +50,17 @@ pass_env = ANSYS_DPF_PATH deps = - -r requirements/requirements_test.txt + ; -r requirements/requirements_test.txt + ansys-platform-instancemanagement==1.1.2 + ; coverage==7.6.10 + imageio==2.36.0 + imageio-ffmpeg==0.5.1 + pytest==8.3.4 + ; pytest-cov==6.0.0 + pytest-order==1.3.0 + pytest-rerunfailures==15.0 + pyvista==0.44.2 + vtk==9.3.1 [testenv:build-wheel] description = Environment for custom build of package wheels @@ -120,9 +130,10 @@ depends = pretest setenv = # Pytest extra arguments - COVERAGE = --cov=ansys.dpf.core --log-level=ERROR --cov-append #--cov-report=xml --cov-report=html + COVERAGE = --cov=ansys.dpf.core --cov-report=xml --cov-report=html --log-level=ERROR --cov-append RERUNS = --reruns=2 --reruns-delay=1 DEBUG = -v -s --durations=10 --durations-min=1.0 + VIRTUALENV_SYSTEM_SITE_PACKAGES = true api: JUNITXML = --junitxml=tests/junit/test-results.xml launcher: JUNITXML = --junitxml=tests/junit/test-results2.xml @@ -155,7 +166,6 @@ setenv = TMP = {env_tmp_dir} commands = - coverage --version python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:RERUNS} {env:JUNITXML} {env:COVERAGE} {posargs} [testenv:doc-{clean,links,html}] From b0ae47629e5b74be6dc85072d2ecab6856af240e Mon Sep 17 00:00:00 2001 From: moe-ad Date: Tue, 4 Feb 2025 13:11:26 +0100 Subject: [PATCH 53/59] ci: check influence of system wide installs --- .github/workflows/tests.yml | 27 +++++++++++++++------------ tox.ini | 13 +------------ 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9a46ac59fd..b5051ba7d0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -202,18 +202,21 @@ jobs: 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: "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: "Prepare Testing Environment" + # uses: ansys/pydpf-actions/prepare_tests@v2.3 + # with: + # DEBUG: true + + # - 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: "Setup headless display" + uses: pyvista/setup-headless-display-action@v3 - name: "Set tox extra CLI arguments" id: tox-cli-arguments diff --git a/tox.ini b/tox.ini index f86d9b2ed5..df5b63b25d 100644 --- a/tox.ini +++ b/tox.ini @@ -50,17 +50,7 @@ pass_env = ANSYS_DPF_PATH deps = - ; -r requirements/requirements_test.txt - ansys-platform-instancemanagement==1.1.2 - ; coverage==7.6.10 - imageio==2.36.0 - imageio-ffmpeg==0.5.1 - pytest==8.3.4 - ; pytest-cov==6.0.0 - pytest-order==1.3.0 - pytest-rerunfailures==15.0 - pyvista==0.44.2 - vtk==9.3.1 + -r requirements/requirements_test.txt [testenv:build-wheel] description = Environment for custom build of package wheels @@ -133,7 +123,6 @@ setenv = COVERAGE = --cov=ansys.dpf.core --cov-report=xml --cov-report=html --log-level=ERROR --cov-append RERUNS = --reruns=2 --reruns-delay=1 DEBUG = -v -s --durations=10 --durations-min=1.0 - VIRTUALENV_SYSTEM_SITE_PACKAGES = true api: JUNITXML = --junitxml=tests/junit/test-results.xml launcher: JUNITXML = --junitxml=tests/junit/test-results2.xml From ec67550173e66ad7ed04a3a441bcc1ffdd03c89e Mon Sep 17 00:00:00 2001 From: moe-ad Date: Tue, 4 Feb 2025 16:23:00 +0100 Subject: [PATCH 54/59] ci: effect of separate coverage file --- .github/workflows/tests.yml | 47 +++++++++++++++++-------------------- tox.ini | 1 + 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b5051ba7d0..7b15f33eeb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -202,21 +202,18 @@ jobs: 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: "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: "Prepare Testing Environment" + uses: ansys/pydpf-actions/prepare_tests@v2.3 + with: + DEBUG: true - - name: "Setup headless display" - uses: pyvista/setup-headless-display-action@v3 + - 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: "Set tox extra CLI arguments" id: tox-cli-arguments @@ -337,15 +334,15 @@ jobs: command: | tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - - 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 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: "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' || '' }} diff --git a/tox.ini b/tox.ini index df5b63b25d..6c1de788e2 100644 --- a/tox.ini +++ b/tox.ini @@ -123,6 +123,7 @@ setenv = COVERAGE = --cov=ansys.dpf.core --cov-report=xml --cov-report=html --log-level=ERROR --cov-append RERUNS = --reruns=2 --reruns-delay=1 DEBUG = -v -s --durations=10 --durations-min=1.0 + COVERAGE_FILE = {env_dir}/.coverage api: JUNITXML = --junitxml=tests/junit/test-results.xml launcher: JUNITXML = --junitxml=tests/junit/test-results2.xml From f79390a4902b0c008d88b0209217f8c78113537f Mon Sep 17 00:00:00 2001 From: moe-ad Date: Tue, 4 Feb 2025 18:04:33 +0100 Subject: [PATCH 55/59] ci: test fix --- .github/workflows/tests.yml | 31 +++++++++++++++++++------------ tox.ini | 15 +++++++++++++-- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b15f33eeb..9b65a1907b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -334,15 +334,22 @@ jobs: command: | tox -e test-operators,kill-servers ${{ steps.tox-cli-arguments.outputs.TOX_EXTRA_ARG }} - # - 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: "Combine coverage results" + shell: bash + run: | + tox -e report + + - 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 + disable_search: true + file: ./.tox/.cov/coverage.xml + 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' || '' }} diff --git a/tox.ini b/tox.ini index 6c1de788e2..a9f1645b18 100644 --- a/tox.ini +++ b/tox.ini @@ -120,10 +120,10 @@ depends = pretest setenv = # Pytest extra arguments - COVERAGE = --cov=ansys.dpf.core --cov-report=xml --cov-report=html --log-level=ERROR --cov-append + COVERAGE = --cov=ansys.dpf.core --log-level=ERROR RERUNS = --reruns=2 --reruns-delay=1 DEBUG = -v -s --durations=10 --durations-min=1.0 - COVERAGE_FILE = {env_dir}/.coverage + COVERAGE_FILE = {work_dir}/.cov/.coverage.{env_name} api: JUNITXML = --junitxml=tests/junit/test-results.xml launcher: JUNITXML = --junitxml=tests/junit/test-results2.xml @@ -158,6 +158,17 @@ setenv = commands = python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:RERUNS} {env:JUNITXML} {env:COVERAGE} {posargs} +[testenv:report] +skip_install = true + +deps = coverage + +change_dir = {work_dir}/.cov + +commands = + coverage combine + coverage xml + [testenv:doc-{clean,links,html}] description = Environment for documentation generation From 9a714acbcca247272ef5138b92ad78fcb0239158 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Tue, 4 Feb 2025 18:55:00 +0100 Subject: [PATCH 56/59] ci: update codecov action --- .github/workflows/tests.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9b65a1907b..47c834e083 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -346,10 +346,9 @@ jobs: path: tests/junit/test-results.xml - name: "Upload coverage to Codecov" - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} # required - disable_search: true - file: ./.tox/.cov/coverage.xml + files: ./.tox/.cov/coverage.xml 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' || '' }} From d7585bbeabd28371289588fac5b6f7f18a29219e Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 5 Feb 2025 09:28:21 +0100 Subject: [PATCH 57/59] ci: review suggestions + additional optimizations --- .github/workflows/tests.yml | 4 ++-- tox.ini | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 47c834e083..64bfd17484 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -346,9 +346,9 @@ jobs: path: tests/junit/test-results.xml - name: "Upload coverage to Codecov" - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} # required - files: ./.tox/.cov/coverage.xml + file: ./.tox/.cov/coverage.xml 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' || '' }} diff --git a/tox.ini b/tox.ini index a9f1645b18..54e7e19449 100644 --- a/tox.ini +++ b/tox.ini @@ -158,7 +158,7 @@ setenv = commands = python -m pytest {env:PYTEST_PYTHON_FILES} {env:DEBUG} {env:RERUNS} {env:JUNITXML} {env:COVERAGE} {posargs} -[testenv:report] +[testenv:covreport] skip_install = true deps = coverage @@ -168,6 +168,7 @@ change_dir = {work_dir}/.cov commands = coverage combine coverage xml + coverage erase # deletes only .coverage data file, otherwise codecov action will generate coverage.xml report again [testenv:doc-{clean,links,html}] description = Environment for documentation generation From 6ec7bc4afb93eb0342680eb75782cbd3da910059 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 5 Feb 2025 09:46:34 +0100 Subject: [PATCH 58/59] ci: correction --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 64bfd17484..774918d704 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -337,7 +337,7 @@ jobs: - name: "Combine coverage results" shell: bash run: | - tox -e report + tox -e covreport - name: "Upload Test Results" uses: actions/upload-artifact@v4 From 23645175c5e65507792068c750381dd93a093777 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 5 Feb 2025 10:17:02 +0100 Subject: [PATCH 59/59] ci: suppress printing report info to stdout --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 54e7e19449..d89e3b7d75 100644 --- a/tox.ini +++ b/tox.ini @@ -120,7 +120,7 @@ depends = pretest setenv = # Pytest extra arguments - COVERAGE = --cov=ansys.dpf.core --log-level=ERROR + COVERAGE = --cov=ansys.dpf.core --log-level=ERROR --cov-report= RERUNS = --reruns=2 --reruns-delay=1 DEBUG = -v -s --durations=10 --durations-min=1.0 COVERAGE_FILE = {work_dir}/.cov/.coverage.{env_name}