Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d87bf7b
added jobs in yml file
jacobrkerstetter Nov 19, 2025
f1dcde4
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 19, 2025
b35fc41
chore: adding changelog file 2389.maintenance.md [dependabot-skip]
pyansys-ci-bot Nov 19, 2025
e662583
fixing typo
jacobrkerstetter Nov 19, 2025
ed35d5e
Merge branch 'ci/add_v1_testing' of https://github.com/ansys/pyansys-…
jacobrkerstetter Nov 19, 2025
c698462
Merge branch 'main' into ci/add_v1_testing
jacobrkerstetter Nov 19, 2025
fdc81f3
fixing docstring
jacobrkerstetter Nov 19, 2025
9063b89
Merge branch 'ci/add_v1_testing' of https://github.com/ansys/pyansys-…
jacobrkerstetter Nov 19, 2025
95859f7
change image upload name for v1 testing
jacobrkerstetter Nov 19, 2025
1b698dd
fix argument changed name
jacobrkerstetter Nov 19, 2025
8b45bae
adding v1 tag to artifacts
jacobrkerstetter Nov 19, 2025
2ba3b55
removed stable/unstable logic
jacobrkerstetter Nov 20, 2025
bb46270
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 20, 2025
27aff7d
Merge branch 'main' into ci/add_v1_testing
jacobrkerstetter Nov 20, 2025
50cbaa6
moved v1 testing to separate dispatch only workflow
jacobrkerstetter Nov 20, 2025
9b726c7
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 20, 2025
ba4bebd
adding permissions
jacobrkerstetter Nov 20, 2025
f9782db
Merge branch 'ci/add_v1_testing' of https://github.com/ansys/pyansys-…
jacobrkerstetter Nov 20, 2025
ff2c915
Merge branch 'main' into ci/add_v1_testing
RobPasMue Nov 21, 2025
7a1cba4
Update .github/workflows/v1_testing.yml
RobPasMue Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 160 additions & 0 deletions .github/workflows/v1_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
name: v1 Protos Testing
on:
workflow_dispatch:

env:
MAIN_PYTHON_VERSION: '3.13'
ANSRV_GEO_IMAGE: 'ghcr.io/ansys/geometry'
ANSRV_GEO_PORT: 700
ANSRV_GEO_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
GEO_CONT_NAME: ans_geo
RESET_IMAGE_CACHE: 0

permissions:
contents: read
packages: read

jobs:
testing-windows-v1:
name: Testing and coverage (Windows - v1 Protos)
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.13']

steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: ${{ matrix.python-version }}

- name: Set up headless display
uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2

- name: Install packages for testing
run: |
python -m pip install --upgrade pip
pip install --upgrade build wheel
pip install -e . --group tests

- name: Login to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download Geometry service container (if needed)
env:
FULL_IMAGE_NAME: "${{ env.ANSRV_GEO_IMAGE }}:core-windows-latest"
run: |
Write-Host "Pulling Docker image: $env:FULL_IMAGE_NAME"
docker pull $env:FULL_IMAGE_NAME

- name: Start Geometry service and verify start
env:
FULL_IMAGE_NAME: "${{ env.ANSRV_GEO_IMAGE }}:core-windows-latest"
PORT_MAPPING: "${{ env.ANSRV_GEO_PORT }}:50051"
TRANSPORT_MODE_SELECTION: ${{ secrets.TRANSPORT_MODE_SELECTION }}
run: |
# Write command to file launch.txt for sanitizing purposes
echo "docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER -p $env:PORT_MAPPING $env:FULL_IMAGE_NAME $env:TRANSPORT_MODE_SELECTION" | Out-File -FilePath launch.txt
# Read the file and execute the command
$command = Get-Content -Path launch.txt | Select-String -Pattern "docker run"
Invoke-Expression $command.Line
Start-Sleep -Seconds 10
python -c "from ansys.geometry.core.connection.validate import validate; validate()"

- name: Restore images cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .\tests\integration\image_cache
key: pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
restore-keys: pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}
lookup-only: true

- name: Testing
timeout-minutes: 20 # Sometimes hangs...
run: |
pytest -v --proto-version=v1

- name: Stop the Geometry service
if: always()
run: |
docker stop $env:GEO_CONT_NAME
docker logs $env:GEO_CONT_NAME
docker rm $env:GEO_CONT_NAME

testing-linux-v1:
name: Testing and coverage (Linux - v1 Protos)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.13']

steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: ${{ matrix.python-version }}

- name: Set up headless display
uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2

- name: Install packages for testing
run: |
python -m pip install --upgrade pip
pip install --upgrade build wheel
pip install -e . --group tests

- name: Login to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download Geometry service container (if needed)
env:
FULL_IMAGE_NAME: "${{ env.ANSRV_GEO_IMAGE }}:core-linux-latest"
run: |
echo "Pulling Docker image: ${FULL_IMAGE_NAME}"
docker pull ${FULL_IMAGE_NAME}

- name: Start Geometry service and verify start
env:
FULL_IMAGE_NAME: "${{ env.ANSRV_GEO_IMAGE }}:core-linux-latest"
TRANSPORT_MODE_SELECTION: ${{ secrets.TRANSPORT_MODE_SELECTION }}
run: |
docker run --detach --name ${GEO_CONT_NAME} -e LICENSE_SERVER=${ANSRV_GEO_LICENSE_SERVER} -p ${ANSRV_GEO_PORT}:50051 ${FULL_IMAGE_NAME} ${TRANSPORT_MODE_SELECTION}
python -c "from ansys.geometry.core.connection.validate import validate; validate()"

- name: Restore images cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: tests/integration/image_cache
key: pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
restore-keys: pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}
lookup-only: true

- name: Testing
timeout-minutes: 20 # Sometimes hangs...
run: |
pytest -v --proto-version=v1

- name: Stop the Geometry service
if: always()
run: |
docker stop ${GEO_CONT_NAME}
docker logs ${GEO_CONT_NAME}
docker rm ${GEO_CONT_NAME}
1 change: 1 addition & 0 deletions doc/changelog.d/2389.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adding testing for v1 protos
13 changes: 13 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ def pytest_addoption(parser):
help=("Enable the tracker to update the design. Options: 'yes' or 'no'. By default, 'no'."),
choices=("yes", "no"),
)
parser.addoption(
"--proto-version",
action="store",
default="v0",
help=("Specify the proto version to use for the tests. By default, 'v0'."),
)

parser.addoption(
"--backwards-compatibility",
Expand Down Expand Up @@ -159,6 +165,13 @@ def use_tracker(request):
pyansys_geometry.USE_TRACKER_TO_UPDATE_DESIGN = False


@pytest.fixture(scope="session")
def proto_version(request):
"""Fixture to determine proto files version to be used."""
value: str = request.config.getoption("--proto-version", default="v0")
return value.lower()


@pytest.fixture
def fake_record():
def inner_fake_record(
Expand Down
7 changes: 5 additions & 2 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def docker_instance(use_existing_service):


@pytest.fixture(scope="session")
def session_modeler(docker_instance):
def session_modeler(docker_instance, proto_version):
# Log to file - accepts str or Path objects, Path is passed for testing/coverage purposes.
log_file_path = Path(__file__).absolute().parent / "logs" / "integration_tests_logs.txt"

Expand All @@ -168,7 +168,10 @@ def session_modeler(docker_instance):
pass

modeler = Modeler(
docker_instance=docker_instance, logging_level=logging.DEBUG, logging_file=log_file_path
docker_instance=docker_instance,
logging_level=logging.DEBUG,
logging_file=log_file_path,
proto_version=proto_version,
)

yield modeler
Expand Down
Loading