-
Notifications
You must be signed in to change notification settings - Fork 208
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
feat: Debug output for scheduled jobs (--debug in crontab) #1681
Conversation
…t and the necessary code to common to make it work. Fixes bit-team#1616
Thanks a lot for this. Looks good. Please do not forget the changelog entry in the Your code looks good. I added only minor suggestions in the other comments. When it comes to testing. There are two different "schools": London and Detroit (aka classic). None of them are right, good or wrong. It always depends. But for beginners they should try to follow the general rules offered by Detroit school. In that school a "unit" is not code or a code block it is "behavior". Your PR do introduce a new behavior: The crontab line (generated by the Schedule settings) contain a OK, let's cut the GUI here because it makes it to complex. You would create a unit test like this Pseudocode:
One problem with BIT is that the several code parts are not isolated enough from each other. This makes it often hard to nearly impossible to create a valuable unit tests without to much mocking/fakeing/tricking. Have you ever heard of "test driven development" (TDD)? Your PR is a good example. The behavior I described is what you want. Before starting anything else just write the tests. While writing the test you becoming more clear about the details you need and you don't need. The test will fail in the beginning. When your tests is finished and you are clear about what your needs then you start to implement the code you need to make the test pass (green!). |
@stcksmsh THX a lot for your contribution! I will review, build and test your code in detail next week I hope (I am running out of time ATM). Meanwhile first observations: |
That is not needed. The man page for the config file EDIT: Ah I see you pointed to |
This was a "late night" mistake of mine, I meant the |
Added the change to CHANGES Added two tests (`test_crontab_contains_debug` and `test_crontab_without_debug`) to `test_backup.py`
It make `make test-v` exit with non zero code
Congrats! 🥳 🎈 New tests and they are green. Nice work. I added one comment to the code. Beside of that I would suggest to move these two tests somewhere else because it IMHO to not really belong into that test suite. I am not sure how to handle the I am not sure about a solution. Because |
Thanks for the feedback and for offering to handle the changes. Feel free to proceed with moving the tests and implementing the in-memory config file. Let me know if you need any assistance. Looking forward to the improvements! |
My apologize again for blowing up this PR. Discovered a problem with the "tools" module while moving the new tests and then discovered something more.... 🤣 Shouldn't have driven it that far. Kosta: I am a bad example in this case. A PR shouldn't be that big and complex in the end. Beside the whole PR I do requesting review by @bit-team for two specific aspects of this PR and won't merge it until a I get feedback about it:
Beside of this:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve on my site. But waiting for other team mates before merging.
FYI: I plan to build and review the PR end of this week (hopefully ;-) |
Added checkbox to allow debugging to
settings>general>schedule
in qt and the necessary code to common to make it work.Fixes #1616