From 1f96704d97e6a9e6f7b06a94ddf3b2e0bdc1f9dd Mon Sep 17 00:00:00 2001 From: Tim Paine Date: Thu, 8 Feb 2024 12:16:17 -0500 Subject: [PATCH] Skip profiler test segment that relies on graphviz Signed-off-by: Tim Paine --- .github/workflows/build.yml | 12 +++++------- csp/tests/test_profiler.py | 9 ++++++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c79a29a14..d93393e84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 . diff --git a/csp/tests/test_profiler.py b/csp/tests/test_profiler.py index ee26e22c0..a97ca168c 100644 --- a/csp/tests/test_profiler.py +++ b/csp/tests/test_profiler.py @@ -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(): @@ -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)