Fix diff-cover with recent git versions on shallow repositories (#26879)

When we tried upgrading Jenkins workers from Ubuntu 16.04 to 20.04, `diff-cover` started silently failing with a return code of `1`.  We suspect this is due to https://github.com/Bachmann1234/diff_cover/issues/153 , so we're adding the workaround described in that ticket.
This commit is contained in:
Jeremy Bowman
2021-03-08 10:23:50 -05:00
committed by GitHub
parent 5fcf88f31e
commit 1692081dd0

View File

@@ -389,8 +389,9 @@ def diff_coverage(options):
diff_html_path = os.path.join(Env.REPORT_DIR, 'diff_coverage_combined.html')
# Generate the diff coverage reports (HTML and console)
# The --diff-range-notation parameter is a workaround for https://github.com/Bachmann1234/diff_cover/issues/153
sh(
"diff-cover {xml_report_str} --compare-branch={compare_branch} "
"diff-cover {xml_report_str} --diff-range-notation '..' --compare-branch={compare_branch} "
"--html-report {diff_html_path}".format(
xml_report_str=xml_report_str,
compare_branch=compare_branch,