mirror of https://github.com/zulip/zulip.git
06225d1424
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. |
||
---|---|---|
.. | ||
circleci | ||
documentation_crawler | ||
droplets | ||
i18n | ||
lib | ||
linter_lib | ||
setup | ||
test-install | ||
tests | ||
travis | ||
zulint | ||
zulip-export | ||
README.md | ||
__init__.py | ||
build-docs | ||
build-release-tarball | ||
check-capitalization | ||
check-css | ||
check-frontend-i18n | ||
check-issue-labels | ||
check-provision | ||
check-swagger | ||
check-templates | ||
check-urls | ||
clean-branches | ||
clean-repo | ||
commit-message-lint | ||
commit-msg | ||
compile-handlebars-templates | ||
conf.ini-template | ||
coveragerc | ||
create-test-api-docs | ||
deploy-branch | ||
diagnose | ||
django-template-graph | ||
do-destroy-rebuild-database | ||
do-destroy-rebuild-test-database | ||
fetch-pull-request | ||
fetch-rebase-pull-request | ||
find-add-class | ||
find-unused-css | ||
get-handlebar-vars | ||
html-grep | ||
inline-email-css | ||
js-dep-visualizer.py | ||
lint | ||
list-outdated-packages | ||
minify-js | ||
pre-commit | ||
pretty-print-html | ||
provision | ||
push-to-pull-request | ||
release-tarball-exclude.txt | ||
renumber-migrations | ||
replacer | ||
reset-to-pull-request | ||
review | ||
run-dev-queue-processors | ||
run-dev.py | ||
run-mypy | ||
setup-git-repo | ||
show-profile-results | ||
start-dockers | ||
stop-run-dev | ||
test-all | ||
test-all-docker | ||
test-api | ||
test-backend | ||
test-documentation | ||
test-emoji-name-scripts | ||
test-help-documentation | ||
test-js-with-casper | ||
test-js-with-node | ||
test-locked-requirements | ||
test-migrations | ||
test-queue-worker-reload | ||
test-run-dev | ||
test-tools | ||
update-authors-json | ||
update-locked-requirements | ||
update-prod-static | ||
webpack | ||
webpack-helpers.ts | ||
webpack.assets.json | ||
webpack.config.ts | ||
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.