diff options
author | Andres Gomez <agomez@igalia.com> | 2020-12-02 02:40:54 +0200 |
---|---|---|
committer | Andres Gomez <agomez@igalia.com> | 2020-12-03 21:34:02 +0200 |
commit | e437d5f2b24f92d958bc78ac4c32bcbbecd0721d (patch) | |
tree | dba6c7eac9056cd25afe5c488f034a7e51884ee8 /framework | |
parent | 5fafccc4c5cbb35c555756b0f2c6b640b4fb7c09 (diff) |
framework: restore syserr output when loading a junit test result
pid and time start/end was artificially added. Hence, when loading, we
should remove those lines from the syserr output.
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/423>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/backends/junit.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/framework/backends/junit.py b/framework/backends/junit.py index 324f388c2..98536a09f 100644 --- a/framework/backends/junit.py +++ b/framework/backends/junit.py @@ -400,7 +400,10 @@ def _load(results_file): result.time = results.TimeAttribute(end=float(test.attrib['time'])) syserr = test.find('system-err') if syserr is not None: - result.err = syserr.text + reversed_err = syserr.text.split('\n') + reversed_err.reverse() + else: + reversed_err = [] # The command is prepended to system-out, so we need to separate those # into two separate elements @@ -413,8 +416,16 @@ def _load(results_file): else: result.out = out_tag.text + err_list = [] + skip = 0 # Try to get the values in stderr for time and pid - for line in result.err.split('\n'): + for line in reversed_err: + if skip > 0: + if line == '': + skip -= 1 + continue + else: + skip = 0 if line.startswith(_START_TIME_STR): result.time.start = float(line[len(_START_TIME_STR):]) continue @@ -423,7 +434,12 @@ def _load(results_file): continue elif line.startswith(_PID_STR): result.pid = json.loads(line[len(_PID_STR):]) + skip = 2 continue + err_list.append(line) + + err_list.reverse() + result.err = "\n".join(err_list) run_result.tests[name] = result |