Page MenuHomeSoftware Heritage

pytest.ini: Prevent swh-storage pytest plugin loading
ClosedPublic

Authored by anlambert on Jul 8 2020, 6:51 PM.

Details

Summary

The fixtures contained in that plugin are currently not needed and
it makes the tox build fail due to missing pytest-postgresql dep.

py3 run-test: commands[0] | pytest --hypothesis-profile=swh-web-fast --cov /home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/swh/web --cov-branch /home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/swh/web
Traceback (most recent call last):
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/bin/pytest", line 8, in <module>
    sys.exit(main())
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 105, in main
    config = _prepareconfig(args, plugins)
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 258, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/_pytest/helpconfig.py", line 90, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 836, in pytest_cmdline_parse
    self.parse(args)
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 1044, in parse
    self._preparse(args, addopts=addopts)
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 992, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 105, in load
    module = import_module(match.group('module'))
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/_pytest/assertion/rewrite.py", line 152, in exec_module
    exec(co, module.__dict__)
  File "/home/antoine/swh/swh-environment/swh-web/.tox/py3/lib/python3.7/site-packages/swh/storage/pytest_plugin.py", line 15, in <module>
    from pytest_postgresql import factories
ModuleNotFoundError: No module named 'pytest_postgresql'

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build has FAILED

Patch application report for D3474 (id=12284)

Rebasing onto 423ac84653...

Current branch diff-target is up to date.
Changes applied before test
commit 0af42367cd17e251974661412c7254bd446e847a
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Wed Jul 8 18:49:30 2020 +0200

    pytest.ini: Prevent swh-storage pytest plugin loading
    
    The fixtures contained in that plugin are currently not needed and
    it makes the tox build fail due to missing pytest-postgresql dep.

Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/270/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/270/console

This revision is now accepted and ready to land.Jul 8 2020, 6:58 PM
This revision was landed with ongoing or failed builds.Jul 8 2020, 7:02 PM
This revision was automatically updated to reflect the committed changes.