Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically trim summary to 255 characters #44

Closed
nchigwamba opened this issue Mar 23, 2021 · 1 comment
Closed

Automatically trim summary to 255 characters #44

nchigwamba opened this issue Mar 23, 2021 · 1 comment

Comments

@nchigwamba
Copy link

nchigwamba commented Mar 23, 2021

I have a number of legacy tests (8000+) that produce xunit output. The test case class and classname are sometimes very long. I end up running into the following error:

Traceback (most recent call last):
  File "/usr/local/bin/tcms-junit.xml-plugin", line 11, in <module>
    main(sys.argv)
  File "/usr/local/lib/python3.9/site-packages/tcms_junit_plugin/__init__.py", line 77, in main
    plugin.parse(argv[1])
  File "/usr/local/lib/python3.9/site-packages/tcms_junit_plugin/__init__.py", line 31, in parse
    test_case, _ = self.backend.test_case_get_or_create(summary)
  File "/usr/local/lib/python3.9/site-packages/tcms_api/plugin_helpers.py", line 448, in test_case_get_or_create
    test_case = [self.rpc.TestCase.create({
  File "/usr/local/lib/python3.9/xmlrpc/client.py", line 1116, in __call__
    return self.__send(self.__name, args)
  File "/usr/local/lib/python3.9/xmlrpc/client.py", line 1456, in __request
    response = self.__transport.request(
  File "/usr/local/lib/python3.9/xmlrpc/client.py", line 1160, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/local/lib/python3.9/xmlrpc/client.py", line 1176, in single_request
    return self.parse_response(resp)
  File "/usr/local/lib/python3.9/site-packages/tcms_api/xmlrpc.py", line 41, in parse_response
    return super().parse_response(response)
  File "/usr/local/lib/python3.9/xmlrpc/client.py", line 1348, in parse_response
    return u.close()
  File "/usr/local/lib/python3.9/xmlrpc/client.py", line 662, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault -32603: "Internal error: [('summary', 'Ensure this value has at most 255 characters (it has 293).')]">

Is it possible to automatically trim the summary to 255 characters here: https://github.com/kiwitcms/junit.xml-plugin/blob/master/tcms_junit_plugin/__init__.py#L29

@atodorov
Copy link
Member

Is it possible to automatically trim the summary to 255 characters here: https://github.com/kiwitcms/junit.xml-plugin/blob/master/tcms_junit_plugin/__init__.py#L29

It is certainly possible. Since you have located the exact place in the source code where this needs to be changed the Kiwi TCMS would welcome a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants