]> granicus.if.org Git - graphviz/commitdiff
Correct 32-bit Windows check in large graphs test
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 30 Jul 2020 06:16:45 +0000 (08:16 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 30 Jul 2020 14:11:12 +0000 (16:11 +0200)
The previous check was true also for 64-bit Windows since in this case
"win32" stands for the Windows API. For details, see:

* https://docs.microsoft.com/en-us/windows/win32/apiindex/windows-api-list
* https://docs.python.org/3/library/sys.html#sys.platform
* https://softwareengineering.stackexchange.com/questions/356464/why-does-software-use-the-win32-name

Note that the new check does not actually check that the Windows OS is
32 bit, but rather that the Python interpreter is. This means that the
test will be skipped in the unlikely event that a 32-bit Python
interpreter is run on a 64-bit Windows OS. This is *not* the case in
our current CI pipeline on gitlab.com. The test does run there.

To check the Windows OS itself seems to be very complicated according
to
https://stackoverflow.com/questions/2208828/detect-64bit-os-windows-in-python/12578715
and none of the solutions worked for me.

Note also that the check does *not* check whether Graphviz has been
compiled for 32-bit or 64-bit which also seems ok according to the
results from our current CI pipeline.

More background can be found at:

* https://gitlab.com/graphviz/graphviz/-/merge_requests/1345
* https://gitlab.com/graphviz/graphviz/-/issues/1710
* https://gitlab.com/graphviz/graphviz/-/merge_requests/1370
* https://gitlab.com/graphviz/graphviz/-/issues/1698

tests/regression_tests/large/test_large_graphs.py

index 7c4d047cebbc9b3ef11832c090c3acccce65fcf2..9bae9b4a017578b20ce65360f801afbf1b45cca5 100644 (file)
@@ -3,10 +3,11 @@ import pytest
 import subprocess\r
 import os\r
 import sys\r
+import platform\r
 \r
 \r
 class TestLargeGraphs():\r
-       @pytest.mark.skipif(sys.platform == 'win32', reason='https://gitlab.com/graphviz/graphviz/-/issues/1710')\r
+       @pytest.mark.skipif(platform.system() == 'Windows' and platform.architecture()[0] == '32bit', reason='https://gitlab.com/graphviz/graphviz/-/issues/1710')\r
        def test_long_chain(self):\r
                """\r
                This test will fail on 32bit Windows machine if compiled with stack size < 16MB.\r