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

Ensure all test reports are processed regardless of prior report status #124

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gnikonorov
Copy link
Member

@gnikonorov gnikonorov commented Aug 2, 2020

Ensure that we always process all reports for a test in pytest_runtest_protocol regardless of whether a past report for a test failed. We now defer any pre-rerun setup until after all reports are executed while still keeping the same rerun logic.

Fixes #108

@gnikonorov gnikonorov added this to In progress in 9.1 Release via automation Aug 2, 2020
@gnikonorov gnikonorov self-assigned this Aug 2, 2020
Copy link
Member

@sallner sallner left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. I would prefer to have a testcase in this PR, which actually shows the effect of this change. What is the effect of calling pytest_runtest_logreport now in every case. From my perspective, in almost every case, except parallel and xdist, this hook was called.

or not report.failed
or xfail
or is_terminal_error
or need_to_rerun
Copy link
Member

Choose a reason for hiding this comment

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

With this way of writing we have 5 possible cases in this branch, which will never be properly addressed by any branch coverage. I would prefer a way, so that we need a testcase to make the coverage happy. And I would prefer a testcase.

Copy link
Member Author

Choose a reason for hiding this comment

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

This hook was not called for reports of a test run beyond the first failure, which this PR fixes. So, before this PR if a test fails in phase setup, its call and teardown reports aren't processed ( in this case all we do for processing is call pytest_runtest_logreport

Now that I look at my change again I have a general question. Why do we not call pytest_runtest_logreport for failed test phases when xdist or parellel?

@sallner sallner added this to In progress in 9.2 Release Aug 26, 2020
@sallner sallner removed this from In progress in 9.1 Release Aug 26, 2020
@sallner sallner added this to the 9.2 Release milestone Aug 26, 2020
@icemac
Copy link
Contributor

icemac commented May 26, 2021

What is the current status of this PR?

@icemac
Copy link
Contributor

icemac commented May 9, 2022

This PR has conflicts which need to be resolved first.

@BeyondEvil
Copy link
Contributor

Not sure how active @gnikonorov is these days. According to GitHub is last activity was in Jan 2022.

I'm happy to pick this up, given the maintainers are willing to have the discussion.

@icemac
Copy link
Contributor

icemac commented Aug 18, 2023

@BeyondEvil Thank you for volunteering for this PR. I am here as a maintainer to help and discuss the issue as needed.

@icemac icemac assigned BeyondEvil and unassigned gnikonorov Aug 25, 2023
@icemac icemac removed this from In progress in 9.2 Release Aug 25, 2023
@icemac icemac removed this from the 10.0 Release milestone Aug 25, 2023
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.

pytest_runtest_logreport not called on reruns
5 participants