Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
'Modelica 4.0.0'
- run: "omc --version"

- name: Pull OpenModelica docker image
if: runner.os != 'Windows'
run: docker pull openmodelica/openmodelica:v1.25.0-minimal

- name: Run pytest
uses: pavelzw/pytest-action@v2
with:
Expand Down
20 changes: 13 additions & 7 deletions tests/test_docker.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import OMPython
import sys
import pytest
import OMPython

skip_on_windows = pytest.mark.skipif(
sys.platform.startswith("win"),
reason="OpenModelica Docker image is Linux-only; skipping on Windows.",
)


@pytest.mark.skip(reason="This test would fail")
@skip_on_windows
def test_docker():
omcp = OMPython.OMCProcessDocker(docker="openmodelica/openmodelica:v1.16.1-minimal")
omcp = OMPython.OMCProcessDocker(docker="openmodelica/openmodelica:v1.25.0-minimal")
om = OMPython.OMCSessionZMQ(omc_process=omcp)
assert om.sendExpression("getVersion()") == "OpenModelica 1.16.1"
assert om.sendExpression("getVersion()") == "OpenModelica 1.25.0"

omcpInner = OMPython.OMCProcessDockerContainer(dockerContainer=omcp.get_docker_container_id())
omInner = OMPython.OMCSessionZMQ(omc_process=omcpInner)
assert omInner.sendExpression("getVersion()") == "OpenModelica 1.16.1"
assert omInner.sendExpression("getVersion()") == "OpenModelica 1.25.0"

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

del omcp2
del om2
Expand Down
Loading