zulip/tools
Steve Howell 06225d1424 tests: Clean up calls to tools/webpack.
Before this change, the way we loaded
webpack for various tools was brittle.

First, I addressed test-api and test-help-documentation.

These tools used to be unable to run standalone on a
clean provision, because they were (indirectly)
calling tools/webpack without the `--test` option.

The problem was a bit obscure, since running things
like `./tools/test-backend` or `./tools/test-all` in
your workflow would create `./var/webpack-stats-test.json`
for the broken tools (and then they would work).

The tools themselves weren't broken; they were the
only relying on the common `test_server_running` helper.
And even that helper wasn't broken; it was just that
`run-dev.py` wasn't respecting the `--test` option.

So I made it so that `./tools/run-dev` passes in `--test` to
`./tools/webpack`.

To confuse matters even more, for some reason Casper
uses `./webpack-stats-production.json` via various
hacks for its webpack configuration, so when I fixed
the other tests, it broke Casper.

Here is the Casper-related hack in zproject/test_settings.py,
which was in place before my change and remains
after it:

    if CASPER_TESTS:
        WEBPACK_FILE = 'webpack-stats-production.json'
    else:
        WEBPACK_FILE = os.path.join('var', 'webpack-stats-test.json')

I added similar logic in tools/webpack:

    if "CASPER_TESTS" in os.environ:
        build_for_prod_or_casper(args.quiet)

I also made the helper functions in `./tools/webpack` have
nicer names.

So, now tools should all be able to run standalone and not
rely on previous tools creating webpack stats files for
them and leaving them in the file system.  That's good.

Things are still a bit janky, though.  It's not completely
clear to me why `test-js-with-casper` should work off of
a different webpack configuration than the other tests.

