Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_no_context_lines fails on Big Endian #812

Open
ignatenkobrain opened this issue Aug 10, 2018 · 6 comments
Open

test_no_context_lines fails on Big Endian #812

ignatenkobrain opened this issue Aug 10, 2018 · 6 comments
Labels

Comments

@ignatenkobrain
Copy link
Contributor

======================================================================
FAIL: test_no_context_lines (test.test_patch.PatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pygit2-0.27.1/test/test_patch.py", line 192, in test_no_context_lines
    self.assertEqual(context_count, 0)
AssertionError: 1 != 0
----------------------------------------------------------------------
@ignatenkobrain
Copy link
Contributor Author

Added some print in there and get:

tree c36c20831e43e5984c672a714661870b67ab1d95
author Mark Adams <madams@atlassian.com> 1517510299 -0600
committer Mark Adams <madams@atlassian.com> 1517510441 -0600
Making a GPG signed commit
diff --git a/a/file b/b/file
index a520c24..3b18e51 100644
--- a/a/file
+++ b/b/file
@@ -1,3 +1 @@
 hello world
-hola mundo
-bonjour le monde
+ :
+ /usr/bin/python3 setup.py test --args=-v

@jdavid
Copy link
Member

jdavid commented Mar 7, 2020

There have been major releases of libgit2 (0.99) and pygit2 (1.1); can you try?
Such a low level issue is more likely to be from libgit2, so it may be fixed in the latest release.

@ignatenkobrain
Copy link
Contributor Author

So I have tested 1.2.0 + 1.0.0, one test still fails..

=================================== FAILURES ===================================
_______________________ PatchTest.test_no_context_lines ________________________
self = <test.test_patch.PatchTest testMethod=test_no_context_lines>
    def test_no_context_lines(self):
        old_blob = self.repo[BLOB_OLD_SHA]
        new_blob = self.repo[BLOB_NEW_SHA]
    
        patch = pygit2.Patch.create_from(
            old_blob,
            new_blob,
            old_as_path=BLOB_OLD_PATH,
            new_as_path=BLOB_NEW_PATH,
            context_lines=0,
        )
    
        context_count = len(
            [line for line in patch.text.splitlines() if line.startswith(" ")]
        )
    
>       assert context_count == 0
E       AssertionError: assert 1 == 0
E         -1
E         +0
test/test_patch.py:184: AssertionError

@nmeum
Copy link

nmeum commented May 17, 2020

The test currently fails on our Alpine Linux s390x builders (which is a big endian platform): py3-pygit2-1.2.1-r0.log

algitbot pushed a commit to alpinelinux/aports that referenced this issue May 17, 2020
@jdavid
Copy link
Member

jdavid commented Nov 6, 2020

For the record I've added s390x to Travis and it's still failing, https://travis-ci.org/github/libgit2/pygit2/jobs/741338976#L1507

@jdavid
Copy link
Member

jdavid commented Mar 6, 2022

In PR #1130 @roehling has fixed a bug related to big endian. Maybe this is the same kind of issue. If someone wants to check...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants