From: Matthew Fernandez Date: Sun, 25 Oct 2020 03:04:58 +0000 (-0700) Subject: check that Smyrna exists in CI X-Git-Tag: 2.46.0~20^2^2~11^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c42465002e9919b3cb2d5303dc707ebf1f8cb214;p=graphviz check that Smyrna exists in CI Related to #1851. --- diff --git a/ci/tests.py b/ci/tests.py index 279cc98e1..7eb8d7a0a 100644 --- a/ci/tests.py +++ b/ci/tests.py @@ -4,8 +4,33 @@ test cases that are only relevant to run in CI ''' -def test_stub(): +import pytest +import shutil +import subprocess +import os + +@pytest.mark.parametrize('binary', [ + 'smyrna', +]) +def test_existence(binary: str): ''' - a no-op test case to allow pytest to accept this file at first + check that a given binary was built and is on $PATH ''' - pass + + os_id = os.getenv('OS_ID') + + # FIXME: Remove skip when + # https://gitlab.com/graphviz/graphviz/-/issues/1834 is fixed + if os_id == 'centos' and binary == 'smyrna': + check_that_tool_does_not_exist(binary, os_id) + pytest.skip('smyrna is not built for Centos (#1834)') + + assert shutil.which(binary) is not None + +def check_that_tool_does_not_exist(tool, os_id): + assert shutil.which(tool) is None, '{} has been resurrected in the {} ' \ + 'build on {}. Please remove skip.'.format( + tool, + os.getenv('build_system'), + os_id + )