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

Can't run the test suite #45

Closed
vortec opened this issue Jul 21, 2016 · 9 comments
Closed

Can't run the test suite #45

vortec opened this issue Jul 21, 2016 · 9 comments

Comments

@vortec
Copy link

vortec commented Jul 21, 2016

I'm trying to get the test suite running but no luck. I'm on OSX und use Python 3.5.

When I run make cov as suggested, I get this error:

$ make cov
extra=$(python -c "import sys;sys.stdout.write('--exclude tests/test_pep492.py') if sys.version_info[:3] < (3, 5, 0) else sys.stdout.write('')"); \
    flake8 aiokafka tests $extra
tests/test_pep492.py:23:17: F999 'break' outside loop
tests/test_pep492.py:46:21: F999 'break' outside loop

If i fix those by adding # noqa behind them, flake8 passes but the tests can't seem to communicate with Docker:

$ KAFKA_VERSION=0.10.0.0 SCALA_VERSION=2.11 make cov
extra=$(python -c "import sys;sys.stdout.write('--exclude tests/test_pep492.py') if sys.version_info[:3] < (3, 5, 0) else sys.stdout.write('')"); \
    flake8 aiokafka tests $extra
=========================================================================================================== test session starts ============================================================================================================
platform darwin -- Python 3.5.0, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /Users/fkochem/workspace/code/aiokafka, inifile:
plugins: catchlog-1.2.2, cov-2.3.0
collected 55 items

tests/test_client.py EEEEEEEEE
tests/test_conn.py EEEEEEEE
tests/test_consumer.py EEEEEEEEEEEEEE
tests/test_coordinator.py EEEEEEEEE
tests/test_fetcher.py ..
tests/test_message_accumulator.py ..
tests/test_pep492.py EEE
tests/test_producer.py EEEEEEEE

---------- coverage: platform darwin, python 3.5.0-final-0 -----------
Coverage HTML written to dir htmlcov


================================================================================================================== ERRORS ==================================================================================================================
_________________________________________________________________________________________ ERROR at setup of TestAIOKafkaClient.test_init_with_csv __________________________________________________________________________________________

docker = <docker.client.Client object at 0x10a6decf8>

    @pytest.fixture(scope='session')
    def docker_ip_address(docker):
        """Returns IP address of the docker daemon service."""
        # Fallback docker daemon bridge name
        ifname = 'docker0'
        try:
            for network in docker.networks():
                _ifname = docker.networks()[0]['Options'].get(
                    'com.docker.network.bridge.name')
                if _ifname is not None:
                    ifname = _ifname
                    break
        except libdocker.errors.InvalidVersion:
            pass
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        return socket.inet_ntoa(fcntl.ioctl(
            s.fileno(),
            0x8915,  # SIOCGIFADDR
>           struct.pack('256s', ifname[:15].encode('utf-8')))[20:24])
E       OSError: [Errno 6] Device not configured

tests/conftest.py:42: OSError

All tests error out with the same exception.

@vortec vortec changed the title Can't run tests Can't run the test suite Jul 21, 2016
@tvoinarovskyi
Copy link
Member

hello there. I'm sorry, currently on a vacation. Will try to take a look tomorrow. In worst case next week, when I get back.

@vortec
Copy link
Author

vortec commented Jul 22, 2016

No worries, enjoy your vacation!

I just noticed this while trying to fix #44 myself.

@tvoinarovskyi
Copy link
Member

Fixed the flake8 problems.
As for the test suite, it's only supported on Linux. I believe that it would not be hard to make it work for OSX if the IP addresses are properly set, but currently I can't look into that, as I don't have a suitable OSX computer, sorry. If you can/want to do a PR for this I can help.

@kxepal
Copy link
Member

kxepal commented Aug 9, 2016

Actually, it could be hard since OSX is not docker-friendly system.

@vortec
Copy link
Author

vortec commented Aug 9, 2016

@Drizzt1991 thanks! If you give me a hint where I have to modify those IP addresses, I will try to fix it.
EDIT: Found it.

@kxepal why is that?

@kxepal
Copy link
Member

kxepal commented Aug 9, 2016

@vortec Just try (: Let's start with that you'll need Virtualbox installed for it to run...

@vortec
Copy link
Author

vortec commented Aug 9, 2016

@kxepal
Copy link
Member

kxepal commented Aug 9, 2016

@vortec oh, good to know!

@tvoinarovskyi tvoinarovskyi added this to the 0.2.2 milestone Feb 17, 2017
@tvoinarovskyi tvoinarovskyi modified the milestones: 0.3.0, 0.2.2 Mar 12, 2017
@tvoinarovskyi tvoinarovskyi removed this from the 0.3.0 milestone Jul 24, 2017
@tvoinarovskyi tvoinarovskyi removed their assignment Jul 27, 2017
@tvoinarovskyi
Copy link
Member

Can be used with docker for mac now.

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

No branches or pull requests

3 participants