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

wrong rootdir detected #59

Open
dingxiong opened this issue Aug 14, 2022 · 1 comment
Open

wrong rootdir detected #59

dingxiong opened this issue Aug 14, 2022 · 1 comment

Comments

@dingxiong
Copy link

dingxiong commented Aug 14, 2022

Hi,

I found using pytest with parameter with --durations-path option will change pytest rootdir, so the nodeid of all tests cannot be found in the test_durations file.
For example

% pytest --splits 2 --group 1 --durations-path ~/Downloads/.test_durations  -s
========================== test session starts ===========================
platform darwin -- Python 3.8.13, pytest-6.2.0, py-1.11.0, pluggy-0.13.1
rootdir: /Users/xiongding

The rootdir is my home folder. So basically the nodeids stored in test_duration are not used. This is a pytest's documentation https://docs.pytest.org/en/6.2.x/customize.html#initialization-determining-rootdir-and-configfile

It is hard to say it is a bug on pytest-split side. The pytest algorithm to determine rootdir is also weird. We can easily avoid this issue using --rootdir option, or move test_durations file to project rootdir before running pytest. But just want to ask is there a better design? There is no error so I did not find this issue for a long time.

@Prodian0013
Copy link

having the same issue --durations-path borks everything and isnt useable in its current state

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

No branches or pull requests

2 participants