From 6dc6dbc801f8f5a559e9a4ff8ed797e47b95aab4 Mon Sep 17 00:00:00 2001 From: Daniel Lehmberg Date: Mon, 25 Feb 2019 20:13:32 +0100 Subject: [PATCH] fix (for now) for the Python script --- .../collect_line_and_branch_coverage.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tools/ContinuousIntegration/collect_line_and_branch_coverage.py b/Tools/ContinuousIntegration/collect_line_and_branch_coverage.py index cbbba4b97..b46432533 100644 --- a/Tools/ContinuousIntegration/collect_line_and_branch_coverage.py +++ b/Tools/ContinuousIntegration/collect_line_and_branch_coverage.py @@ -46,6 +46,12 @@ def extract_line_and_branch_coverage(module_names): coverage_report = file.read() # TODO: Regex seems be be broken on Windows CI worker. Find out why! + # This is a somewhat dirty fix for windows OS (I leave the todo open, if someone knows a cleaner solution. + # When parsing the html, there appear unicode(?) issues and in this case whitespaces are represented as Â\xa0 + # I think this has something to do with it: + # https://stackoverflow.com/questions/13865346/why-would-a-python-regex-compile-on-linux-but-not-windows + coverage_report = coverage_report.replace('Â\xa0', ' ') + regex_pattern = re.compile(r"Total.*?([0-9]{1,3})\s?%.*?([0-9]{1,3})\s?%") match = regex_pattern.search(coverage_report) -- GitLab