Open The-Mule opened 1 month ago
In my script I am removing "invalid" characters with
d = re.sub(u'[^\u0020-\uD7FF\u0009\u000A\u000D\uE000-\uFFFD\U00010000-\U0010FFFF]+', '', data)
although other alternatives like replacing them with the respective unicode number might be also reasonable.
I actually thing the only invalid character is \00 (null byte). There are a ton of non-printable characters in the logs from what I can see but the only one that breaks log/entry post request is null byte. What I did on my machine to fix it temporarily was:
for index, log_path in enumerate(result.log):
try:
log = str(self.step.plan.execute.read(log_path)).replace('\00', '\\00')
# ^^^^^^^^^^^^^^^^^^^^^^^
except tmt.utils.FileError:
continue
level = "INFO" if log_path == result.log[0] else "TRACE"
status = self.TMT_TO_RP_RESULT_STATUS[result.result]
And it works for me.
I think that I have hit this issue also for a different control character. Also, CDATA included in test output might be a problem.
Maybe we can have just link to TF instead of logs (the way we had it in TCMS)...? But I assume RP TA is expected to work on logs and that is why we have it there. Also, TF results would have to be slightly improved to be able to navigate there (through anchors or something similar). But you know - for real debugging one have to look there anyway. Debugging based solely on TESTOUT.log is very limited.
Right, AA needs a failure log. But I find complete log handy too, in most cases there isnt more verbose log available anyway.
We noticed that when test results contains a null character ('\0') then reportportal report phase fails as follows:
See http://artifacts.osci.redhat.com/testing-farm/aa52f015-8f84-45b8-9419-cb3be3919e85/ for more details about the run. There is a null characted in TESTOUT.log in the test report (propagated from test PURPOSE file).
When this null character is removed from PURPOSE file and test is re-executed, it can be reported fine.
Please notice that having a special character in the TESTOUT.log is completely okay - this particular test is almost 16 years old and was executed (and reported elsewhere) hundreds of times. We need to fix either plugin or RP to handle this situation correctly (without errors).