Skip to content

Commit

Permalink
Skip profiler test segment that relies on graphviz
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Paine <[email protected]>
  • Loading branch information
timkpaine committed Feb 8, 2024
1 parent 1639530 commit 1f96704
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -466,15 +466,13 @@ jobs:
run: python -m pip install -U *manylinux2014*.whl --target .
if: ${{ runner.os == 'Linux' }}

# Note, on mac we must install the x86 wheel, the arm64 wheel
# would need an arm machine to test
- name: Install wheel (OSX)
- name: Install wheel (OSX x86)
run: python -m pip install -U *x86*.whl --target .
if: ${{ runner.os == 'macOS' && matrix.python-version != '3.11' }}
if: ${{ runner.os == 'macOS' && runner.arch == 'X64' }}

- name: Install wheel (OSX 3.11+)
run: python -m pip install -U *universal*.whl --target .
if: ${{ runner.os == 'macOS' && matrix.python-version == '3.11' }}
- name: Install wheel (OSX arm)
run: python -m pip install -U *arm64*.whl --target .
if: ${{ runner.os == 'macOS' && runner.arch == 'ARM64' }}

- name: Install wheel (windows)
run: python -m pip install -U (Get-ChildItem .\*.whl | Select-Object -Expand FullName) --target .
Expand Down
9 changes: 6 additions & 3 deletions csp/tests/test_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from csp import profiler, ts
from csp.tests.test_dynamic import DynData, gen_basket, random_keys

from .test_showgraph import _cant_find_graphviz


@csp.graph
def stats_graph():
Expand Down Expand Up @@ -153,9 +155,10 @@ def graph3():

with profiler.Profiler() as p:
results = csp.run(graph3, starttime=st, endtime=st + timedelta(seconds=100))
with tempfile.NamedTemporaryFile(prefix="foo", suffix=".png", mode="w") as temp_file:
temp_file.close()
csp.show_graph(graph3, graph_filename=temp_file.name)
if not _cant_find_graphviz():
with tempfile.NamedTemporaryFile(prefix="foo", suffix=".png", mode="w") as temp_file:
temp_file.close()
csp.show_graph(graph3, graph_filename=temp_file.name)

prof = p.results()
self.assertEqual(prof.cycle_count, 100)
Expand Down

0 comments on commit 1f96704

Please sign in to comment.