-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Adding a CI mode with multiple reports going into separate report files. #7972
Comments
Hi @stas00, That's an interesting idea actually. I think this would also be useful at work where we find ourselves in the same situation. However not sure this is "core" material, because there is a bunch of questions like 1) which reports to generate, 2) file format of each report, and perhaps others if we bring more people into the discussion. Given that this doesn't need any changes into pytest itself, this actually is great candidate for a plugin. You can then play around with how the reports are generated (suiting your needs better) without having to make formal changes to pytest itself. As for how to make the code less reliable on internals: I see you deal with the stats from the terminal reporter directly. If you take at a look at the terminal reporter code, you will see that it builds its stats/reports using the hook implementations. While the terminal reporter is not really that much stable, the hooks definitely are, so I would go down the route of implementing the logic of computing the stats using hooks as well. This will duplicate a bit of work, but will be more stable and also add some flexibility there. |
IMHO this should be a post processing step on a normal result log Certainly not a part of the core framework |
+1 to @RonnyPfannschmidt and @nicoddemus. I think this is a great plugin idea |
If I may argue I'm not proposing anything different from what the core does already. The only request is to be able to log all the reports And since as I explained originally in large projects with huge test suites different developers will want to see different reports, let's So
To summarize:
The only nuance I struggled with is short vs long tbstyle, which are currently mutually exclusive - but this too can be easily solved - always save both styles in |
My personal answer to that one is a plain NO |
FWIW I also agree this is something which seems a bit too exotic to be in the core. |
While I agree with @RonnyPfannschmidt and @The-Compiler that this should not be in the core, I would like to ask @RonnyPfannschmidt to elaborate a bit more when giving a hard NO like that; after all @stas00 did present his case with a number of arguments that should be considered. It's the polite thing to do. |
I appreciate that bit of useful advice answering my "if not core" part of the question, @nicoddemus! I guess with the vehement opposition from @RonnyPfannschmidt, this can be safely closed. |
At transformers - there are multiple CIs and multiple test suites and multiple developers who all want to see different reports. So dumping all reports together makes it for a very difficult time to find things one wants. So I put together a hacked version of the report generator which generates multiple reports which can then be uploaded as artifacts, both in circleCI and github actions.
The CIs are special since one can't just log into the machine and re-run failing tests most of the time, and some of those test suites run for many hours, so getting as much information as possible, yet, being able to locate what one needs quickly is essential. Currently this is not so - it's very difficult to find the relevant error messages on failure as they are hidden in a multitude of warnings, logs and other reports.
Request:
The following code generates multiple reports putting them all in one directory with a custom prefix (as some test suites are run multiple times with different setups on the same CI job and we want those reports to be separate). There are probably other reports that could be added, I currently I have:
--durations
--tb=long
--tb=short
--tb=line
-rA
each ending up in its own file, e.g.
reports/some_id_durations.txt
.All these get generated without needing to add any arguments to
pytest
and allowing it to function normally with any other reports one does choose to dump to the terminal.and
conftest.py
:I'd probably call it
--ci-mode
, as this would be a killer feature for CIs.Thank you!
The text was updated successfully, but these errors were encountered: