jarun/bcal

Four tests fail on Darwin

jfrankenau opened this issue · 10 comments

I am trying to build bcal for x86_64-darwin using Nix. The build with gcc works fine, however four tests are failing, see below. Likewise manually running bcal "(5kb+2mb)/3" and bcal "5 tb / 12" from the CLI examples fails with ERROR: unknown unit.

============================= test session starts ==============================
platform darwin -- Python 3.6.4, pytest-3.4.0, py-1.5.2, pluggy-0.6.0
rootdir: /private/tmp/nix-build-bcal-1.7.drv-0/source, inifile:
collected 42 items

test.py .....FFF.F................................                       [100%]

=================================== FAILURES ===================================
_________________________ test_output[item5-5250880] __________________________

item = ('./bcal', '-m', '0x4         kb   *  2     +   5        mib')
res = b'5250880\n'

    @pytest.mark.parametrize('item, res', zip(test, res))
    def test_output(item, res):
        try:
>           out = subprocess.check_output(item, stderr=subprocess.STDOUT)

test.py:119:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

timeout = None
popenargs = (('./bcal', '-m', '0x4         kb   *  2     +   5        mib'),)
kwargs = {'stderr': -2}

input = None, timeout = None, check = True
popenargs = (('./bcal', '-m', '0x4         kb   *  2     +   5        mib'),)
kwargs = {'stderr': -2, 'stdout': -1}
process = <subprocess.Popen object at 0x108992828>
stdout = b'ERROR: unknown unit\n', stderr = None, retcode = 255

During handling of the above exception, another exception occurred:

item = ('./bcal', '-m', '0x4         kb   *  2     +   5        mib')
res = b'5250880\n'

    @pytest.mark.parametrize('item, res', zip(test, res))
    def test_output(item, res):
        try:
            out = subprocess.check_output(item, stderr=subprocess.STDOUT)
        except subprocess.CalledProcessError as e:
            # print(e.output)
>           assert e.output == res
E           AssertionError: assert b'ERROR: unknown unit\n' == b'5250880\n'
E             At index 0 diff: 69 != 53
E             Left contains more items, first extra item: 110
E             Use -v to get the full diff

test.py:122: AssertionError
________________________ test_output[item6-655360000] _________________________

item = ('./bcal', '-m', '5*5*5*5     mIB'), res = b'655360000\n'

    @pytest.mark.parametrize('item, res', zip(test, res))
    def test_output(item, res):
        try:
>           out = subprocess.check_output(item, stderr=subprocess.STDOUT)

test.py:119:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

timeout = None, popenargs = (('./bcal', '-m', '5*5*5*5     mIB'),)
kwargs = {'stderr': -2}

input = None, timeout = None, check = True
popenargs = (('./bcal', '-m', '5*5*5*5     mIB'),)
kwargs = {'stderr': -2, 'stdout': -1}
process = <subprocess.Popen object at 0x1084e1080>
stdout = b'ERROR: unknown unit\n', stderr = None, retcode = 255

During handling of the above exception, another exception occurred:

item = ('./bcal', '-m', '5*5*5*5     mIB'), res = b'655360000\n'

    @pytest.mark.parametrize('item, res', zip(test, res))
    def test_output(item, res):
        try:
            out = subprocess.check_output(item, stderr=subprocess.STDOUT)
        except subprocess.CalledProcessError as e:
            # print(e.output)
>           assert e.output == res
E           AssertionError: assert b'ERROR: unknown unit\n' == b'655360000\n'
E             At index 0 diff: 69 != 54
E             Left contains more items, first extra item: 110
E             Use -v to get the full diff

test.py:122: AssertionError
________________________ test_output[item7-625000000] _________________________

item = ('./bcal', '-m', '5mb*5*5*5'), res = b'625000000\n'

    @pytest.mark.parametrize('item, res', zip(test, res))
    def test_output(item, res):
        try:
>           out = subprocess.check_output(item, stderr=subprocess.STDOUT)

test.py:119:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

timeout = None, popenargs = (('./bcal', '-m', '5mb*5*5*5'),)
kwargs = {'stderr': -2}

input = None, timeout = None, check = True
popenargs = (('./bcal', '-m', '5mb*5*5*5'),)
kwargs = {'stderr': -2, 'stdout': -1}
process = <subprocess.Popen object at 0x1086a1d30>
stdout = b'ERROR: unknown unit\n', stderr = None, retcode = 255

During handling of the above exception, another exception occurred:

item = ('./bcal', '-m', '5mb*5*5*5'), res = b'625000000\n'

    @pytest.mark.parametrize('item, res', zip(test, res))
    def test_output(item, res):
        try:
            out = subprocess.check_output(item, stderr=subprocess.STDOUT)
        except subprocess.CalledProcessError as e:
            # print(e.output)
>           assert e.output == res
E           AssertionError: assert b'ERROR: unknown unit\n' == b'625000000\n'
E             At index 0 diff: 69 != 54
E             Left contains more items, first extra item: 110
E             Use -v to get the full diff

test.py:122: AssertionError
________________________ test_output[item9-283752000] _________________________

item = ('./bcal', '-m', '2kb+3mb/4*5+5*56mb'), res = b'283752000\n'

    @pytest.mark.parametrize('item, res', zip(test, res))
    def test_output(item, res):
        try:
>           out = subprocess.check_output(item, stderr=subprocess.STDOUT)

test.py:119:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

timeout = None, popenargs = (('./bcal', '-m', '2kb+3mb/4*5+5*56mb'),)
kwargs = {'stderr': -2}

input = None, timeout = None, check = True
popenargs = (('./bcal', '-m', '2kb+3mb/4*5+5*56mb'),)
kwargs = {'stderr': -2, 'stdout': -1}
process = <subprocess.Popen object at 0x108623c18>
stdout = b'ERROR: unknown unit\n', stderr = None, retcode = 255

During handling of the above exception, another exception occurred:

item = ('./bcal', '-m', '2kb+3mb/4*5+5*56mb'), res = b'283752000\n'

    @pytest.mark.parametrize('item, res', zip(test, res))
    def test_output(item, res):
        try:
            out = subprocess.check_output(item, stderr=subprocess.STDOUT)
        except subprocess.CalledProcessError as e:
            # print(e.output)
>           assert e.output == res
E           AssertionError: assert b'ERROR: unknown unit\n' == b'283752000\n'
E             At index 0 diff: 69 != 50
E             Left contains more items, first extra item: 110
E             Use -v to get the full diff

test.py:122: AssertionError
===================== 4 failed, 38 passed in 0.46 seconds ======================
jarun commented

I don't own a Mac. So you'll probably have to debug it yourself.

At the same time, all the issues are due to the expressions returning 'unknown unit' so there's a probability something is common among the failures.

I don't own a Mac.

Me neither. Just had the chance to try to build this package and hoped this issue would be familiar to you.

I'll be probably be disabling x86_64-darwin for NixOS 18.03 until I'll have some more time on a macOS machine to debug this one.

jarun commented

👍

jarun commented

I am trying to automate the tests on Travis of os x here - f0e716c.

Can you please let me know how you installed libquadmath on OS X?

If anything libquadmath should come bundled with the GCC. I can only assume that the GCC version for OS X in Travis-CI has disabled this. (If I'm not mistaken they use the GCC bundled with Xcode.) So it may be necessary to install it from Homebrew or something.

jarun commented

It's happening on Travis now. But I guess we need to reproduce it locally to figure out actually what's going on.

I just tested it and it works fine now. Thank you! Looking forward to the next release.

jarun commented

Would it be possible for you to submit bcal to Homebrew on next release?

I am not familiar with the process and seeing as I don't use macOS myself that wouldn't be a good idea. However it's possible to install bcal using nixpkgs on macOS and using Hydra I'll be easily able to verify if it builds correctly.

jarun commented

OK! That would be great!