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

LFPlugin: use sub-plugins to deselect during collection #6448

Merged
merged 1 commit into from
Feb 19, 2020

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Jan 13, 2020

Fixes #5301

Two subplugins are necessary due to limitations in pluggy (pytest-dev/pluggy#246).

TODO:

"* 1 failed in *",
"collected 2 items",
"run-last-failure: 1 known failures not in selected tests",
"* 1 failed, 1 passed in *",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really sure, but this might show the fix for #5301.
Could use a more explicit test otherwise, of course.

@blueyed blueyed changed the title WIP: LFPlugin: use sub-plugins to deselect during collection [RFC] LFPlugin: use sub-plugins to deselect during collection Jan 14, 2020
@nicoddemus
Copy link
Member

Thanks, sorry for the delay.

At first glance the approach seems to work, but also seems a bit more complicated than I would like, so before we discuss this PR further I would like for us to consider the alternative using mtime you proposed in #5301 (comment). 👍

@blueyed
Copy link
Contributor Author

blueyed commented Jan 24, 2020

@nicoddemus
I'm not really interested in discussing alternatives - I think this approach is fine.

@blueyed
Copy link
Contributor Author

blueyed commented Jan 25, 2020

@nicoddemus
Have you tested this with regard to #5301 (comment)?

@nicoddemus
Copy link
Member

Yes, have you?

@blueyed
Copy link
Contributor Author

blueyed commented Jan 25, 2020

No. But I've guessed that an existing (changed) test would cover it already (#6448 (review)). Not sure though, and it might be good to review/extend it with regard to that.

@nicoddemus
Copy link
Member

nicoddemus commented Jan 25, 2020

I suggest to make use of provided reproducible use cases when opening PRs claiming to fix a bug ;)

Either way, the change seems fine so feel free to merge it.

@blueyed blueyed changed the title [RFC] LFPlugin: use sub-plugins to deselect during collection [RFC/WIP] LFPlugin: use sub-plugins to deselect during collection Jan 25, 2020
@blueyed blueyed changed the title [RFC/WIP] LFPlugin: use sub-plugins to deselect during collection LFPlugin: use sub-plugins to deselect during collection Feb 16, 2020
Fixes pytest-dev#5301.

Refactor/steps:

- use var
- harden test_lastfailed_usecase
- harden test_failedfirst_order
- revisit last_failed_paths
- harden test_lastfailed_with_known_failures_not_being_selected
@blueyed blueyed merged commit 1b30514 into pytest-dev:master Feb 19, 2020
@blueyed blueyed deleted the lf branch February 19, 2020 20:33
blueyed added a commit to blueyed/pytest that referenced this pull request Feb 20, 2020
It should only return `True` when something is to be ignored, not
`False` otherwise typically.

This caused e.g. bad interaction with the cacheprovider (before
pytest-dev#6448).
blueyed added a commit that referenced this pull request Feb 22, 2020
It should only return `True` when something is to be ignored, not
`False` otherwise typically.

This caused e.g. bad interaction with the cacheprovider (before
#6448).
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

Successfully merging this pull request may close these issues.

"Last Failed" mode no longer reruns all tests on successful run
2 participants