conu
conu copied to clipboard
ease debugging
once the container dies (in CI), it's hard to figure out what's wrong, these should help:
- [ ] provide "debugging mode"
- [ ] when something breaks, I want to stop right away (there should be an option to not clean after the test run in this case)
- [ ] the mode should raise exception when
.is_running() is False
and the exception should pretty-print container metadata and container logs tologger.debug
Internal brainstorming:
I as a container tester want to have quick way to access debugging information from my container.
Required capabilities:
Custom binary:
binary is injected into container, called and output is provided
Packaged debugging tool:
specified rpm is installed in container, called with parameters and output is provided
Optional:
provide set of methods with predefined debugging tools
Edit: changed chec_running
to is_running
.
In general, this could require adding a handful of debug logs, e.g before every exception raise. Idea with debug code injecting will be part of another issue.
We could also come with at least one scenario (ideally from examples) and twist it so it fails badly and then utilize changes based on this issue whether they ease debugging. Ideally all of this could be a complete test case. I understand this may sound complicated but it will be a great usability test.
I'm thinking about working on this as @TomasTomecek suggested some time ago. So as I understand, when the debug mode is turned on, the library should not do any clean up work upon failing, and also log everything to logger.debug
. How should the debugging mode be triggered? I think it should be a combination of —
- An environment variable, something like
CONU_DEBUG
- An argument to the
backend
class's__init__
How does this sound? Also, about implementing this, should I make the changes to the apidefs
or to individual backend's codes? I think implementing it in the apidef
would be preferable, but I'm not sure it would be possible or not.
Another question, @TomasTomecek did you mean run_cmd
by check_running
?
The triggers look good to me. Also +1 on adding this to apidefs.
By check_running
I probably meant is_running
. I'll update.
Hello @SkullTech is there any update ? Have you started working on this ? I'm just asking because we have a student here would like to work on some easy-to-start issue. There are some options and this ticket is one of them. Please let me know what are your plans with this ticket. Thanks
@jpopelka I see. I started working on this, but I got busy since because of exams in my Uni. I am planning to continue after the exams end, i.e. about 5 days from today. Will that be okay?
Sure, sounds great. Thank you !