-
-
Notifications
You must be signed in to change notification settings - Fork 526
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
Log/Export environment details to machine-readable file #790
Comments
This sounds like a great candidate for a plugin. |
Few comments:
In pipenv issue regarding pipenv (anti)patterns is somewhere in the middle "Mode: Generate and Seal", serving you with Warning: when using |
And it also needs to create its own venv, because if it reuses the venv created by tox, it does not update My goal is to get such a function without any need for the user to reconfigure something. Maybe there is a way to get a However, my current plan for such a plugin looks like this:
It's quite simple and as tox already provides the hook |
I don‘t know much about pipenv yet, but I am pretty sure that it will cause a lot of pain in conjunction with vanilla tox. If you wanna go down that road you will have to throw https://pypi.org/project/tox-pipenv/ into the mix. |
@danwos I guess, proposed plugin would serve well. My comment is only reminder, there are already existing formats for information you are going to record somewhere. Using existing formats could simplify further reuse (e.g. having Personally I have rather reserved position to using Anyway, I have few ideas and corrections related to your comments:
Anyway, I completely agree with @obestwalter that (at least currently) using Regading If you go for plugin creating |
Ok, I spend some time to create a first alpha version of a plugin and here we go: It is far away from being stable, bug-free or really helpful. I tried hard to find a solution for getting a However, the current implementation is quite small, because tox internally stores already a lot of information about its venvs. I only needed to jsonifiy the data and store it somewhere. So currently you get a Question: Is there any hook, which gets called only once for a complete tox run? (e.g. tox_runall_post). Next steps (if I find some time):
Beside this plugin, I'm also planning to create a sphinx-extension for documenting test-results( junit format) and test envs (tox-envreport format) inside a sphinx documentation. Thanks for all the help and awesome ideas! |
@danring it seems like Speedy Gonzales is your slower brother.
Did you consider placing one json report per virtualenv directory? E.g. in |
Yes, that's already implemented.
Each venv get its own specific env_report_xxx.json file in the related venv-folder. Where xxx is the name of the current venv.
(See the short documentation for details)
Sorry, I have forgotten to mention it in my prior post.
|
@danring Good. I searched for file location in your doc and ended at the 2nd paragraph as it seemed to answer my question. I had no idea there are two types of reports generated. I would propose one of following:
|
@vlcinsky Thanks for your feedback. You are right, 2 different names for the 2 kinds of files are really helpful. I changed the code and reorganized the documentation. Skipping the global report is not a good idea for my use case. I close this tox-related issue now. And again, thanks for all the feedback and ideas. It was a pleasure to get a solution in less than 2 days 👍 |
Proposal
Create a json/xml file for each used environment, which stores installed python packages and system information (os, cpu, ...)
A xml file could look like this:
Motivation
I'm working for an automotive company and on my current project I have to archive test results for the next 20+ years. For test results most libraries support the junit export format, which makes it easy to reuse this information automatically in other tools like sphinx, word, ...
But beside test results I also need to document and archive the used test environment itself.
For instance it is very important to know, if tests have been run on the final target system and final os. Or if some "old" versions were used to get needed results.
Current situation
Currently this kind of information is spread around several log messages and most of them have different formats, which are not easily parsable.
You could also execute pip freeze and write own scripts to collect system information for each used environment.
Maybe also the usage of the hook tox.hookspecs.tox_runenvreport is an option.
However, all of this needs a bunch of time to develop own solutions for collecting already available information.
The text was updated successfully, but these errors were encountered: