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

gh-129363: Change regrtest sequential mode output #129687

Closed
wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Feb 5, 2025

Always display the previous test, even if it passed in less than 30 seconds.

Example, before:

Capture d’écran du 2025-02-05 14-06-10

Example, after with colors:

Capture d’écran du 2025-02-05 13-57-34

Always display the previous test, even if it passed in less than
30 seconds.
@vstinner
Copy link
Member Author

vstinner commented Feb 5, 2025

@hugovk: Here is a different proposition, alternative to #129476.

@hugovk
Copy link
Member

hugovk commented Feb 6, 2025

Hmm, I'm not so keen that we get the result printed after we print the next test has started. It's a little confusing to have them on different lines.

From #129476 (comment):

Shall we take inspiration from pytest, which first prints the (uncoloured) name of the test, and then appends the coloured result?

Currently, when a test fails, it's output is written directly. So we cannot just add "passed" or "failed" after running a test.

Example (I added a bug to test_os):

0:00:00 load avg: 0.41 [1/1] test_os
test test_os failed -- Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/test/test_os.py", line 188, in test_access
    x
NameError: name 'x' is not defined

0:00:00 load avg: 0.41 [1/1/1] test_os failed (1 error)

Would something like this be possible?

  • Show the green "passed" immediately after
  • If there's a failure, we get some red showing the failure, and then the failure details
  • If needed, we could add a red summary line after the failure details, before the next test starts
image

This minimises the amount of duplication, and we don't mix different tests on the same line, and it's all synchronous.

@vstinner
Copy link
Member Author

@hugovk: That's more complicated to implement since regrtest is designed in a way that errors are written after "test_asyncio". Errors are written immediately, there is no buffer. So it's not easy to add "passed" or "failed" afterwards.

@hugovk
Copy link
Member

hugovk commented Feb 19, 2025

Okay, then of these two, I prefer #129476 -- I find the extra lines clearer than the "zigzag" here.

Shall we go for #129476?

And hopefully Thomas will finish his update at a sprint one day :)

@vstinner
Copy link
Member Author

Okay, then of these two, I prefer #129476 -- I find the extra lines clearer than the "zigzag" here.

Ok, I reopened the PR #129476.

@vstinner
Copy link
Member Author

I close this PR. The other PR was merged instead: #129476

@vstinner vstinner closed this Feb 21, 2025
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.

2 participants