Commit 5ed3e5ed by Calen Pennington

Make run_quality use the same upper pylint limit as run_pylint

parent 97f12ff2
...@@ -685,6 +685,7 @@ def _get_xsscommitlint_count(filename): ...@@ -685,6 +685,7 @@ def _get_xsscommitlint_count(filename):
@cmdopts([ @cmdopts([
("compare-branch=", "b", "Branch to compare against, defaults to origin/master"), ("compare-branch=", "b", "Branch to compare against, defaults to origin/master"),
("percentage=", "p", "fail if diff-quality is below this percentage"), ("percentage=", "p", "fail if diff-quality is below this percentage"),
("limit=", "l", "Limits for number of acceptable violations - either <upper> or <lower>:<upper>"),
]) ])
@timed @timed
def run_quality(options): def run_quality(options):
...@@ -730,7 +731,7 @@ def run_quality(options): ...@@ -730,7 +731,7 @@ def run_quality(options):
lines.extend([sep, title, sep, violations_str, sep, violations_count_str]) lines.extend([sep, title, sep, violations_str, sep, violations_count_str])
if count > limit: if count > limit > -1:
lines.append(fail_line) lines.append(fail_line)
lines.append(sep + '\n') lines.append(sep + '\n')
if is_html: if is_html:
...@@ -757,14 +758,16 @@ def run_quality(options): ...@@ -757,14 +758,16 @@ def run_quality(options):
(count, violations_list) = _get_pylint_violations(clean=False) (count, violations_list) = _get_pylint_violations(clean=False)
_, upper_violations_limit, _, _ = _parse_pylint_options(options)
# Print number of violations to log # Print number of violations to log
print _lint_output('pylint', count, violations_list, limit=6100) print _lint_output('pylint', count, violations_list, limit=upper_violations_limit)
# Also write the number of violations to a file # Also write the number of violations to a file
with open(dquality_dir / "diff_quality_pylint.html", "w") as f: with open(dquality_dir / "diff_quality_pylint.html", "w") as f:
f.write(_lint_output('pylint', count, violations_list, is_html=True, limit=6100)) f.write(_lint_output('pylint', count, violations_list, is_html=True, limit=upper_violations_limit))
if count > 6100: if count > upper_violations_limit > -1:
diff_quality_percentage_pass = False diff_quality_percentage_pass = False
# ----- Set up for diff-quality pylint call ----- # ----- Set up for diff-quality pylint call -----
......
...@@ -116,7 +116,7 @@ case "$TEST_SUITE" in ...@@ -116,7 +116,7 @@ case "$TEST_SUITE" in
run_paver_quality run_xsscommitlint || EXIT=1 run_paver_quality run_xsscommitlint || EXIT=1
# Run quality task. Pass in the 'fail-under' percentage to diff-quality # Run quality task. Pass in the 'fail-under' percentage to diff-quality
echo "Running diff quality." echo "Running diff quality."
run_paver_quality run_quality -p 100 || EXIT=1 run_paver_quality run_quality -p 100 -l $LOWER_PYLINT_THRESHOLD:$UPPER_PYLINT_THRESHOLD || EXIT=1
# Need to create an empty test result so the post-build # Need to create an empty test result so the post-build
# action doesn't fail the build. # action doesn't fail the build.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment