coveragepy errors on tests run for branches
Report
At the moment we get errors for the pytest_postgres
and pytest_sqlite
tests.
The tests run successfully on our end, but when coveragepy runs, we get the following errors:
... .... ...
690 INTERNALERROR> Traceback (most recent call last):
691 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/_pytest/main.py", line 209, in wrap_session
692 INTERNALERROR> session.exitstatus = doit(config, session) or 0
693 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/_pytest/main.py", line 249, in _main
694 INTERNALERROR> config.hook.pytest_runtestloop(session=session)
695 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/pluggy/hooks.py", line 284, in __call__
696 INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
697 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/pluggy/manager.py", line 67, in _hookexec
698 INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
699 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/pluggy/manager.py", line 61, in <lambda>
700 INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
701 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/pluggy/callers.py", line 203, in _multicall
702 INTERNALERROR> gen.send(outcome)
703 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/pytest_cov/plugin.py", line 229, in pytest_runtestloop
704 INTERNALERROR> self.cov_controller.finish()
705 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/pytest_cov/engine.py", line 167, in finish
706 INTERNALERROR> self.cov.stop()
707 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/coverage/control.py", line 651, in combine
708 INTERNALERROR> combine_parallel_data(self._data, aliases=aliases, data_paths=data_paths, strict=strict)
709 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/coverage/data.py", line 117, in combine_parallel_data
710 INTERNALERROR> data.update(new_data, aliases=aliases)
711 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/coverage/sqldata.py", line 705, in update
712 INTERNALERROR> for (file, context), numbits in lines.items()
713 INTERNALERROR> File "/usr/local/lib/python3.6/site-packages/coverage/sqldata.py", line 705, in <listcomp>
714 INTERNALERROR> for (file, context), numbits in lines.items()
715 INTERNALERROR> KeyError: '/builds/meltano/meltano/src/meltano/__init__.py'
meltano/src/meltano/__init__.py
is always there (part of our release) but coveragepy.coverage.sqldata seems to not have it registered and can not find it afterwards.
Investigation
coveragepy version 5.0 was released on PyPi on Dec, 14 2019 just before we started getting this error on our Test jobs
Bug has reported to the coveragepy team: https://github.com/nedbat/coveragepy/issues/881
Solution
Until this is fixed or we have a way to address it, we are going to pin coveragepy to the latest stable version (4.5.4)