For now most of the jankiness is around Casper, and we have
hacks in two different places, `zproject/test_settings.py` and
`tools/webpack` to force it to use the production stats
file instead of the "test" one, even though Casper uses
test-like settings for other things like which database
you're using.
2018-09-07 11:39:55 -04:00
..
circleci circleci: Add a base image for Ubuntu Bionic. 2018-05-31 18:51:32 -07:00
documentation_crawler Enable pycodestyle W605 (invalid escape sequence). 2018-07-03 16:54:46 +02:00
droplets droplets: Update code and remove nvm settings from bashrc. 2018-08-07 13:38:18 -07:00
i18n tools: Move a few i18n scripts to tools/i18n. 2018-08-09 15:46:27 -07:00
lib puppet-lint: Add as a dependancy to install during provision process. 2018-08-13 12:30:57 -07:00
linter_lib puppet: Fix puppet-lint warnings in various manifests. 2018-08-28 13:46:31 -07:00
setup build_emoji: Add infrastructure for google-blob and twitter emojisets. 2018-08-31 11:52:24 -07:00
test-install test-install: Fix shellcheck warnings. 2018-08-03 09:15:27 -07:00
tests linter: Enforce 2 space indents on tags spread over multiple lines. 2018-04-07 20:08:44 -07:00
travis tools: Move optimize-svg to tools/setup/. 2018-08-09 15:39:57 -07:00
zulint zulint: Move pycodestyle runner code to library. 2018-08-04 19:54:18 -07:00
zulip-export zulip-export: Convert to using argparse from optparse. 2017-11-10 15:54:02 -08:00
README.md docs: Update links to ReadTheDocs to always use https. 2017-11-16 10:59:24 -08:00
__init__.py
build-docs
build-release-tarball build-release-tarball: Improve help/error output. 2017-11-16 22:19:58 -08:00
check-capitalization check-capitalization: Include banned words in overall output. 2018-03-16 16:59:02 -07:00
check-css tools: Change use of typing.Text to str. 2018-05-13 17:17:32 -07:00
check-frontend-i18n tools: Change use of typing.Text to str. 2018-05-13 17:17:32 -07:00
check-issue-labels tools: Change use of typing.Text to str. 2018-05-13 17:17:32 -07:00
check-provision check-provision: Replace optparse with argparse. 2017-09-30 09:32:46 -07:00
check-swagger
check-templates billing: Add location for errors on billing page. 2018-08-10 22:48:10 -07:00
check-urls Enable pycodestyle W605 (invalid escape sequence). 2018-07-03 16:54:46 +02:00
clean-branches
clean-repo clean-repo: Revert optimization to .pyc removal. 2017-07-30 17:24:55 -07:00
commit-message-lint commit-message-list: Don't print anything if no commits. 2018-03-02 11:51:08 -08:00
commit-msg
compile-handlebars-templates Add basic widgets framework (JS side). 2018-05-16 15:13:33 -07:00
conf.ini-template
coveragerc webhooks: Add generic exception for unexpected webhook events. 2018-05-22 08:30:19 -07:00
create-test-api-docs tools: Revert to Python 2 typing syntax for now. 2017-12-13 10:38:15 -08:00
deploy-branch
diagnose scripts: Use shell quoting when displaying commands to be run. 2018-07-30 22:39:08 -07:00
django-template-graph
do-destroy-rebuild-database test_fixtures: Move test_db_status state under UUID_VAR_PATH. 2017-10-17 21:15:58 -07:00
do-destroy-rebuild-test-database do-destroy-rebuild-test-database: Fix shellcheck warnings. 2018-08-03 09:15:26 -07:00
fetch-pull-request
fetch-rebase-pull-request fetch-rebase-pull-request: Fix shellcheck warnings. 2018-08-03 09:15:26 -07:00
find-add-class tools: Revert to Python 2 typing syntax for now. 2017-12-13 10:38:15 -08:00
find-unused-css find-unused-css: Fix shellcheck warnings. 2018-08-03 09:15:26 -07:00
get-handlebar-vars Enable pycodestyle W605 (invalid escape sequence). 2018-07-03 16:54:46 +02:00
html-grep zulint: Move lister.py to tools/zulint. 2018-08-04 19:53:53 -07:00
inline-email-css Text-wrap the remaining long lines exceeding 110. 2017-11-15 10:58:03 -08:00
js-dep-visualizer.py Enable pycodestyle W605 (invalid escape sequence). 2018-07-03 16:54:46 +02:00
lint puppet-lint: Include in linter tool chain to run by default. 2018-08-13 12:30:57 -07:00
list-outdated-packages tools: Add tool for listing outdated pip packages. 2018-05-24 15:16:02 -07:00
minify-js tools: Remove pointless uses of shell=True. 2018-07-30 22:39:06 -07:00
pre-commit linter: Replace --pep8 with new --frontend/--backend options. 2017-08-27 13:50:53 -07:00
pretty-print-html tools: Remove print_function. 2017-09-29 15:44:56 -07:00
provision provision: Fix shellcheck warnings. 2018-08-03 09:15:27 -07:00
push-to-pull-request push-to-pull-request: Fix shell usage in an error path. 2018-07-23 23:19:27 -07:00
release-tarball-exclude.txt tests: Move zerver/fixtures to zerver/tests/fixtures for clarity. 2018-04-19 21:50:17 -07:00
renumber-migrations tools: Only files starting with same migration number conflict. 2018-07-10 21:09:34 +05:30
replacer zulint: Move lister.py to tools/zulint. 2018-08-04 19:53:53 -07:00
reset-to-pull-request reset-to-pull-request: Fix shellcheck warnings. 2018-08-03 09:15:27 -07:00
review tools/review: Don’t pretend to emulate shell=True either. 2018-07-30 22:39:08 -07:00
run-dev-queue-processors tools: Remove absolute_import in most tools. 2017-09-29 12:28:43 -07:00
run-dev.py tests: Clean up calls to tools/webpack. 2018-09-07 11:39:55 -04:00
run-mypy zulint: Move lister.py to tools/zulint. 2018-08-04 19:53:53 -07:00
setup-git-repo
show-profile-results mypy: Remove ignores for a few typeshed bugs fixed upstream. 2017-10-27 17:09:00 -07:00
start-dockers start-dockers: Fix shellcheck warnings. 2018-08-03 09:15:27 -07:00
stop-run-dev tools: Consistently use hyphen in user script names. 2017-10-11 12:52:36 -07:00
test-all tools: Move optimize-svg to tools/setup/. 2018-08-09 15:39:57 -07:00
test-all-docker test-all-docker: Fix shellcheck warnings. 2018-08-03 09:15:27 -07:00
test-api Fix usage for test-api. 2018-09-07 11:39:55 -04:00
test-backend tests: Test how we handle extra data for zform messages. 2018-08-24 10:00:25 -07:00
test-documentation test-documentation: Fix shellcheck warnings. 2018-08-03 09:15:27 -07:00
test-emoji-name-scripts tools/test-emoji-name-scripts: Avoid shelling out for cp. 2018-07-19 10:43:37 -07:00
test-help-documentation tools/test-help-documentation: Avoid shelling out for mkdir. 2018-07-19 10:43:37 -07:00
test-js-with-casper
test-js-with-node Revert unused code for creating non-editable pills. 2018-08-31 16:26:05 -07:00
test-locked-requirements tools/test-locked-requirements: Avoid shelling out for cp, mkdir. 2018-07-25 16:54:46 -07:00
test-migrations test-migrations: Fix shellcheck warnings. 2018-08-03 09:15:27 -07:00
test-queue-worker-reload tools/test-queue-worker-reload: Avoid shelling out for touch. 2018-07-25 16:54:46 -07:00
test-run-dev test-run-dev: Clean up some basic Python style. 2018-01-30 16:08:43 -08:00
test-tools tools: Revert to Python 2 typing syntax for now. 2017-12-13 10:38:15 -08:00
update-authors-json team: Include contributions from legacy repositories in the total. 2018-08-28 16:45:00 -07:00
update-locked-requirements update-locked-requirements: Fix shellcheck warnings. 2018-08-03 09:15:27 -07:00
update-prod-static tools: Move generate-custom-icon-webfont to a subdirectory. 2018-08-09 15:39:57 -07:00
webpack tests: Clean up calls to tools/webpack. 2018-09-07 11:39:55 -04:00
webpack-helpers.ts webpack: Transition app.js to be compiled by webpack. 2018-07-05 11:03:08 +02:00
webpack.assets.json Revert "webpack: Combine archive-style bundle into archive." 2018-07-24 16:00:26 -07:00
webpack.config.ts simplebar: Add simplebar dependency for help page scrolling. 2018-07-11 20:04:55 +05:30
zanitizer
zanitizer_config.pm.sample

README.md

This directory contains scripts that are used in building, managing, testing, and other forms of work in a Zulip development environment. Note that tools that are also useful in production belong in scripts/ or should be Django management commands.

For more details, see https://zulip.readthedocs.io/en/latest/overview/directory-structure.html.