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

FSCollector: use session._node_location_to_relpath #6701

Closed

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Feb 10, 2020

Maybe related/fixes #3714.

_check_initialpaths_for_relpath was added in #2776 (14b6380).

The adjusted test for it still works, and was hardened inbetween (and fixed here).

@blueyed blueyed changed the title [WIP] Package: fall back to fspath for nodeid [WIP] FSCollector: use session._node_location_to_relpath Feb 10, 2020
@blueyed blueyed changed the title [WIP] FSCollector: use session._node_location_to_relpath FSCollector: use session._node_location_to_relpath Feb 10, 2020
@blueyed blueyed added topic: collection related to the collection phase type: bug problem that needs to be addressed labels Feb 19, 2020
This is relevant for `pytest t/foo.py --rootdir=/tmp`.

Before:
```
../../../../tmp F.sxx
…
t/foo.py:5: ValueError
…
FAILED ../../../../tmp/::test_fail - ValueError
```

This removes `_check_initialpaths_for_relpath` (added via
pytest-dev#2776 to address part of the
issue), but it is apparently bad trying to make them relative to any
given arg, when they are meant to be relative to `rootdir` really.
@blueyed
Copy link
Contributor Author

blueyed commented Feb 24, 2020

Using _check_initialpaths_for_relpath for nodeids makes no sense: they should be relative to rootdir always, and "checking initial dirs" gets done to determine this already.

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as i can gather,this bugfix implies a breaking change

as the nodeids for everyone using --pyargs are liekly to change,
this has to be part of a breaking release as it affects reporting, reporting metadata, and thus may break subsequent processes at users

"test_hello.py::test_hello*PASSED*",
"test_hello.py::test_other*PASSED*",
"rootdir: {}/world".format(testdir.tmpdir),
"../hello/ns_pkg/hello/test_hello.py::test_hello PASSED *",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this indicates a breaking change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node ids are documented to be relative to the rootdir, so this looks like a bugfix to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some bugfixes are breaking changes, based on the required output change here, this is a breaking change

i wll have to crosscheck as im realatively sure that this change would break reporting continuitiy in at least one work project

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RonnyPfannschmidt
Copy link
Member

i verified that this changes thousands of test ids that previously didn't contain certain path elements

@blueyed
Copy link
Contributor Author

blueyed commented Mar 8, 2020

I still think this is a bug though.
IIRC this only affects the output.
I've merged this for myself already, so either provide more information, or just close it.

@RonnyPfannschmidt
Copy link
Member

Have it your way, you made clear what you value

@blueyed blueyed deleted the package-nodeid-abs-upstream branch March 31, 2020 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: collection related to the collection phase type: bug problem that needs to be addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues with nodeid consistency when pytest --pyargs is not run from the root directory
2 participants