Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
35e24d1f
Commit
35e24d1f
authored
Feb 25, 2019
by
Benedikt Kleinmeier
Browse files
In "collect_line_and_branch_coverage.py", added TODO about broken regex on Windows.
parent
a567c866
Pipeline
#93524
failed with stages
in 2 minutes and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Tools/ContinuousIntegration/collect_line_and_branch_coverage.py
View file @
35e24d1f
...
...
@@ -11,6 +11,10 @@ import xml.etree.ElementTree as ET
import
os
import
re
# Use Unix path separators because this script is usually run in a Bash-context.
# And Bash fails with Windows path separators which are introduced by os.path.join(...)
path_separator
=
"/"
def
get_modules_from_pom_file
(
filename
=
"pom.xml"
):
"""Return a list of submodules which where found in passed "pom.xml"."""
...
...
@@ -33,14 +37,15 @@ def extract_line_and_branch_coverage(module_names):
module_to_coverage
=
dict
()
default_coverage_file
=
os
.
path
.
join
(
"target"
,
"coverage-reports"
,
"index.html"
)
default_coverage_file
=
path
_separator
.
join
(
[
"target"
,
"coverage-reports"
,
"index.html"
]
)
for
module
in
module_names
:
coverage_path
=
os
.
path
.
join
(
module
,
default_coverage_file
)
coverage_path
=
path
_separator
.
join
(
[
module
,
default_coverage_file
]
)
with
open
(
coverage_path
,
"r"
)
as
file
:
coverage_report
=
file
.
read
()
# TODO: Regex seems be be broken on Windows CI worker. Find out why!
regex_pattern
=
re
.
compile
(
r
"Total.*?([0-9]{1,3})\s?%.*?([0-9]{1,3})\s?%"
)
match
=
regex_pattern
.
search
(
coverage_report
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment