Merge pull request #17252 from edx/zoldak/TE-2396
Shard the quality tasks on jenkins TE-2396
This commit is contained in:
@@ -11,10 +11,7 @@ set -e
|
||||
###############################################################################
|
||||
|
||||
# Violations thresholds for failing the build
|
||||
export LOWER_PYLINT_THRESHOLD=1000
|
||||
export UPPER_PYLINT_THRESHOLD=5900
|
||||
export ESLINT_THRESHOLD=5700
|
||||
export STYLELINT_THRESHOLD=973
|
||||
source scripts/thresholds.sh
|
||||
|
||||
XSSLINT_THRESHOLDS=`cat scripts/xsslint_thresholds.json`
|
||||
export XSSLINT_THRESHOLDS=${XSSLINT_THRESHOLDS//[[:space:]]/}
|
||||
|
||||
@@ -100,28 +100,43 @@ function run_paver_quality {
|
||||
case "$TEST_SUITE" in
|
||||
|
||||
"quality")
|
||||
echo "Finding fixme's and storing report..."
|
||||
run_paver_quality find_fixme || EXIT=1
|
||||
echo "Finding pep8 violations and storing report..."
|
||||
run_paver_quality run_pep8 || EXIT=1
|
||||
echo "Finding pylint violations and storing in report..."
|
||||
run_paver_quality run_pylint -l $LOWER_PYLINT_THRESHOLD:$UPPER_PYLINT_THRESHOLD || EXIT=1
|
||||
|
||||
mkdir -p reports
|
||||
|
||||
echo "Finding ESLint violations and storing report..."
|
||||
run_paver_quality run_eslint -l $ESLINT_THRESHOLD || EXIT=1
|
||||
echo "Finding Stylelint violations and storing report..."
|
||||
run_paver_quality run_stylelint -l $STYLELINT_THRESHOLD || EXIT=1
|
||||
echo "Running code complexity report (python)."
|
||||
run_paver_quality run_complexity || echo "Unable to calculate code complexity. Ignoring error."
|
||||
echo "Running xss linter report."
|
||||
run_paver_quality run_xsslint -t $XSSLINT_THRESHOLDS || EXIT=1
|
||||
echo "Running safe commit linter report."
|
||||
run_paver_quality run_xsscommitlint || EXIT=1
|
||||
# Run quality task. Pass in the 'fail-under' percentage to diff-quality
|
||||
echo "Running diff quality."
|
||||
run_paver_quality run_quality -p 100 -l $LOWER_PYLINT_THRESHOLD:$UPPER_PYLINT_THRESHOLD || EXIT=1
|
||||
case "$SHARD" in
|
||||
1)
|
||||
echo "Finding pylint violations and storing in report..."
|
||||
run_paver_quality run_pylint --system=common || { EXIT=1; }
|
||||
;;
|
||||
|
||||
2)
|
||||
echo "Finding pylint violations and storing in report..."
|
||||
run_paver_quality run_pylint --system=lms || { EXIT=1; }
|
||||
;;
|
||||
|
||||
3)
|
||||
echo "Finding pylint violations and storing in report..."
|
||||
run_paver_quality run_pylint --system="cms,openedx,pavelib" || { EXIT=1; }
|
||||
;;
|
||||
|
||||
4)
|
||||
echo "Finding fixme's and storing report..."
|
||||
run_paver_quality find_fixme || { EXIT=1; }
|
||||
echo "Finding pep8 violations and storing report..."
|
||||
run_paver_quality run_pep8 || { EXIT=1; }
|
||||
echo "Finding ESLint violations and storing report..."
|
||||
run_paver_quality run_eslint -l $ESLINT_THRESHOLD || { EXIT=1; }
|
||||
echo "Finding Stylelint violations and storing report..."
|
||||
run_paver_quality run_stylelint -l $STYLELINT_THRESHOLD || { EXIT=1; }
|
||||
echo "Running code complexity report (python)."
|
||||
run_paver_quality run_complexity || echo "Unable to calculate code complexity. Ignoring error."
|
||||
echo "Running xss linter report."
|
||||
run_paver_quality run_xsslint -t $XSSLINT_THRESHOLDS || { EXIT=1; }
|
||||
echo "Running safe commit linter report."
|
||||
run_paver_quality run_xsscommitlint || { EXIT=1; }
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Need to create an empty test result so the post-build
|
||||
# action doesn't fail the build.
|
||||
|
||||
13
scripts/jenkins-quality-diff.sh
Executable file
13
scripts/jenkins-quality-diff.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# This script is used by the edx-platform-quality-check jenkins job.
|
||||
source scripts/jenkins-common.sh
|
||||
source scripts/thresholds.sh
|
||||
|
||||
# Run quality task. Pass in the 'fail-under' percentage to diff-quality
|
||||
echo "Running diff quality."
|
||||
mkdir -p test_root/log/
|
||||
LOG_PREFIX=test_root/log/run_quality
|
||||
|
||||
paver run_quality -p 100 -l $LOWER_PYLINT_THRESHOLD:$UPPER_PYLINT_THRESHOLD 2> $LOG_PREFIX.err.log > $LOG_PREFIX.out.log
|
||||
7
scripts/thresholds.sh
Executable file
7
scripts/thresholds.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
export LOWER_PYLINT_THRESHOLD=1000
|
||||
export UPPER_PYLINT_THRESHOLD=5900
|
||||
export ESLINT_THRESHOLD=5700
|
||||
export STYLELINT_THRESHOLD=973
|
||||
Reference in New Issue
Block a user