Opt macOS out of automated testing entirely

I spent too much time to day fixing up macOS related issue,
when the wheel for it is not even built properly, so I decide
to solve it all together next time.
This commit is contained in:
Nguyễn Gia Phong 2020-04-24 20:11:49 +07:00
parent 2218d192cb
commit 5ce35416c7
3 changed files with 1 additions and 28 deletions

View File

@ -12,8 +12,7 @@ env:
- CIBW_MANYLINUX_X86_64_IMAGE=manylinux2014 - CIBW_MANYLINUX_X86_64_IMAGE=manylinux2014
- CIBW_BEFORE_BUILD_LINUX=.ci/before-build-manylinux2014 - CIBW_BEFORE_BUILD_LINUX=.ci/before-build-manylinux2014
- CIBW_BEFORE_BUILD_MACOS=.ci/before-build-macos - CIBW_BEFORE_BUILD_MACOS=.ci/before-build-macos
- CIBW_TEST_REQUIRES=tox - CIBW_TEST_REQUIRES_LINUX=tox
- CIBW_TEST_COMMAND_MACOS="tox -c /Users/travis/build/McSinyx/palace"
- CIBW_TEST_COMMAND_LINUX="tox -c /project" - CIBW_TEST_COMMAND_LINUX="tox -c /project"
addons: addons:

View File

@ -18,7 +18,6 @@
# along with palace. If not, see <https://www.gnu.org/licenses/>. # along with palace. If not, see <https://www.gnu.org/licenses/>.
from os.path import abspath, dirname, join from os.path import abspath, dirname, join
from platform import system
from random import choices from random import choices
from subprocess import PIPE, run, CalledProcessError from subprocess import PIPE, run, CalledProcessError
from sys import executable from sys import executable
@ -41,17 +40,12 @@ REVERB_PRESETS = choices(reverb_preset_names, k=5)
WAVEFORMS = ['sine', 'square', 'sawtooth', WAVEFORMS = ['sine', 'square', 'sawtooth',
'triangle', 'impulse', 'white-noise'] 'triangle', 'impulse', 'white-noise']
timeout = mark.timeout(timeout=5, method='signal')
osxfail = mark.xfail(system()=='Darwin', reason='Travis CI for macOS')
def capture(*argv): def capture(*argv):
"""Return the captured standard output of the given Python script.""" """Return the captured standard output of the given Python script."""
return run([executable, *argv], stdout=PIPE).stdout.decode() return run([executable, *argv], stdout=PIPE).stdout.decode()
@osxfail
@timeout
def test_event(aiff, flac, mp3, ogg, wav): def test_event(aiff, flac, mp3, ogg, wav):
"""Test the event handling example.""" """Test the event handling example."""
event = capture(EVENT, aiff, flac, mp3, ogg, wav) event = capture(EVENT, aiff, flac, mp3, ogg, wav)
@ -63,8 +57,6 @@ def test_event(aiff, flac, mp3, ogg, wav):
assert f'Playing {wav}' in event assert f'Playing {wav}' in event
@osxfail
@timeout
def test_hrtf(ogg): def test_hrtf(ogg):
"""Test the HRTF example.""" """Test the HRTF example."""
hrtf = capture(HRTF, ogg) hrtf = capture(HRTF, ogg)
@ -79,8 +71,6 @@ def test_info():
run([executable, INFO, MADEUP_DEVICE], check=True) run([executable, INFO, MADEUP_DEVICE], check=True)
@osxfail
@timeout
def test_latency(mp3): def test_latency(mp3):
"""Test the latency example.""" """Test the latency example."""
latency = capture(LATENCY, mp3) latency = capture(LATENCY, mp3)
@ -89,8 +79,6 @@ def test_latency(mp3):
assert 'Offset' in latency assert 'Offset' in latency
@osxfail
@timeout
@mark.parametrize('preset', REVERB_PRESETS) @mark.parametrize('preset', REVERB_PRESETS)
def test_reverb(preset, flac): def test_reverb(preset, flac):
"""Test the reverb example.""" """Test the reverb example."""
@ -100,8 +88,6 @@ def test_reverb(preset, flac):
assert f'Loading reverb preset {preset}' in reverb assert f'Loading reverb preset {preset}' in reverb
@osxfail
@timeout
def test_stdec(aiff): def test_stdec(aiff):
"""Test the stdec example.""" """Test the stdec example."""
stdec = capture(STDEC, aiff) stdec = capture(STDEC, aiff)

View File

@ -17,7 +17,6 @@
# along with palace. If not, see <https://www.gnu.org/licenses/>. # along with palace. If not, see <https://www.gnu.org/licenses/>.
import aifc import aifc
from platform import system
from unittest.mock import Mock from unittest.mock import Mock
from uuid import uuid4 from uuid import uuid4
@ -25,9 +24,6 @@ from palace import (channel_configs, sample_types, decode,
Device, Context, Buffer, SourceGroup, MessageHandler) Device, Context, Buffer, SourceGroup, MessageHandler)
from pytest import mark from pytest import mark
timeout = mark.timeout(timeout=5, method='signal')
osxfail = mark.xfail(system()=='Darwin', reason='Travis CI for macOS')
def mock(message): def mock(message):
"""Return the MessageHandler corresponding to the given message.""" """Return the MessageHandler corresponding to the given message."""
@ -40,8 +36,6 @@ def test_device_diconnected():
"""Test the handling of device disconnected message.""" """Test the handling of device disconnected message."""
@osxfail
@timeout
def test_source_stopped(wav): def test_source_stopped(wav):
"""Test the handling of source stopped message.""" """Test the handling of source stopped message."""
with Device() as device, Context(device) as context, Buffer(wav) as buffer: with Device() as device, Context(device) as context, Buffer(wav) as buffer:
@ -52,8 +46,6 @@ def test_source_stopped(wav):
context.message_handler.source_stopped.assert_called_with(source) context.message_handler.source_stopped.assert_called_with(source)
@osxfail
@timeout
def test_source_force_stopped(ogg): def test_source_force_stopped(ogg):
"""Test the handling of source force stopped message.""" """Test the handling of source force stopped message."""
with Device() as device, Context(device) as context: with Device() as device, Context(device) as context:
@ -69,8 +61,6 @@ def test_source_force_stopped(ogg):
source.destroy() source.destroy()
@osxfail
@timeout
def test_buffer_loading(aiff): def test_buffer_loading(aiff):
"""Test the handling of buffer loading message.""" """Test the handling of buffer loading message."""
with Device() as device, Context(device) as context: with Device() as device, Context(device) as context:
@ -85,8 +75,6 @@ def test_buffer_loading(aiff):
# TODO: verify data # TODO: verify data
@osxfail
@timeout
def test_resource_not_found(flac): def test_resource_not_found(flac):
"""Test the handling of resource not found message.""" """Test the handling of resource not found message."""
with Device() as device, Context(device) as context: with Device() as device, Context(device) as context: