Skip to content

Commit a62ce6d

Browse files
committed
Run pytest with Fluent docker image
1 parent 305e89b commit a62ce6d

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,20 @@ jobs:
170170
- name: Install pyvistaqt requirements
171171
run: make install-pyvistaqt-requirements
172172

173+
- name: Login to GitHub Container Registry
174+
uses: docker/login-action@v1
175+
with:
176+
registry: ghcr.io
177+
username: ${{ secrets.GH_USERNAME }}
178+
password: ${{ secrets.REPO_DOWNLOAD_PAT }}
179+
180+
- name: Pull Fluent docker image
181+
run: make docker-pull
182+
173183
- name: Unit Testing
174184
run: make unittest
185+
env:
186+
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
175187

176188
- name: Check package
177189
run: |

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ install-pyvistaqt-requirements:
2121
test-import:
2222
@python -c "import ansys.fluent.core as pyfluent"
2323

24+
docker-pull:
25+
@docker pull ghcr.io/pyansys/pyfluent:latest
26+
2427
unittest:
2528
@echo "Running unittest"
2629
@pip install -r requirements_test.txt

tests/docker/test_server.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os
2+
import subprocess
3+
from time import sleep
4+
5+
6+
def test_fluent_server():
7+
license_server = os.getenv("LICENSE_SERVER", "leblnxlic64.ansys.com")
8+
subprocess.run(["docker", "run", "-d", "--rm", "-p", "63084:63084",
9+
"-e", f"ANSYSLMD_LICENSE_FILE=1055@{license_server}",
10+
"-e", "REMOTING_PORTS=63084/portspan=2",
11+
"-e", "FLUENT_LAUNCHED_FROM_PYFLUENT=1",
12+
"ghcr.io/pyansys/pyfluent", "3ddp", "-g",
13+
"-sifile=server.txt"])
14+
sleep(60)
15+
from ansys.fluent.core.session import Session
16+
session = Session("localhost", 63084)
17+
assert session.check_health() == "SERVING"
18+
session.exit()

0 commit comments

Comments
 (0)