Skip to content

Commit 536fbaf

Browse files
author
Chris Elion
authored
Run coverage checks with python3 (#4245)
1 parent 3901bad commit 536fbaf

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

.yamato/com.unity.ml-agents-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ test_{{ package.name }}_{{ platform.name }}_{{ editor.version }}:
6969

7070
{% if package.name == "com.unity.ml-agents" %}
7171
# TODO get coverage tests running for extensions too
72-
- python ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ editor.minCoveragePct }}
72+
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ editor.minCoveragePct }}
7373
{% endif %}
7474
artifacts:
7575
logs:
@@ -110,7 +110,7 @@ test_{{ package.name }}_{{ platform.name }}_trunk:
110110
- upm-ci project test -u {{ editor.version }} --project-path Project --package-filter {{ package.name }} {{ editor.coverageOptions }}
111111
{% if package.name == "com.unity.ml-agents" %}
112112
# TODO get coverage tests running for extensions too
113-
- python ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ editor.minCoveragePct }}
113+
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ editor.minCoveragePct }}
114114
{% endif %}
115115
artifacts:
116116
logs:

ml-agents/tests/yamato/check_coverage_percent.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
SUMMARY_XML_FILENAME = "Summary.xml"
55

6-
# Note that this is python2 compatible, since that's currently what's installed on most CI images.
7-
86

97
def check_coverage(root_dir, min_percentage):
108
# Walk the root directory looking for the summary file that
@@ -30,16 +28,12 @@ def check_coverage(root_dir, min_percentage):
3028
pct = float(pct)
3129
if pct < min_percentage:
3230
print(
33-
"Coverage {} is below the min percentage of {}.".format(
34-
pct, min_percentage
35-
)
31+
f"Coverage {pct} is below the min percentage of {min_percentage}."
3632
)
3733
sys.exit(1)
3834
else:
3935
print(
40-
"Coverage {} is above the min percentage of {}.".format(
41-
pct, min_percentage
42-
)
36+
f"Coverage {pct} is above the min percentage of {min_percentage}."
4337
)
4438
sys.exit(0)
4539

0 commit comments

Comments
 (0)