How are we solving the problem?
When attempting to add test results from the junit.xml file, if one of the test names includes an invalid or unknown case ID (CXXX) that is not present in TestRail's test suite under the specified test run, the --case-matcher name command cannot be used. In such a situation, the command will abort and display the message "Case CXXX is unknown or not part of the test run." Therefore, I have created a new case-matcher specifically designed for this situation.
Changes
What changes were made?
in trcli\api\api_request_handler.py, I added new condition elif self.environment.case_matcher == MatchersParser.NAME_SKIP_UNKNOWN:
in trcli/commands/cmd_parse_junit.py, I added type=click. Choice(["auto", "name", "property", "name_skip_unknown"], case_sensitive=False),
in trcli/data_classes/data_parsers.py, I added NAME_SKIP_UNKNOWN = "name_skip_unknown"
in trcli/readers/junit_xml.py, I added new condition elif self.case_matcher == MatchersParser.NAME_SKIP_UNKNOWN:
Potential impacts
What could potentially be affected by the implemented changes?
Steps to test
Happy path to test implemented scenario
Create a test run that includes a single test suite.
Within the test suite, include two test cases.
Update the junit.xml file to include the names of the two tests.
Ensure that one of the test names in the junit.xml file matches the test name specified in the test suite.
Issue being resolved: https://github.com/gurock/trcli/issues/148
Solution description
How are we solving the problem? When attempting to add test results from the junit.xml file, if one of the test names includes an invalid or unknown case ID (CXXX) that is not present in TestRail's test suite under the specified test run, the --case-matcher name command cannot be used. In such a situation, the command will abort and display the message "Case CXXX is unknown or not part of the test run." Therefore, I have created a new case-matcher specifically designed for this situation.
Changes
What changes were made?
elif self.environment.case_matcher == MatchersParser.NAME_SKIP_UNKNOWN:
type=click. Choice(["auto", "name", "property", "name_skip_unknown"], case_sensitive=False),
NAME_SKIP_UNKNOWN = "name_skip_unknown
"elif self.case_matcher == MatchersParser.NAME_SKIP_UNKNOWN:
Potential impacts
What could potentially be affected by the implemented changes?
Steps to test
Happy path to test implemented scenario
PR Tasks