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

Any chance of Testinfra being bumped to latest? #853

Merged
merged 2 commits into from Jun 7, 2017

Conversation

Projects
None yet
2 participants
@rosstimson
Copy link
Contributor

rosstimson commented Jun 7, 2017

Any chance Testinfra could be updated to the latest version? The main reason being that 1.6 and onwards introduced New ‘host’ fixture as a replacement for all other fixtures. This makes tests a little nicer to write but also it means that the Testinfra docs now follow this style.

Apologies if there is more to this than what I've done here. I have tested several of my Molecule projects by manually updating Testinfra within the virtualenv and continuing to work without a problem.

I have also tried to run the tox test suites although I'm a newbie to that. I seemed to get a single error on each suite (example follows). It seem to be an idempotence test failure and I'm assuming it is unrelated to my change. I've also tried to verify this by doing a completely fresh clone of master and running tox and again I was getting the same failures.

Many thanks for Molecule, it is awesome.

Example of test failure:

/Users/ross.timson/code/python/molecule/test/unit/command/test_idempotence.py:47: AssertionError
========================================================= 1 failed, 104 passed, 1 skipped in 5.29 seconds =========================================================
Traceback (most recent call last):
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/bin/py.test", line 11, in <module>
    sys.exit(main())
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/config.py", line 58, in main
    return config.hook.pytest_cmdline_main(config=config)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
    res = hook_impl.function(*args)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/main.py", line 134, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/main.py", line 105, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
    res = hook_impl.function(*args)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/terminal.py", line 405, in pytest_keyboard_interrupt
    self._keyboardinterrupt_memo = excinfo.getrepr(funcargs=True)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/_code/code.py", line 429, in getrepr
    return fmt.repr_excinfo(self)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/_code/code.py", line 623, in repr_excinfo
    reprtraceback = self.repr_traceback(excinfo)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/_code/code.py", line 613, in repr_traceback
    reprentry = self.repr_traceback_entry(entry, einfo)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/_code/code.py", line 581, in repr_traceback_entry
    path = self._makepath(entry.path)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/_pytest/_code/code.py", line 594, in _makepath
    np = py.path.local().bestrelpath(path)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/py/_path/local.py", line 149, in __init__
    self.strpath = py.error.checked_call(os.getcwd)
  File "/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/lib/python2.7/site-packages/py/_error.py", line 85, in checked_call
    raise cls("%s%r" % (func.__name__, args))
py.error.ENOENT: [No such file or directory]: getcwd()
ERROR: InvocationError: '/Users/ross.timson/code/python/molecule/.tox/py27-ansible21-unit/bin/py.test -vv -x --cov=/Users/ross.timson/code/python/molecule/molecule/'
@retr0h

This comment has been minimized.

Copy link
Contributor

retr0h commented Jun 7, 2017

@rosstimson Looks good. Can you also update all the scenarios in test/scenarios/ to ensure they are using the new syntax.

@rosstimson

This comment has been minimized.

Copy link
Contributor Author

rosstimson commented Jun 7, 2017

Sorry I missed those. Hopefully done what you were asking for now.

My Python is not great (still learning) and I was a little unsure about the scenarios/docker_cluster/tests so I would pay special attention when checking what I've done there. Tests seem to work for me though. 🤞

Thanks.

@retr0h retr0h merged commit b4edb56 into ansible:master Jun 7, 2017

@retr0h

This comment has been minimized.

Copy link
Contributor

retr0h commented Jun 7, 2017

@retr0h retr0h added the v1.26 label Jun 14, 2017

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