Skip to content

Commit

Permalink
Fix slow server tests #763 #764 (#765)
Browse files Browse the repository at this point in the history
* Support an optional argument --skip_update_translations #763

* Skip app/vendors from compilemessages #763

* Add venv/ to .gitignore to support virtualenv #764

* Use boolean instead of strings to dispatch behavior of server tests by optional arguments
  • Loading branch information
ryosuketc committed Nov 24, 2020
1 parent 4ca92b3 commit 471331f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ tests/server_test_cases/.cache/
.pytest_cache/
.vscode/
env/
venv/
21 changes: 19 additions & 2 deletions tools/server_tests
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,26 @@ pushd "$(dirname $0)" >/dev/null && source common.sh && popd >/dev/null
# directory.
cd "$(dirname $0)/.."

# Parse arguments and set flags
SKIP_UPDATE_TRANSLATIONS=false
for arg in "$@"; do
shift
if [[ "${arg}" == "--skip_update_translations" ]]; then
SKIP_UPDATE_TRANSLATIONS=true
continue
fi
# All arguments other than "--skip_update_translations" remains intact
set -- "$@" "${arg}"
done
readonly SKIP_UPDATE_TRANSLATIONS

echo
echo "--- Updating translations"
$TOOLS_DIR/update_messages
if [[ "${SKIP_UPDATE_TRANSLATIONS}" == true ]]; then
echo "--- Skipped updating translations"
else
echo "--- Updating translations"
"${TOOLS_DIR}"/update_messages
fi

echo
echo "--- Running server tests"
Expand Down
3 changes: 2 additions & 1 deletion tools/update_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,5 @@ def django_admin(*args):

# Run compilemessages to generate all the .mo files.
sys.stderr = open('/dev/null', 'w') # suppress the listing of all files
django_admin('compilemessages')
django_admin('compilemessages',
'--ignore=vendors')

0 comments on commit 471331f

Please sign in to comment.