diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50fe891d2b..13f36120a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,6 +125,7 @@ jobs: with: ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }} standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}} + test_any: true secrets: inherit docker_examples: diff --git a/.github/workflows/test_docker.yml b/.github/workflows/test_docker.yml index 6470e81fe8..6323ab7472 100644 --- a/.github/workflows/test_docker.yml +++ b/.github/workflows/test_docker.yml @@ -12,6 +12,11 @@ on: ANSYS_VERSION: required: false type: string + test_any: + description: "Test the any version of the wheel" + required: false + type: string + default: 'false' # Can be called manually workflow_dispatch: inputs: @@ -24,6 +29,11 @@ on: description: "ANSYS version to run." required: false type: string + test_any: + description: "Test the any version of the wheel" + required: false + type: string + default: 'false' env: PACKAGE_NAME: ansys-dpf-core @@ -58,7 +68,9 @@ jobs: - name: "Build the wheel" shell: bash run: | - if [ ${{ matrix.os }} == "ubuntu-latest" ]; then + if [ ${{ inputs.test_any }} == 'true' ]; then + export platform="any" + elif [ ${{ matrix.os }} == "ubuntu-latest" ]; then export platform="manylinux_2_17" else export platform="win" diff --git a/tests/conftest.py b/tests/conftest.py index f241ee23aa..d4a69b390e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -52,6 +52,9 @@ running_docker = ansys.dpf.core.server_types.RUNNING_DOCKER.use_docker local_test_repo = False +# Detect if gatebin binaries are available +IS_USING_GATEBIN = _try_use_gatebin() + def _get_test_files_directory(): if local_test_repo is False: @@ -72,6 +75,10 @@ def _get_test_files_directory(): ) +# Start a first global server to test for version +global_server = core.start_local_server(config=core.AvailableServerConfigs.LegacyGrpcServer) + + @pytest.hookimpl() def pytest_sessionfinish(session, exitstatus): if os.name == "posix": @@ -376,9 +383,6 @@ def return_ds(server=None): ) -IS_USING_GATEBIN = _try_use_gatebin() - - def raises_for_servers_version_under(version): """Launch the test normally if the server version is equal or higher than the "version" parameter. Else it makes sure that the test fails by raising a "DpfVersionNotSupported" @@ -419,8 +423,11 @@ def remove_none_available_config(configs, config_names): configs_out.append(conf) config_names_out.append(conf_name) elif running_docker: + unavailable_configs = [core.AvailableServerConfigs.InProcessServer] + if not IS_USING_GATEBIN: + unavailable_configs.append(core.AvailableServerConfigs.GrpcServer) for conf, conf_name in zip(configs, config_names): - if conf != core.AvailableServerConfigs.InProcessServer: + if conf not in unavailable_configs: configs_out.append(conf) config_names_out.append(conf_name)