Skip to content

Commit 68053a2

Browse files
author
Yury Krasouski
authored
Merge pull request #48 from s0undt3ch/master
Truncate test name to maximum allowed length of 256 chars.
2 parents b5bd9b8 + 3e0599f commit 68053a2

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)