mirror of https://github.com/zulip/zulip.git
Add new test for management commands running with --help.
This test caught a few bugs where refactoring had made management commands fail (and would have caught a few more recent ones). Ideally we'd replace this with a more advanced test that actually tests that the management command do something useful, but it's a start.
This commit is contained in:
parent
16ae985807
commit
9d75fd33d9
|
@ -18,5 +18,7 @@ run ./tools/lint-all
|
|||
run ./tools/test-js-with-node
|
||||
run ./tools/test-backend
|
||||
run ./tools/test-js-with-casper
|
||||
# Not running management test since it takes 40s and thus is too slow to be worth it.
|
||||
# run ./tools/test-management
|
||||
|
||||
printf '\n\e[32mAll OK!\e[0m\n'
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "Testing management commands start!"
|
||||
failed=0
|
||||
for i in `ls */management/commands/ | grep .py$ | grep -v __init__ | sed 's/[.]py$//'`; do
|
||||
if ! $(./manage.py $i --help >/dev/null); then
|
||||
failed=$(expr $failed + 1)
|
||||
echo "ERROR: \`./manage.py $i --help\` crashes!";
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $failed -gt 0 ]; then
|
||||
echo
|
||||
echo "$failed management commands don't start!"
|
||||
exit 1
|
||||
fi
|
||||
echo "All management commands start!"
|
|
@ -5,3 +5,4 @@ source /srv/zulip-venv/bin/activate
|
|||
export PATH=$PATH:/srv/zulip-venv/bin
|
||||
./tools/lint-all
|
||||
./tools/test-backend
|
||||
./tools/test-management
|
||||
|
|
Loading…
Reference in New Issue