Skip to content

Commit

Permalink
Fixup Graphviz install on OSX (#380)
Browse files Browse the repository at this point in the history
* Fixup Graphviz install on OSX

* Brew install [email protected] for pango

* Fix flaky OSX test
  • Loading branch information
josephine-wolf-oberholtzer authored Apr 14, 2024
1 parent 57c4174 commit 5c63c7f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,13 @@ jobs:
if [ "$RUNNER_OS" == "Linux" ]; then
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update --yes
sudo apt-get install --yes \
espeak \
graphviz \
lame
sudo apt-get install --yes espeak graphviz lame
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install \
graphviz
brew update
brew install [email protected] || true
brew install graphviz
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install \
graphviz \
lame
choco install graphviz lame
fi
- name: Run Pytest
run: pytest --cov supriya --showlocals
Expand Down
28 changes: 13 additions & 15 deletions tests/contexts/test_Server_buffers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import asyncio
import concurrent.futures
import logging
import os
import platform
import random
import sys
from pathlib import Path
Expand Down Expand Up @@ -343,23 +341,23 @@ async def test_normalize_buffer(context):

@pytest.mark.asyncio
async def test_query_buffer(context):
sample_rate = 44100.0
if os.environ.get("CI") and platform.system() == "Darwin":
sample_rate = 48000.0 # GHA's OSX BlackHole audio device defaults to 48k
frame_count = random.randint(128, 256)
channel_count = random.randint(1, 8)
buffer = context.add_buffer(channel_count=channel_count, frame_count=frame_count)
await asyncio.sleep(0.1)
assert await get(buffer.query()) == BufferInfo(
items=[
BufferInfo.Item(
buffer_id=0,
frame_count=frame_count,
channel_count=channel_count,
sample_rate=sample_rate,
)
]
)
assert await get(buffer.query()) in [
BufferInfo(
items=[
BufferInfo.Item(
buffer_id=0,
frame_count=frame_count,
channel_count=channel_count,
sample_rate=sample_rate,
)
]
)
for sample_rate in [48000, 44100]
]
# unsync
with context.osc_protocol.capture() as transcript:
assert await get(buffer.query(sync=False)) is None
Expand Down

0 comments on commit 5c63c7f

Please sign in to comment.