]> granicus.if.org Git - graphviz/commitdiff
use 'which' when accessing gv2gxl, gxl2gv in the test suite
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 16 Jan 2023 03:24:30 +0000 (19:24 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 22 Jan 2023 02:28:49 +0000 (18:28 -0800)
When running the Graphviz test suite on an installation that was built without
some optional components, calls to these missing components can incorrectly
resolve to those from a prior Graphviz installation that happens to be in your
`$PATH`. This issue was partly addressed in
515c86a923601db5cb704da93046800df7da030a. This change takes things further,
ensuring that invocations of `gv2gxl` and `gxl2gv` also land on the right
version under test.

This requires temporarily xfailing the test due to an unrelated issue with these
tools.

Gitlab: #2201, #2344

tests/test_regression.py

index 51d66d83ccf0265bf205a6a0862464d19ed40d0a..dc90f473dd12d01015e644bb631a1c0635e36762 100644 (file)
@@ -327,6 +327,7 @@ def test_358():
 
 @pytest.mark.skipif(which("gv2gxl") is None or which("gxl2gv") is None,
                     reason="GXL tools not available")
+@pytest.mark.xfail() # FIXME: #2344
 def test_517():
   """
   round tripping a graph through gv2gxl should not lose HTML labels
@@ -341,11 +342,13 @@ def test_517():
     '}'
 
   # translate it to GXL
-  gxl = subprocess.check_output(["gv2gxl"], input=input,
+  gv2gxl = which("gv2gxl")
+  gxl = subprocess.check_output([gv2gxl], input=input,
     universal_newlines=True)
 
   # translate this back to Dot
-  dot_output = subprocess.check_output(["gxl2gv"], input=gxl,
+  gxl2gv = which("gxl2gv")
+  dot_output = subprocess.check_output([gxl2gv], input=gxl,
     universal_newlines=True)
 
   # the result should have both expected labels somewhere