ionelmc / pytest-benchmark

py.test fixture for benchmarking code
BSD 2-Clause "Simplified" License
1.24k stars 119 forks source link

Storage not relative to cwd fails #217

Open mortalisk opened 2 years ago

mortalisk commented 2 years ago

I am trying to give the --benchmark-storage parameter a network drive path. This fails with an error: ValueError: '/network/path/.benchmarks' does not start with '/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance'


INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/_pytest/main.py", line 264, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/_pytest/config/__init__.py", line 992, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pytest_benchmark/plugin.py", line 441, in pytest_configure
INTERNALERROR>     bs.handle_loading()
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pytest_benchmark/session.py", line 197, in handle_loading
INTERNALERROR>     compared_benchmark=compared_benchmark,
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pytest_benchmark/plugin.py", line 266, in pytest_benchmark_compare_machine_info
INTERNALERROR>     benchmarksession.storage.location,
INTERNALERROR>   File "/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance/env/lib64/python3.6/site-packages/pytest_benchmark/storage/file.py", line 28, in location
INTERNALERROR>     return str(self.path.relative_to(os.getcwd()))
INTERNALERROR>   File "/usr/lib64/python3.6/pathlib.py", line 874, in relative_to
INTERNALERROR>     .format(str(self), str(formatted)))
INTERNALERROR> ValueError: '/network/path/.benchmarks' does not start with '/tmp/jenkins-komodo-f_scout_ci/workspace/ert-performance'