Skip to content

Commit

Permalink
xfail tests failing on ppc64le on GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
nulano committed Dec 11, 2020
1 parent 25ce233 commit 9c7fb5b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ def is_big_endian():
return sys.byteorder == "big"


def is_ppc64le():
import platform
return platform.machine() == "ppc64le"


def is_win32():
return sys.platform.startswith("win32")

Expand Down
7 changes: 6 additions & 1 deletion Tests/test_file_eps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from PIL import EpsImagePlugin, Image, features

from .helper import assert_image_similar, hopper, skip_unless_feature
from .helper import assert_image_similar, hopper, is_ppc64le, skip_unless_feature

HAS_GHOSTSCRIPT = EpsImagePlugin.has_ghostscript()

Expand Down Expand Up @@ -59,6 +59,7 @@ def test_invalid_file():
EpsImagePlugin.EpsImageFile(invalid_file)


@pytest.mark.xfail(is_ppc64le(), reason="failing on ppc64le on GHA")
@pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available")
def test_cmyk():
with Image.open("Tests/images/pil_sample_cmyk.eps") as cmyk_image:
Expand All @@ -75,6 +76,7 @@ def test_cmyk():
assert_image_similar(cmyk_image, target, 10)


@pytest.mark.xfail(is_ppc64le(), reason="failing on ppc64le on GHA")
@pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available")
def test_showpage():
# See https://github.com/python-pillow/Pillow/issues/2615
Expand Down Expand Up @@ -102,6 +104,7 @@ def test_iobase_object(tmp_path):
image1.save(fh, "EPS")


@pytest.mark.xfail(is_ppc64le(), reason="failing on ppc64le on GHA")
@pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available")
def test_bytesio_object():
with open(FILE1, "rb") as f:
Expand All @@ -123,6 +126,7 @@ def test_image_mode_not_supported(tmp_path):
im.save(tmpfile)


@pytest.mark.xfail(is_ppc64le(), reason="failing on ppc64le on GHA")
@pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available")
@skip_unless_feature("zlib")
def test_render_scale1():
Expand All @@ -145,6 +149,7 @@ def test_render_scale1():
assert_image_similar(image2_scale1, image2_scale1_compare, 10)


@pytest.mark.xfail(is_ppc64le(), reason="failing on ppc64le on GHA")
@pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available")
@skip_unless_feature("zlib")
def test_render_scale2():
Expand Down
6 changes: 5 additions & 1 deletion Tests/test_imagefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
assert_image_similar,
fromstring,
hopper,
is_ppc64le,
skip_unless_feature,
tostring,
)
Expand Down Expand Up @@ -57,14 +58,17 @@ def roundtrip(format):
assert_image_equal(*roundtrip("TGA"))
assert_image_equal(*roundtrip("PCX"))

if EpsImagePlugin.has_ghostscript():
if EpsImagePlugin.has_ghostscript() and not is_ppc64le():
im1, im2 = roundtrip("EPS")
# This test fails on Ubuntu 12.04, PPC (Bigendian) It
# appears to be a ghostscript 9.05 bug, since the
# ghostscript rendering is wonky and the file is identical
# to that written on ubuntu 12.04 x64
# md5sum: ba974835ff2d6f3f2fd0053a23521d4a

# This test is also failing on PPC little endian on GHA,
# but not on Travis CI

# EPS comes back in RGB:
assert_image_similar(im1, im2.convert("L"), 20)

Expand Down

0 comments on commit 9c7fb5b

Please sign in to comment.