weixin_39553600
weixin_39553600
2020-12-09 07:06

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 to logger.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.

该提问来源于开源项目:user-cont/conu

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

7条回答

  • weixin_39904522 weixin_39904522 5月前

    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.

    点赞 评论 复制链接分享
  • weixin_39553600 weixin_39553600 5月前

    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.

    点赞 评论 复制链接分享
  • weixin_39951773 weixin_39951773 5月前

    I'm thinking about working on this as 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, did you mean run_cmd by check_running?

    点赞 评论 复制链接分享
  • weixin_39553600 weixin_39553600 5月前

    The triggers look good to me. Also +1 on adding this to apidefs.

    By check_running I probably meant is_running. I'll update.

    点赞 评论 复制链接分享
  • weixin_39843738 weixin_39843738 5月前

    Hello
    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

    点赞 评论 复制链接分享
  • weixin_39951773 weixin_39951773 5月前

    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?

    点赞 评论 复制链接分享
  • weixin_39843738 weixin_39843738 5月前

    Sure, sounds great. Thank you !

    点赞 评论 复制链接分享

相关推荐