From 9b013319343d28d0d4eac503ad0b41ace8ab4c0c Mon Sep 17 00:00:00 2001 From: William Manley Date: Fri, 4 Sep 2020 16:41:34 +0100 Subject: [PATCH] JUnit XML output: Include timezone information in XML JUnit writes local-time without a timezone by default. This means that JUnit XML parsers default to local-time. The portal doesn't know what timezone the user of stbt-rig wants so these timestamps can be interpreted incorrectly. This change includes timezone information in the XML output. There is a small chance of incompatibilty caused by this change. If you experience this please get in contact at support@stb-tester.com. --- stbt_rig.py | 3 ++- test_stbt_rig.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stbt_rig.py b/stbt_rig.py index 00e2e9a..f8f73ca 100755 --- a/stbt_rig.py +++ b/stbt_rig.py @@ -839,7 +839,8 @@ def list_results(self): def list_results_xml(self): r = self.portal._get( - '/api/v2/results.xml', params={'filter': 'job:%s' % self.job_uid}) + '/api/v2/results.xml', params={'filter': 'job:%s' % self.job_uid, + 'include_tz': 'true'}) r.raise_for_status() return r.text diff --git a/test_stbt_rig.py b/test_stbt_rig.py index 253a01f..aca72b7 100644 --- a/test_stbt_rig.py +++ b/test_stbt_rig.py @@ -208,6 +208,7 @@ def get_results(): @self.app.route('/api/v2/results.xml') def get_results_xml(): assert flask.request.args['filter'] == 'job:/mynode/6Pfq/167' + assert flask.request.args['include_tz'] == 'true' return PortalMock.RESULTS_XML @self.app.route('/api/v2/results/') @@ -276,7 +277,7 @@ def on_run_tests(self, j): RESULTS_XML = ( '' + 'timestamp="2019-06-12T15:26:35+00:00">' '' '')