Skip to content

Commit

Permalink
Skip tests on Windows and MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Feb 18, 2024
1 parent 11fbf08 commit 335f41b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ workflow:

pixi-test:
stage: pixi
image: registry.heptapod.net:443/fluiddyn/fluidsim/ci/default:pixi
image: registry.heptapod.net:443/fluiddyn/fluiddyn/ci/default:pixi
script:
- pixi info
- pixi run install-editable
Expand Down
8 changes: 4 additions & 4 deletions src/fluidimage/test_run_from_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import sys
import unittest

from fluiddyn.io import stdout_redirected

from fluidimage import get_path_image_samples
from fluidimage.run_from_xml import main

path_image_samples = get_path_image_samples()

on_linux = sys.platform == "linux"


class TestRunFromXML(unittest.TestCase):
@classmethod
Expand All @@ -20,10 +20,10 @@ def setUpClass(cls):
def tearDownClass(cls):
os.chdir(cls.current_dir)

@unittest.skipIf(not on_linux, "Only supported on Linux")
def test_main(self):
path = path_image_samples / "Karman/Images.civ/0_XML/Karman_1-4.xml"
command = f"run {str(path)} --mode recompute"
sys.argv = command.split()

with stdout_redirected():
main()
main()
8 changes: 4 additions & 4 deletions src/fluidimage/topologies/test_bos.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import sys
import unittest
from pathlib import Path
from shutil import rmtree

from fluidimage import get_path_image_samples
from fluidimage.topologies.bos import TopologyBOS

on_linux = sys.platform == "linux"


class TestBOSNew(unittest.TestCase):
@classmethod
Expand All @@ -19,6 +22,7 @@ def tearDownClass(cls):
if path_out.exists():
rmtree(path_out, ignore_errors=True)

@unittest.skipIf(not on_linux, "Only supported on Linux")
def test_bos_new_multiproc(self):
params = TopologyBOS.create_default_params()

Expand Down Expand Up @@ -51,7 +55,3 @@ def test_bos_new_multiproc(self):
params.saving.how = "complete"
topology = TopologyBOS(params, logging_level="info")
topology.compute()


if __name__ == "__main__":
unittest.main()
9 changes: 4 additions & 5 deletions src/fluidimage/topologies/test_example.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import unittest
from functools import partialmethod
from shutil import rmtree
Expand All @@ -12,12 +13,14 @@
"exec_sequential",
"exec_async_sequential",
"exec_async",
"multi_exec_async",
"exec_async_multi",
"exec_async_servers",
"exec_async_servers_threading",
]

if sys.platform == "linux":
executors.append("multi_exec_async")


def _test(self, executor=None):
params = TopologyExample.create_default_params()
Expand Down Expand Up @@ -51,7 +54,3 @@ def tearDown(self):
"test_" + str(executor),
partialmethod(_test, executor=executor),
)


if __name__ == "__main__":
unittest.main()
12 changes: 6 additions & 6 deletions src/fluidimage/topologies/test_image2image.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import sys
import unittest
from pathlib import Path
from shutil import rmtree

from fluidimage import get_path_image_samples
from fluidimage.topologies.image2image import TopologyImage2Image

on_linux = sys.platform == "linux"

class TestPivNew(unittest.TestCase):

@unittest.skipIf(not on_linux, "Only supported on Linux")
class TestImage2Image(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.path_src = get_path_image_samples() / "Karman/Images"
Expand All @@ -18,7 +22,7 @@ def tearDownClass(cls):
if path_out.exists():
rmtree(path_out, ignore_errors=True)

def test_piv_new(self):
def test_im2im(self):
params = TopologyImage2Image.create_default_params()

params.images.path = str(self.path_src)
Expand All @@ -36,7 +40,3 @@ def test_piv_new(self):
topology.compute()

topology.make_code_graphviz(topology.path_dir_result / "topo.dot")


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions src/fluidimage/topologies/test_optical_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,3 @@ def test_optical_flow(self):

topology.make_code_graphviz(topology.path_dir_result / "topo.dot")
topology.compute("exec_sequential")


if __name__ == "__main__":
unittest.main()
8 changes: 4 additions & 4 deletions src/fluidimage/topologies/test_piv.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import unittest
from pathlib import Path
from shutil import rmtree
Expand All @@ -8,7 +9,10 @@

path_image_samples = get_path_image_samples()

on_linux = sys.platform == "linux"


@unittest.skipIf(not on_linux, "Only supported on Linux")
class TestPivNew(unittest.TestCase):
@classmethod
def setUpClass(cls):
Expand Down Expand Up @@ -80,7 +84,3 @@ def test_piv_new_multiproc(self):
topology.compute("exec_sequential")

assert len(topology.results) == 1


if __name__ == "__main__":
unittest.main()

0 comments on commit 335f41b

Please sign in to comment.