Commit a74c1518 authored by Thomas Dowrick's avatar Thomas Dowrick
Browse files

Try to fix Mac CI [skip build]

parent 6907aad1
Pipeline #1945 canceled with stage
in 5 minutes and 57 seconds
......@@ -10,52 +10,47 @@ stages:
- deploy
build docs:
.build-install-template: &build-install-template
stage: build
except:
variables:
- $CI_COMMIT_MESSAGE =~ /\[skip[ _-]build?\]/i
script:
- tox -e docs
tags:
- shared-linux
- tox -e installer
artifacts:
paths:
- doc/
- dist/
expire_in: 1 week
build linux installer:
build docs:
stage: build
except:
variables:
- $CI_COMMIT_MESSAGE =~ /\[skip[ _-]build?\]/i
script:
- tox -e installer
- tox -e docs
tags:
- shared-linux
- shared-linux, gui
artifacts:
paths:
- dist/
- doc/
expire_in: 1 week
build linux installer:
<<: *build-install-template
tags:
- shared-linux, gui
build mac installer:
stage: build
script:
- tox -e installer
<<: *build-install-template
tags:
- shared-mac
artifacts:
paths:
- dist/
expire_in: 1 week
- shared-mac, gui
build windows installer:
stage: build
script:
- tox -e installer
<<: *build-install-template
tags:
- shared-win, gui
artifacts:
paths:
- dist/
expire_in: 1 week
test Linux:
stage: test
......
......@@ -5,25 +5,6 @@ from sksurgerydavinci.widgets import Viewers
from sksurgeryvtk.models.vtk_surface_model_directory_loader \
import VTKSurfaceModelDirectoryLoader
# # GUI tests causing error on Linux CI-machine.
# in_gitlab_ci = str(os.environ.get('GITLAB_CI'))
# print("Gitlab_CI: " + in_gitlab_ci)
# if sys.platform == "linux" and in_gitlab_ci:
# pytest.skip("skipping GUI tests on linux CI", allow_module_level=True)
@pytest.fixture()
def mono_viewer(qtbot):
mono_viewer = Viewers.MonoViewer('tests/data/test_video.avi')
qtbot.addWidget(mono_viewer)
vtk_model_path = 'inputs/Liver'
vtk_model_loader = VTKSurfaceModelDirectoryLoader(vtk_model_path)
mono_viewer.add_vtk_models(vtk_model_loader.models)
mono_viewer.start()
return mono_viewer
def test_opacity_slider_for_correct_opacity(qtbot):
mono_viewer = Viewers.MonoViewer('tests/data/test_video.avi')
......@@ -61,12 +42,21 @@ def test_opacity_slider_for_incorrect_opacity(qtbot):
assert vtk_model.actor.GetProperty().GetOpacity() != 0.5
def test_model_visibilty_toggle(mono_viewer):
def test_model_visibilty_toggle(qtbot):
mono_viewer = Viewers.MonoViewer('tests/data/test_video.avi')
qtbot.addWidget(mono_viewer)
vtk_model_path = 'inputs/Liver'
vtk_model_loader = VTKSurfaceModelDirectoryLoader(vtk_model_path)
mono_viewer.add_vtk_models(vtk_model_loader.models)
mono_viewer.start()
# This test is freezing on Mac CI machine.
# Fine on Windows/Linux
if sys.platform == "darwin":
pytest.skip("Skipping test on OS X")
# # This test is freezing on Mac CI machine.
# # Fine on Windows/Linux
# if sys.platform == "darwin":
# pytest.skip("Skipping test on OS X")
for vtk_model in mono_viewer.UI.vtk_models:
vtk_model.toggle_visibility()
......
......@@ -36,10 +36,10 @@ def set_central_screen(img, size):
def test_roi_all_black_border():
""" Generated image has black border, then roi e.g.
"""
width, height = 1920, 1080
width, height = 640, 480
crop = AutoCropBlackBorder()
for size in [100, 101, 200, 500, 1000, 1001]:
for size in [100, 101, 200]:
img = np.zeros((height, width, 3), dtype=np.uint8)
expected_roi = set_central_screen(img, size)
......@@ -52,10 +52,10 @@ def test_roi_black_border_first_row_white():
so make sure we can handle this case.
"""
width, height = 1920, 1080
width, height = 640, 480
crop = AutoCropBlackBorder()
for size in [100, 101, 200, 500, 1000, 1001]:
for size in [100, 101, 200]:
img = np.zeros((height, width, 3), dtype=np.uint8)
img[0,:,:] = 255
......@@ -66,7 +66,7 @@ def test_roi_black_border_first_row_white():
def test_no_border():
width, height = 1920, 1080
width, height = 640, 480
crop = AutoCropBlackBorder()
img = 255 * np.ones((height, width, 3), dtype=np.uint8)
......@@ -78,7 +78,7 @@ def test_no_border():
def test_no_border_bottom_right():
width, height = 1920, 1080
width, height = 640, 480
crop = AutoCropBlackBorder()
img = np.zeros((height, width, 3), dtype=np.uint8)
......@@ -92,7 +92,7 @@ def test_no_border_bottom_right():
def test_no_border_top_left():
width, height = 1920, 1080
width, height = 640, 480
crop = AutoCropBlackBorder()
img = np.zeros((height, width, 3), dtype=np.uint8)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment