Skip to content

Commit 3e0599f

Browse files
committed
Truncate test name to maximum allowed length of 256 chars.
`reportportal_client.errors.ResponseError: 4001: Incorrect Request. [Field 'name' should have size from '1' to '256'.]` See https://reportportal.slack.com/archives/C2GTJTTNH/p1514306996000087
1 parent 29a817e commit 3e0599f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pytest_reportportal/service.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,15 @@ def post_log(self, message, loglevel='INFO', attachment=None):
161161

162162
@staticmethod
163163
def _get_full_name(test_item):
164-
return test_item.nodeid
164+
fullname = test_item.nodeid
165+
if len(fullname) > 256:
166+
fullname = fullname[:256]
167+
test_item.warn(
168+
'C1',
169+
'Test node ID was truncated to "{}" because of name size '
170+
'constrains on reportportal'.format(fullname)
171+
)
172+
return fullname
165173

166174
@staticmethod
167175
def _get_description(test_item):

0 commit comments

Comments
 (0)