Skip to content

Do Not Truncate Crash Messages In Short Test Summary on CI#9933

Merged
nicoddemus merged 6 commits into
pytest-dev:mainfrom
sommersoft:9920-summary-no-truncate-ci
May 13, 2022
Merged

Do Not Truncate Crash Messages In Short Test Summary on CI#9933
nicoddemus merged 6 commits into
pytest-dev:mainfrom
sommersoft:9920-summary-no-truncate-ci

Conversation

@sommersoft
Copy link
Copy Markdown
Contributor

Fixes #9920

This skips crash message truncation, if a CI environment variable is set and truthy.

Should this be mentioned in the docs, maybe as a note? https://github.com/pytest-dev/pytest/blob/main/doc/en/how-to/output.rst#producing-a-detailed-summary-report

Thanks to blueyed for some hints in #5284.

Copy link
Copy Markdown
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks a lot @sommersoft!

Left a few suggestions, please take a look.

Should this be mentioned in the docs, maybe as a note?

Not sure it is needed, but feel free to write a .. note:: at the end of that section if you like. 👍

Comment thread testing/test_terminal.py Outdated
Comment thread src/_pytest/terminal.py Outdated
Comment thread changelog/9920.improvement.rst Outdated
Copy link
Copy Markdown
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks, looks great!

Feel free to add yourself to the AUTHORS file btw.

@sommersoft
Copy link
Copy Markdown
Contributor Author

Fixed the merge conflicts (hopefully).

Feel free to add yourself to the AUTHORS file btw.

Maybe at some point. This was a tiny change, but I appreciate the sentiment.

@nicoddemus nicoddemus merged commit 56c2666 into pytest-dev:main May 13, 2022
@nicoddemus
Copy link
Copy Markdown
Member

Thanks again @sommersoft !

@sommersoft sommersoft deleted the 9920-summary-no-truncate-ci branch May 13, 2022 11:37
@stevenmchaves
Copy link
Copy Markdown

Which version of pytest will this be in?

@The-Compiler
Copy link
Copy Markdown
Member

Which version of pytest will this be in?

The next feature release, i.e., 7.2.

@jainshilpi
Copy link
Copy Markdown

Which python version does it need? It seems it can work with 3.9. If I use python version 3.9 and install pytest version 7.2:
python3.9 -m pip install --user pytest==7.2 , it says this version does not exist. What are the requirements to use this pytest version?

@The-Compiler
Copy link
Copy Markdown
Member

@jainshilpi There has not been a 7.2 release yet, so that's correct - but not related to your Python version. See #10045.

(For the record, the supported Python versions are documented here: Python version support. At the time of writing, 3.7+ is supported.)

@jainshilpi
Copy link
Copy Markdown

I see, thanks for the pointers. I suppose I'll have to wait till then? Or is there a quick fix to this issue of truncated messages at the end?

@The-Compiler
Copy link
Copy Markdown
Member

You could maybe set COLUMNS to some high value in your environment, or install pytest from git.

@TurekBot
Copy link
Copy Markdown

Really appreciate you adding this fix!

I'm new to pytest, but should "CI" and "BUILD_NUMBER" be added to the "Environment Variables" section of the reference?

@nicoddemus
Copy link
Copy Markdown
Member

I'm new to pytest, but should "CI" and "BUILD_NUMBER" be added to the "Environment Variables" section of the reference?

Good idea, created #10690 to track that. PRs are welcome! 😁

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.

Do no truncate summary messages on CI

6 participants