Closed marksaxer-cbs closed 3 months ago
This ticket duplicates #207 and was addressed in #209 by @bitcoder. However, I think the solution could be improved further. I am happy to pick up the work if we have a consensus on the solution
Hi @marksaxer-cbs , thanks for reporting! I agree with:
_
underscore character in the delimiters listA PR would be appreciated. Please add a test(s) for it :)
We have the exact same issue, The problem as well is that the error thrown is a bit irrelevant... "Unable to parse field title in TestRailCase tag. Title is empty."
pytest by default add "_" in delimiters..
After thinking a bit more I think just following the next approach works better:
use the last MAX_TESTCASE_TITLE_LENGTH characters within the string if the string exceeds MAX_TESTCASE_TITLE_LENGTH
@mist3r3 @marksaxer-cbs , Can you please both of you try this version and give some feedback on it?
python -m pip uninstall trcli -y
python3 -m pip install trcli-1.9.5.tar.gz
feedback would be appreciated to assess if my fix addresses your needs
The fix looks good to me and the implemented solution, in my opinion, is more ideal than adding _
to the delimiters list.
@bitcoder it's working for me, Thanks!! :)
@bitcoder actually now that I checked it, I get truncated test case names...
@mist3r3 truncating names is expectable according with what was discussed above. What is the content of your
Well I get for example testing_this_as_an_example_for_testrail_trcli_in_github_test_test_test_tes_test it is truncating the beginning.. so I would get sting_this_as_an_example_for_testrail_trcli_in_github_test_test_test_tes_test as the test case name...
I would expect to see the whole test case name... At least in the UI.
@mist3r3 can you pls share your JUnit XML report?
Thanks for sharing @mist3r3 . However, in that report,
The limit of the title at the system level is 250 chars. Eventually I can align the limit where TRCLI considers just the ending chars, from 100 chars to the 250 chars. I really don't like long test names but that's just my opinion; I can make the CLI aligned with the current implement limitation on the backend. Sounds good? @marksaxer-cbs @mist3r3 if so, I'll adjust the PR
Well, I've updated the PR. Can you please try this one? @mist3r3 , meanwhile I resubmitted the junit report you provided where I also did a small change.
I'm assuming it works for you right?
TestRail CLI Version
1.9.4
CLI Environment
Python 3.11.8
TestRail Version
v8.0.3 Default 3070
TestRail Instance Type
Enterprise Cloud
Current behavior
If a junit-report.xml file contains a testcase name that exceeds 100 characters, the entire results upload fails.
Command
Contents of "junit-report.xml"
The failure is thrown at: https://github.com/gurock/trcli/blob/62f87f2943bb649737c252c1354f5a366d65fc0d/trcli/readers/junit_xml.py#L167-L174
because
TestRailCaseFieldsOptimizer.extract_last_words
will return an empty string whencase_name
does not contain any delimiters[' ', '\t', ';', ':', '>', '/', '.']
and exceedsMAX_TESTCASE_TITLE_LENGTH
or 100 characters.It appears that, at least in the version we are using, TestRail UI accepts more than 100 characters for a test case title.
Desired behavior
I would like to be able to increase this limit or modify
extract_last_words
to always return a string with a length > 1. This could be accomplished either by:_
underscore character in the delimiters listMAX_TESTCASE_TITLE_LENGTH
to match the users version of TestRail max title lengthMAX_TESTCASE_TITLE_LENGTH
characters within the string if the string exceedsMAX_TESTCASE_TITLE_LENGTH
If those solutions are rejected, I'd like to implement:
More Details
No response