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

Remove --log-cli-level INFO when calling pytest #304

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

antoinebrl
Copy link
Contributor

Setting the log level to INFO displays all the test names. If the test suite is large the logs long can be hard to digest. pytest-xdist make the problem even worse by printing each test name twice, on start and on completion. Moreover, this argument can conflict with options specified in the pyproject.toml, preventing users from adjusting the information displayed by pytest. By removing this option, one would be able to track progress with a progress bar for example while still displaying the test name in the summary table if needed.

Solves #300

@antoinebrl antoinebrl requested review from Tpt and srstevenson January 24, 2025 20:28
@antoinebrl antoinebrl self-assigned this Jan 24, 2025
@vsiles
Copy link
Contributor

vsiles commented Jan 25, 2025

Since this will change the output people are used to, would it be possible to make it explicit in the changelog how to get some of these logs back in the new version ?

@srstevenson
Copy link
Contributor

To maintain compatibility for users accustomed to this output format, an alternative approach could be to continue passing the --log-cli-level argument while making the level configurable via the pytest task. This would default to INFO for compatibility:

pytest_task(cli_log_level="INFO")

The tradeoff is that maintaining compatibility requires configuring this differently when using Kraken compared to calling pytest directly.

@Tpt
Copy link
Contributor

Tpt commented Jan 27, 2025

My 2cents: If it's possible to configure verbosity using pyproject.toml I am not sure that having an option in Kraken brings much more than extra complexity. I would not bother too much on backward compatibility, this is only debug verbosity and if the changelog is clear enough (giving an example on how to revert the change), users should be able to migrate smoothly.

@antoinebrl antoinebrl force-pushed the ab/pytest-log-cli-level branch from 3b10727 to 2041110 Compare January 27, 2025 11:14
@antoinebrl
Copy link
Contributor Author

I'm quite aligned with @Tpt and can only echo what he said. Having that configuration in two places will introduce some complexity, both for the users and some extra logic to fuse the different sources. Add the end, this is only impacting the structure of the logs and the users can easily add back this option via the configuration file. I've updated the description in the changelog.

@antoinebrl antoinebrl requested a review from vsiles January 27, 2025 11:16
@antoinebrl antoinebrl merged commit 1bd91d2 into develop Jan 27, 2025
14 checks passed
@antoinebrl antoinebrl deleted the ab/pytest-log-cli-level branch January 27, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants