Skip to content

Commit 9ce165b

Browse files
authored
Enable docker test (#319)
Update and pull docker image Run docker test only on Linux
1 parent 5394e94 commit 9ce165b

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.github/workflows/Test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ jobs:
4848
'Modelica 4.0.0'
4949
- run: "omc --version"
5050

51+
- name: Pull OpenModelica docker image
52+
if: runner.os != 'Windows'
53+
run: docker pull openmodelica/openmodelica:v1.25.0-minimal
54+
5155
- name: Run pytest
5256
uses: pavelzw/pytest-action@v2
5357
with:

tests/test_docker.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
import OMPython
1+
import sys
22
import pytest
3+
import OMPython
4+
5+
skip_on_windows = pytest.mark.skipif(
6+
sys.platform.startswith("win"),
7+
reason="OpenModelica Docker image is Linux-only; skipping on Windows.",
8+
)
39

410

5-
@pytest.mark.skip(reason="This test would fail")
11+
@skip_on_windows
612
def test_docker():
7-
omcp = OMPython.OMCProcessDocker(docker="openmodelica/openmodelica:v1.16.1-minimal")
13+
omcp = OMPython.OMCProcessDocker(docker="openmodelica/openmodelica:v1.25.0-minimal")
814
om = OMPython.OMCSessionZMQ(omc_process=omcp)
9-
assert om.sendExpression("getVersion()") == "OpenModelica 1.16.1"
15+
assert om.sendExpression("getVersion()") == "OpenModelica 1.25.0"
1016

1117
omcpInner = OMPython.OMCProcessDockerContainer(dockerContainer=omcp.get_docker_container_id())
1218
omInner = OMPython.OMCSessionZMQ(omc_process=omcpInner)
13-
assert omInner.sendExpression("getVersion()") == "OpenModelica 1.16.1"
19+
assert omInner.sendExpression("getVersion()") == "OpenModelica 1.25.0"
1420

15-
omcp2 = OMPython.OMCProcessDocker(docker="openmodelica/openmodelica:v1.16.1-minimal", port=11111)
21+
omcp2 = OMPython.OMCProcessDocker(docker="openmodelica/openmodelica:v1.25.0-minimal", port=11111)
1622
om2 = OMPython.OMCSessionZMQ(omc_process=omcp2)
17-
assert om2.sendExpression("getVersion()") == "OpenModelica 1.16.1"
23+
assert om2.sendExpression("getVersion()") == "OpenModelica 1.25.0"
1824

1925
del omcp2
2026
del om2

0 commit comments

Comments
 (0)