[Refactor] Added refactored version of JunitParser for review #309
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue being resolved: #308 #107
Solution description
I refactored JunitParser for better maintainability.
At first I would like to provide for review and only then if everything is ok, replace the current solution.
Also It should solve the issue with case result statuses mapping.
Changes
Restructured huge
parse_filemethod with small methods.Replaced and reworked methods from TestRailResult post_init section (they should not be there) into JunitParser,
Still todo: remove them from data class
this part:
Now case result statuses
{"passed": 1, "skipped": 4,"error": 5, "failure": 5}might be overridden using config.ymlPotential impacts
Result of junit xml parsing
Steps to test
replace
from trcli.readers.junit_xml import JunitParserin cmd_parse_junit.py with fromtrcli.readers.junit_xml_refactored import JunitParserthen run unit tests
also add to config.yaml:
(your desired mappings)
endpoint to get ids of result statuses for your project /api/v2/get_statuses
UPD:
Replaced current junit parser with refactored after review.
PR Tasks