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

[3.12] regrtest computes statistics (GH-108793) #108818

Closed

Conversation

miss-islington
Copy link
Contributor

test_netrc, test_pep646_syntax and test_xml_etree now return results
in the test_main() function.

Changes:

  • Rewrite TestResult as a dataclass with a new State class.
  • Add test.support.TestStats class and Regrtest.stats_dict attribute.
  • libregrtest.runtest functions now modify a TestResult instance
    in-place.
  • libregrtest summary lists the number of run tests and skipped
    tests, and denied resources.
  • Add TestResult.has_meaningful_duration() method.
  • Compute TestResult duration in the upper function.
  • Use time.perf_counter() instead of time.monotonic().
  • Regrtest: rename 'resource_denieds' attribute to 'resource_denied'.
  • Rename CHILD_ERROR to MULTIPROCESSING_ERROR.
  • Use match/case syntadx to have different code depending on the
    test state.

(cherry picked from commit d4e534c)

Co-authored-by: Victor Stinner vstinner@python.org
Co-authored-by: Alex Waygood Alex.Waygood@Gmail.com

test_netrc, test_pep646_syntax and test_xml_etree now return results
in the test_main() function.

Changes:

* Rewrite TestResult as a dataclass with a new State class.
* Add test.support.TestStats class and Regrtest.stats_dict attribute.
* libregrtest.runtest functions now modify a TestResult instance
  in-place.
* libregrtest summary lists the number of run tests and skipped
  tests, and denied resources.
* Add TestResult.has_meaningful_duration() method.
* Compute TestResult duration in the upper function.
* Use time.perf_counter() instead of time.monotonic().
* Regrtest: rename 'resource_denieds' attribute to 'resource_denied'.
* Rename CHILD_ERROR to MULTIPROCESSING_ERROR.
* Use match/case syntadx to have different code depending on the
  test state.

(cherry picked from commit d4e534c)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM, good bot.

It can wait for Python 3.12.1.

@vstinner
Copy link
Member

vstinner commented Sep 2, 2023

In general, I'm trying to keep libregrtest the same in all stable branches. It seems like 3.11 has an outdated libregrtest :-(

@vstinner
Copy link
Member

vstinner commented Sep 2, 2023

In general, I'm trying to keep libregrtest the same in all stable branches. It seems like 3.11 has an outdated libregrtest :-(

I backported the statistics change to Python 3.11: #108820

I would prefer to have the same code in 3.11, 3.12 and main branches to ease future backports.

@Yhg1s
Copy link
Member

Yhg1s commented Sep 2, 2023

Can you take a look at the test failures?

@vstinner
Copy link
Member

vstinner commented Sep 2, 2023

Can you take a look at the test failures?

Oh. I missed the fact that the final changes uses the doctest.TestResults.skipped attribute which I just added to Python 3.13.

I close this broken backport PR and backported the change manually to Python 3.12 to adapt it to Python 3.12 API: PR #108833.

@vstinner vstinner closed this Sep 2, 2023
@miss-islington miss-islington deleted the backport-d4e534c-3.12 branch September 2, 2023 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants