Merge "Add check for makemessages in tox.ini PEP8"
This commit is contained in:
commit
9a5bb3e070
14
run_tests.sh
14
run_tests.sh
|
@ -24,6 +24,7 @@ function usage {
|
||||||
echo " -m, --manage Run a Django management command."
|
echo " -m, --manage Run a Django management command."
|
||||||
echo " --makemessages Create/Update English translation files."
|
echo " --makemessages Create/Update English translation files."
|
||||||
echo " --compilemessages Compile all translation files."
|
echo " --compilemessages Compile all translation files."
|
||||||
|
echo " --check-only Do not update translation files (--makemessages only)."
|
||||||
echo " -p, --pep8 Just run pep8"
|
echo " -p, --pep8 Just run pep8"
|
||||||
echo " -8, --pep8-changed [<basecommit>]"
|
echo " -8, --pep8-changed [<basecommit>]"
|
||||||
echo " Just run PEP8 and HACKING compliance check"
|
echo " Just run PEP8 and HACKING compliance check"
|
||||||
|
@ -87,6 +88,7 @@ testargs=""
|
||||||
with_coverage=0
|
with_coverage=0
|
||||||
makemessages=0
|
makemessages=0
|
||||||
compilemessages=0
|
compilemessages=0
|
||||||
|
check_only=0
|
||||||
manage=0
|
manage=0
|
||||||
|
|
||||||
# Jenkins sets a "JOB_NAME" variable, if it's not set, we'll make it "default"
|
# Jenkins sets a "JOB_NAME" variable, if it's not set, we'll make it "default"
|
||||||
|
@ -115,6 +117,7 @@ function process_option {
|
||||||
-m|--manage) manage=1;;
|
-m|--manage) manage=1;;
|
||||||
--makemessages) makemessages=1;;
|
--makemessages) makemessages=1;;
|
||||||
--compilemessages) compilemessages=1;;
|
--compilemessages) compilemessages=1;;
|
||||||
|
--check-only) check_only=1;;
|
||||||
--only-selenium) only_selenium=1;;
|
--only-selenium) only_selenium=1;;
|
||||||
--with-selenium) with_selenium=1;;
|
--with-selenium) with_selenium=1;;
|
||||||
--selenium-headless) selenium_headless=1;;
|
--selenium-headless) selenium_headless=1;;
|
||||||
|
@ -414,7 +417,7 @@ function run_integration_tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_makemessages {
|
function run_makemessages {
|
||||||
OPTS="-l en --no-obsolete"
|
OPTS="-l en --no-obsolete --settings=openstack_dashboard.test.settings"
|
||||||
DASHBOARD_OPTS="--extension=html,txt,csv --ignore=openstack"
|
DASHBOARD_OPTS="--extension=html,txt,csv --ignore=openstack"
|
||||||
echo -n "horizon: "
|
echo -n "horizon: "
|
||||||
cd horizon
|
cd horizon
|
||||||
|
@ -428,15 +431,20 @@ function run_makemessages {
|
||||||
${command_wrapper} $root/manage.py makemessages $DASHBOARD_OPTS $OPTS
|
${command_wrapper} $root/manage.py makemessages $DASHBOARD_OPTS $OPTS
|
||||||
DASHBOARD_RESULT=$?
|
DASHBOARD_RESULT=$?
|
||||||
cd ..
|
cd ..
|
||||||
|
if [ $check_only -eq 1 ]; then
|
||||||
|
git checkout -- horizon/locale/en/LC_MESSAGES/django*.po
|
||||||
|
git checkout -- openstack_dashboard/locale/en/LC_MESSAGES/django.po
|
||||||
|
fi
|
||||||
exit $(($HORIZON_PY_RESULT || $HORIZON_JS_RESULT || $DASHBOARD_RESULT))
|
exit $(($HORIZON_PY_RESULT || $HORIZON_JS_RESULT || $DASHBOARD_RESULT))
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_compilemessages {
|
function run_compilemessages {
|
||||||
|
OPTS="--settings=openstack_dashboard.test.settings"
|
||||||
cd horizon
|
cd horizon
|
||||||
${command_wrapper} $root/manage.py compilemessages
|
${command_wrapper} $root/manage.py compilemessages $OPTS
|
||||||
HORIZON_PY_RESULT=$?
|
HORIZON_PY_RESULT=$?
|
||||||
cd ../openstack_dashboard
|
cd ../openstack_dashboard
|
||||||
${command_wrapper} $root/manage.py compilemessages
|
${command_wrapper} $root/manage.py compilemessages $OPTS
|
||||||
DASHBOARD_RESULT=$?
|
DASHBOARD_RESULT=$?
|
||||||
cd ..
|
cd ..
|
||||||
# English is the source language, so compiled catalogs are unnecessary.
|
# English is the source language, so compiled catalogs are unnecessary.
|
||||||
|
|
4
tox.ini
4
tox.ini
|
@ -20,7 +20,9 @@ deps = -r{toxinidir}/requirements.txt
|
||||||
commands = /bin/bash run_tests.sh -N --no-pep8 {posargs}
|
commands = /bin/bash run_tests.sh -N --no-pep8 {posargs}
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands = /bin/bash run_tests.sh -N --pep8
|
commands =
|
||||||
|
/bin/bash run_tests.sh -N --pep8
|
||||||
|
/bin/bash run_tests.sh -N --makemessages --check-only
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
Loading…
Reference in New Issue