From 1692081dd06bbf51ae03f8b1cdbf2e83809aefec Mon Sep 17 00:00:00 2001 From: Jeremy Bowman Date: Mon, 8 Mar 2021 10:23:50 -0500 Subject: [PATCH] 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. --- pavelib/tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pavelib/tests.py b/pavelib/tests.py index 596a7dc8b6..6a92a9e9e7 100644 --- a/pavelib/tests.py +++ b/pavelib/tests.py @@ -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,