Draft: New debug tree
Summary
This MR implements a completely overworked and heavily improved debug tree that can be used to:
- trace errors in the crawler code
- find the causes of bugs and unexpected behavior in cfood files
- write unit tests for the crawler
The functionality is implemented in the scanner module which receives an additional argument for the new_debug_tree
. This argument is used recursively to generate a tree structure of roughly the following form:
- SE1:
matching_converters:
- C1:
- SE1a
- SE1b
- SE1c
- ...
- SE2
- SE3
- ...
So every level of structure elements (SEx) includes all information about a specific structure element that was scanned.
The attribute matching_converters
includes all information about matching converters (which recurses in its subtree
).
There is a function in the scanner module now that allows turning this information into an HTML-file with collapsible tree elements (using CSS).
Here is an example of how the output looks like:
This MR furthermore implements a small change that allows to deactivate specific levels in the CFood using the "deactivate" key.
Test Environment
This should be manually tested by generating the scanner output files using the function save_debug_tree. Furthermore, there are some unit tests.
Check List for the Author
Please, prepare your MR for a review. Be sure to write a summary and a focus and create gitlab comments for the reviewer. They should guide the reviewer through the changes, explain your changes and also point out open questions. For further good practices have a look at our review guidelines
-
All automated tests pass -
Reference related issues -
Up-to-date CHANGELOG.md (or not necessary) -
Up-to-date JSON schema (or not necessary) -
Appropriate user and developer documentation (or not necessary) - How do I use the software? Assume "stupid" users.
- How do I develop or debug the software? Assume novice developers.
-
Annotations in code (Gitlab comments) - Intent of new code
- Problems with old code
- Why this implementation?
Check List for the Reviewer
-
I understand the intent of this MR -
All automated tests pass -
Up-to-date CHANGELOG.md (or not necessary) -
Appropriate user and developer documentation (or not necessary) -
The test environment setup works and the intended behavior is reproducible in the test environment -
In-code documentation and comments are up-to-date. -
Check: Are there specifications? Are they satisfied?
For further good practices have a look at our review guidelines.
Merge request reports
Activity
requested review from @florian
assigned to @salexan
added 1 commit
- 5a5fa92e - TST: added a basic test for the new debug tree
I probably don't find the time to complete this issue in time.
The only functionality - from my perspective - that is currently missing, is to add the functionality to
crawler_main
, e.g. using a new command line argument.The function that is supposed to be called is:
save_debug_tree
from thescanner
module.Please also have a look at the unit test that shows how the debug tree is generated.
added 1 commit
- 364f1de9 - FIX: bug in implementation of command line option --new-debug-tree
added 1 commit
- 7db29bc8 - ENH: added an option to deactivate a specific level in a CFood
added 1 commit
- f77077de - DOC: notice about possible deprecation of the old debug tree
added 104 commits
-
f77077de...3a5a4bf4 - 103 commits from branch
dev
- 9de1475b - Merge branch 'dev' into f-new-debug-tree
-
f77077de...3a5a4bf4 - 103 commits from branch
added 2 commits
mentioned in merge request !96 (closed)
mentioned in issue #133
added 577 commits
-
4c925e19...96ae0ada - 576 commits from branch
dev
- f200440c - Merge branch 'dev' into f-new-debug-tree
-
4c925e19...96ae0ada - 576 commits from branch
added 1 commit
- 7ab9dd2a - Merge branch 'dev' into f-new-debug-tree-improved
mentioned in issue #130