Skip to content

Commit

Permalink
[GR-45938] Add support for jacocoExcludePackage to suite.py.
Browse files Browse the repository at this point in the history
PullRequest: mx/1608
  • Loading branch information
wirthi committed May 15, 2023
2 parents 899249d + 7a01bdf commit 7010f71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18446,7 +18446,7 @@ def alarm_handler(signum, frame):
abort(1, killsig=signal.SIGINT)

# The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue
version = VersionSpec("6.23.3") # [GR-46006] Update to JaCoCo 0.8.10 for JDK 21 support.
version = VersionSpec("6.23.4") # GR-45938 fix coverage information by having a jacocoExcludePackages entry in suite.py

currentUmask = None
_mx_start_datetime = datetime.utcnow()
Expand Down
5 changes: 5 additions & 0 deletions mx_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ def _jacoco_excludes_includes():
for p in mx.projects():
if p.isJavaProject():
projsetting = getattr(p, 'jacoco', '')
assert isinstance(projsetting, str), f'jacoco must be a string, not a {type(projsetting)}'
if not _jacoco_is_package_whitelisted(p.name):
pass
elif projsetting == 'exclude':
Expand All @@ -818,6 +819,10 @@ def _jacoco_excludes_includes():
baseExcludes.append(p.name)
elif projsetting == 'include':
includes.append(p.name + '.*')
packagelist = getattr(p, 'jacocoExcludePackages', [])
assert isinstance(packagelist, list), f'jacocoExcludePackages must be a list, not a {type(packagelist)}'
for packagename in packagelist:
baseExcludes.append(packagename)
if _jacoco_whitelisted_packages:
includes.extend((x + '.*' for x in _jacoco_whitelisted_packages))

Expand Down

0 comments on commit 7010f71

Please sign in to comment.