rhasspy / wyoming

Peer-to-peer protocol for voice assistants
MIT License
103 stars 17 forks source link

Tests fail on s390x because of assumptions about byte-order #23

Open EdwardBetts opened 1 month ago

EdwardBetts commented 1 month ago
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0 -- /usr/bin/python3.12
cachedir: .pytest_cache
rootdir: /tmp/autopkgtest-lxc.tnekzjsu/downtmp/autopkgtest_tmp
plugins: asyncio-0.20.3
asyncio: mode=Mode.AUTO
collecting ... collected 16 items

tests/test_audio.py::test_chunk_converter PASSED                         [  6%]
tests/test_audio.py::test_wav_to_chunks PASSED                           [ 12%]
tests/test_client.py::test_from_uri PASSED                               [ 18%]
tests/test_event.py::test_write_event PASSED                             [ 25%]
tests/test_event.py::test_async_write_event PASSED                       [ 31%]
tests/test_event.py::test_write_event_no_payload PASSED                  [ 37%]
tests/test_event.py::test_async_write_event_no_payload PASSED            [ 43%]
tests/test_event.py::test_read_event PASSED                              [ 50%]
tests/test_event.py::test_async_read_event PASSED                        [ 56%]
tests/test_pyaudioop.py::test_lin2lin FAILED                             [ 62%]

=================================== FAILURES ===================================
_________________________________ test_lin2lin _________________________________

    def test_lin2lin() -> None:
        """Test sample width conversions."""
        for w in 1, 2, 4:
            assert pyaudioop.lin2lin(datas[w], w, w) == datas[w]
            assert pyaudioop.lin2lin(bytearray(datas[w]), w, w) == datas[w]
            assert pyaudioop.lin2lin(memoryview(datas[w]), w, w) == datas[w]

>       assert pyaudioop.lin2lin(datas[1], 1, 2) == packs[2](
            0, 0x1200, 0x4500, -0x4500, 0x7F00, -0x8000, -0x100
        )
E       AssertionError: assert bytearray(b'\...\x80\x00\xff') == b'\x00\x00\x1...0\x00\xff\x00'
E         
E         At index 2 diff: 0 != 18
E         
E         Full diff:
E         - (b'\x00\x00\x12\x00E\x00\xbb\x00\x7f\x00\x80\x00\xff\x00')
E         ?                                                     ----
E         + bytearray(b'\x00\x00\x00\x12\x00E\x00\xbb\x00\x7f\x00\x80\x00\xff')
E         ? +++++++++   ++++

tests/test_pyaudioop.py:43: AssertionError
=============================== warnings summary ===============================
../../../../usr/lib/python3/dist-packages/wyoming/audio.py:11
  /usr/lib/python3/dist-packages/wyoming/audio.py:11: DeprecationWarning: 'audioop' is deprecated and slated for removal in Python 3.13
    import audioop  # pylint: disable=deprecated-module

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_pyaudioop.py::test_lin2lin - AssertionError: assert bytearr...
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
==================== 1 failed, 9 passed, 1 warning in 0.09s ====================

See https://ci.debian.net/packages/p/python-wyoming/testing/s390x/49849836/