brandon-rhodes / python-jplephem

Python version of NASA DE4xx ephemerides, the basis for the Astronomical Alamanac
MIT License
110 stars 29 forks source link

Test failure on BE architectures #51

Closed avalentino closed 2 years ago

avalentino commented 2 years ago

The rest suite of jplephem seems to fail on bigendian machines. On a s390x machine we have the following error

=== python3.10 ===
============================= test session starts ==============================
platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.0.0+repack -- /usr/bin/python3.10
cachedir: .pytest_cache
rootdir: /tmp/autopkgtest-lxc.r516qzx2/downtmp/autopkgtest_tmp
collecting ... collected 46 items / 4 deselected / 42 selected

::TestDAFBytesIO::test_add_segment FAILED                                [  2%]
::TestDAFBytesIO::test_add_segment_when_summary_block_is_full FAILED     [  4%]
::TestDAFBytesIO::test_header PASSED                                     [  7%]
::TestDAFBytesIO::test_segments FAILED                                   [  9%]
::TestDAFRealFile::test_add_segment FAILED                               [ 11%]
::TestDAFRealFile::test_add_segment_when_summary_block_is_full FAILED    [ 14%]
::TestDAFRealFile::test_header PASSED                                    [ 16%]
::TestDAFRealFile::test_segments FAILED                                  [ 19%]
::TestDAFRealFileWithoutMMap::test_add_segment FAILED                    [ 21%]
::TestDAFRealFileWithoutMMap::test_add_segment_when_summary_block_is_full FAILED [ 23%]
::TestDAFRealFileWithoutMMap::test_header PASSED                         [ 26%]
::TestDAFRealFileWithoutMMap::test_segments FAILED                       [ 28%]
::SPKTests::test_array_tdb SKIPPED (the "de421.bsp" SPK file is not ...) [ 30%]
::SPKTests::test_array_tdb_array_tdb2 SKIPPED (the "de421.bsp" SPK f...) [ 33%]
::SPKTests::test_array_tdb_scalar_tdb2 SKIPPED (the "de421.bsp" SPK ...) [ 35%]
::SPKTests::test_ephemeris_end_date SKIPPED (the "de421.bsp" SPK fil...) [ 38%]
::SPKTests::test_jitter SKIPPED (the "de421.bsp" SPK file is not ava...) [ 40%]
::SPKTests::test_loading_array SKIPPED (the "de421.bsp" SPK file is ...) [ 42%]
::SPKTests::test_out_of_range_dates SKIPPED (the "de421.bsp" SPK fil...) [ 45%]
::SPKTests::test_scalar_tdb SKIPPED (the "de421.bsp" SPK file is not...) [ 47%]
::SPKTests::test_scalar_tdb2 SKIPPED (the "de421.bsp" SPK file is no...) [ 50%]
::SPKTests::test_scalar_tdb2_keyword SKIPPED (the "de421.bsp" SPK fi...) [ 52%]
::SPKTests::test_scalar_tdb_array_tdb2 SKIPPED (the "de421.bsp" SPK ...) [ 54%]
::SPKTests::test_scalar_tdb_keyword SKIPPED (the "de421.bsp" SPK fil...) [ 57%]
::SPKTests::test_segment_with_only_two_coefficients SKIPPED (the "de...) [ 59%]
::SPKTests::test_str SKIPPED (the "de421.bsp" SPK file is not available) [ 61%]
::SPKTests::test_too_early_date SKIPPED (the "de421.bsp" SPK file is...) [ 64%]
::SPKTests::test_too_late_date SKIPPED (the "de421.bsp" SPK file is ...) [ 66%]
::LegacyTests::test_array_tdb SKIPPED (the "de421" ephemeris package...) [ 69%]
::LegacyTests::test_array_tdb_array_tdb2 SKIPPED (the "de421" epheme...) [ 71%]
::LegacyTests::test_array_tdb_scalar_tdb2 SKIPPED (the "de421" ephem...) [ 73%]
::LegacyTests::test_ephemeris_end_date SKIPPED (the "de421" ephemeri...) [ 76%]
::LegacyTests::test_jitter SKIPPED (the "de421" ephemeris package ha...) [ 78%]
::LegacyTests::test_legacy_compute_method SKIPPED (the "de421" ephem...) [ 80%]
::LegacyTests::test_names SKIPPED (the "de421" ephemeris package has...) [ 83%]
::LegacyTests::test_scalar_tdb SKIPPED (the "de421" ephemeris packag...) [ 85%]
::LegacyTests::test_scalar_tdb2 SKIPPED (the "de421" ephemeris packa...) [ 88%]
::LegacyTests::test_scalar_tdb2_keyword SKIPPED (the "de421" ephemer...) [ 90%]
::LegacyTests::test_scalar_tdb_array_tdb2 SKIPPED (the "de421" ephem...) [ 92%]
::LegacyTests::test_scalar_tdb_keyword SKIPPED (the "de421" ephemeri...) [ 95%]
::LegacyTests::test_too_early_date SKIPPED (the "de421" ephemeris pa...) [ 97%]
::LegacyTests::test_too_late_date SKIPPED (the "de421" ephemeris pac...) [100%]

=================================== FAILURES ===================================
_______________________ TestDAFBytesIO.test_add_segment ________________________

self = <jplephem.test.TestDAFBytesIO testMethod=test_add_segment>

    def test_add_segment(self):
        f = self.sample_daf()
        d = DAF(f)

        d.add_array(b'Summary Name 3', (121.0, 232.0, 343), [3003.0] * 128)

        summaries = list(d.summaries())
        eq = self.assertEqual
>       eq(len(summaries), 3)
E       AssertionError: 0 != 3

/usr/lib/python3/dist-packages/jplephem/test.py:143: AssertionError
__________ TestDAFBytesIO.test_add_segment_when_summary_block_is_full __________

self = <jplephem.test.TestDAFBytesIO testMethod=test_add_segment_when_summary_block_is_full>

    def test_add_segment_when_summary_block_is_full(self):
        f = self.sample_daf()
        d = DAF(f)

        # Update n_summaries of final summary block to full.
        d.file.seek(6 * 1024 + 16)
        d.file.write(Struct('d').pack(d.summaries_per_record))

        d.add_array(b'Summary Name 3', (121.0, 232.0, 343), [3003.0] * 200)

        # Reset n_summaries of that block back to its real value.
        d.file.seek(6 * 1024 + 16)
        d.file.write(Struct('d').pack(1))

        summaries = list(d.summaries())
        eq = self.assertEqual
>       eq(len(summaries), 3)
E       AssertionError: 0 != 3

/usr/lib/python3/dist-packages/jplephem/test.py:169: AssertionError
_________________________ TestDAFBytesIO.test_segments _________________________

self = <jplephem.test.TestDAFBytesIO testMethod=test_segments>

    def test_segments(self):
        f = self.sample_daf()
        d = DAF(f)

        summaries = list(d.summaries())
        eq = self.assertEqual
>       eq(len(summaries), 2)
E       AssertionError: 0 != 2

/usr/lib/python3/dist-packages/jplephem/test.py:127: AssertionError
_______________________ TestDAFRealFile.test_add_segment _______________________

self = <jplephem.test.TestDAFRealFile testMethod=test_add_segment>

    def test_add_segment(self):
        f = self.sample_daf()
        d = DAF(f)

        d.add_array(b'Summary Name 3', (121.0, 232.0, 343), [3003.0] * 128)

        summaries = list(d.summaries())
        eq = self.assertEqual
>       eq(len(summaries), 3)
E       AssertionError: 0 != 3

/usr/lib/python3/dist-packages/jplephem/test.py:143: AssertionError
_________ TestDAFRealFile.test_add_segment_when_summary_block_is_full __________

self = <jplephem.test.TestDAFRealFile testMethod=test_add_segment_when_summary_block_is_full>

    def test_add_segment_when_summary_block_is_full(self):
        f = self.sample_daf()
        d = DAF(f)

        # Update n_summaries of final summary block to full.
        d.file.seek(6 * 1024 + 16)
        d.file.write(Struct('d').pack(d.summaries_per_record))

        d.add_array(b'Summary Name 3', (121.0, 232.0, 343), [3003.0] * 200)

        # Reset n_summaries of that block back to its real value.
        d.file.seek(6 * 1024 + 16)
        d.file.write(Struct('d').pack(1))

        summaries = list(d.summaries())
        eq = self.assertEqual
>       eq(len(summaries), 3)
E       AssertionError: 0 != 3

/usr/lib/python3/dist-packages/jplephem/test.py:169: AssertionError
________________________ TestDAFRealFile.test_segments _________________________

self = <jplephem.test.TestDAFRealFile testMethod=test_segments>

    def test_segments(self):
        f = self.sample_daf()
        d = DAF(f)

        summaries = list(d.summaries())
        eq = self.assertEqual
>       eq(len(summaries), 2)
E       AssertionError: 0 != 2

/usr/lib/python3/dist-packages/jplephem/test.py:127: AssertionError
_________________ TestDAFRealFileWithoutMMap.test_add_segment __________________

self = <jplephem.test.TestDAFRealFileWithoutMMap testMethod=test_add_segment>

    def test_add_segment(self):
        f = self.sample_daf()
        d = DAF(f)

        d.add_array(b'Summary Name 3', (121.0, 232.0, 343), [3003.0] * 128)

        summaries = list(d.summaries())
        eq = self.assertEqual
>       eq(len(summaries), 3)
E       AssertionError: 0 != 3

/usr/lib/python3/dist-packages/jplephem/test.py:143: AssertionError
____ TestDAFRealFileWithoutMMap.test_add_segment_when_summary_block_is_full ____

self = <jplephem.test.TestDAFRealFileWithoutMMap testMethod=test_add_segment_when_summary_block_is_full>

    def test_add_segment_when_summary_block_is_full(self):
        f = self.sample_daf()
        d = DAF(f)

        # Update n_summaries of final summary block to full.
        d.file.seek(6 * 1024 + 16)
        d.file.write(Struct('d').pack(d.summaries_per_record))

        d.add_array(b'Summary Name 3', (121.0, 232.0, 343), [3003.0] * 200)

        # Reset n_summaries of that block back to its real value.
        d.file.seek(6 * 1024 + 16)
        d.file.write(Struct('d').pack(1))

        summaries = list(d.summaries())
        eq = self.assertEqual
>       eq(len(summaries), 3)
E       AssertionError: 0 != 3

/usr/lib/python3/dist-packages/jplephem/test.py:169: AssertionError
___________________ TestDAFRealFileWithoutMMap.test_segments ___________________

self = <jplephem.test.TestDAFRealFileWithoutMMap testMethod=test_segments>

    def test_segments(self):
        f = self.sample_daf()
        d = DAF(f)

        summaries = list(d.summaries())
        eq = self.assertEqual
>       eq(len(summaries), 2)
E       AssertionError: 0 != 2

/usr/lib/python3/dist-packages/jplephem/test.py:127: AssertionError
=========================== short test summary info ============================
FAILED ::TestDAFBytesIO::test_add_segment - AssertionError: 0 != 3
FAILED ::TestDAFBytesIO::test_add_segment_when_summary_block_is_full - Assert...
FAILED ::TestDAFBytesIO::test_segments - AssertionError: 0 != 2
FAILED ::TestDAFRealFile::test_add_segment - AssertionError: 0 != 3
FAILED ::TestDAFRealFile::test_add_segment_when_summary_block_is_full - Asser...
FAILED ::TestDAFRealFile::test_segments - AssertionError: 0 != 2
FAILED ::TestDAFRealFileWithoutMMap::test_add_segment - AssertionError: 0 != 3
FAILED ::TestDAFRealFileWithoutMMap::test_add_segment_when_summary_block_is_full
FAILED ::TestDAFRealFileWithoutMMap::test_segments - AssertionError: 0 != 2
============ 9 failed, 3 passed, 30 skipped, 4 deselected in 0.16s =============

See also: https://ci.debian.net/data/autopkgtest/testing/s390x/j/jplephem/25034274/log.gz