Allow parse_junit to update existing test cases case reference field from JUnit testrail_case_field properties #361
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.
Solution description
Currently, parse_junit will populate the References field when it creates a new case from a JUnit report, but it will not update that field for existing cases matched via --case-matcher. Introduce an opt-in parameter so that, when enabled, parse_junit updates existing cases using values provided in JUnit properties, e.g. testrail_case_field = "refs:PRJCT-1234"
Changes
Added new options --update-existing-cases (yes|no) which will update references of matching cases, --update-strategy (append|replace) to which what update should be done whether to append or replace
Potential impacts
None. This is backwards compatible.
Steps to test
Try to upload a JUnit xml test result and use the above new options with --case-matcher. The references for matching test cases should be updated as expected and based on the defined strategy.
PR Tasks