Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .yamato/com.unity.ml-agents-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test_{{ package.name }}_{{ platform.name }}_{{ editor.version }}:

{% if package.name == "com.unity.ml-agents" %}
# TODO get coverage tests running for extensions too
- python ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ editor.minCoveragePct }}
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ editor.minCoveragePct }}
{% endif %}
artifacts:
logs:
Expand Down Expand Up @@ -110,7 +110,7 @@ test_{{ package.name }}_{{ platform.name }}_trunk:
- upm-ci project test -u {{ editor.version }} --project-path Project --package-filter {{ package.name }} {{ editor.coverageOptions }}
{% if package.name == "com.unity.ml-agents" %}
# TODO get coverage tests running for extensions too
- python ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ editor.minCoveragePct }}
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ editor.minCoveragePct }}
{% endif %}
artifacts:
logs:
Expand Down
10 changes: 2 additions & 8 deletions ml-agents/tests/yamato/check_coverage_percent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

SUMMARY_XML_FILENAME = "Summary.xml"

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


def check_coverage(root_dir, min_percentage):
# Walk the root directory looking for the summary file that
Expand All @@ -30,16 +28,12 @@ def check_coverage(root_dir, min_percentage):
pct = float(pct)
if pct < min_percentage:
print(
"Coverage {} is below the min percentage of {}.".format(
pct, min_percentage
)
f"Coverage {pct} is below the min percentage of {min_percentage}."
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might was well go all-in on the f-strings.

)
sys.exit(1)
else:
print(
"Coverage {} is above the min percentage of {}.".format(
pct, min_percentage
)
f"Coverage {pct} is above the min percentage of {min_percentage}."
)
sys.exit(0)

Expand Down