Commit Graph

57 Commits

Author SHA1 Message Date
Anders Kaseorg 986bad8f90 install-shellcheck: Upgrade ShellCheck to 0.9.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-01-04 14:01:34 -08:00
Tim Abbott 92cc771392 test-all: Pass --skip-external-links to documentation tests.
This is what we already do in CI.  The external links often cause
these tests to fail, and it's not helpful for test-all to not match
CI.
2022-03-07 11:54:01 -08:00
Steve Howell 1db74fcf2f test-all: Call documentation tests again.
I accidentally checked in a change where I commented
out the test.
2021-12-11 12:46:44 -08:00
Steve Howell b2d83a8300 tests: Split out SingleUserExportTest.
This is mostly moving code, plus I now just
call shutil.rmtree directly.
2021-12-11 13:06:41 -05:00
Anders Kaseorg b54007d36c clean-repo: Remove.
Unless this was working around a specific bug that has somehow
persisted for eight years, this was just pointlessly defeating
Python’s bytecode cache every time you started the dev server.

This reverts commits deffda072f,
59228f7458, and
ae45217671.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-05 17:44:24 -07:00
m-e-l-u-h-a-n ec8244b113 tools: Remove -f short option for test-all.
./tools/test-all had a short option -f which was used for running it
by skipping provision check. This short option paired well with its
long version --force, but in an effort to provide more clarity over
the use of force option it is renamed to --skip-provision-check.

Following this rename -f option for test-all does not pair well with
its long part which is now --skip-provision-check. Also, this option
is rarely used. So the short form -f is removed in this commit. We
now provide only its longer version --skip-provision-check.

This is a part of commits done to address issue #17455.
2021-03-03 09:17:49 -08:00
m-e-l-u-h-a-n 911c5f19f1 tools: Rename force argument to skip-provision-check
This commit renames --force argument used with various tests to
--skip-provision-check. As a consequence of this name change all other
files that set --force option for the test commands have been updated.

This change is done in order to provide more clarity for using this
option for runnning tests.

This commit addresses issue #17455.
2021-03-03 09:17:49 -08:00
Steve Howell 09ff0c400d tools: Rename tool to check-schemas. 2021-01-20 13:17:32 -08:00
Anders Kaseorg dfaea9df65 shfmt: Reformat shell scripts with shfmt.
https://github.com/mvdan/sh

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-10-15 15:16:00 -07:00
Dinesh 2d22d88700 casper: Remove few traces of casper.
Now that all casper tests have been migrated to
puppeteer, there's no need for having casper
related things.

Removed the casperjs package and removed/replaced
casper in few places with puppeteer.

Only removed few of them which I'm confident
about. Also didn't make any changes in docs
as it would be easier to remove them while
adding puppeteer docs.
2020-08-30 17:16:02 -07:00
Tim Abbott dbf3894c49 test-backend: Enable --ban-console-output and document. 2020-08-27 11:39:53 -07:00
Steve Howell da8691d7d7 ci: Add new check-node-fixtures tool to CI.
This tool only takes a couple seconds to run,
so it's pretty low risk to add to CI.
2020-07-26 16:07:40 -07:00
Dinesh d429b7145e tests: Make puppeteer tests run in full suites and CircleCI. 2020-06-03 17:39:35 -07:00
Tim Abbott 1094589f79 test-all: Print a colorful notice on startup discouraging use.
The test-all tool is useful if you want to be really sure everything
passes, but it's almost always better to run a smaller subsuite when
doing active development, and just run test-all (or CI) at the end.

Our docs already covered this issue well, but this presents the idea
in a place one is definitely looking at when running test-all.
2020-04-27 16:35:29 -07:00
Puneeth Chaganti d5f5a99b07 tools: Verify that all integrations have bot avatars. 2020-04-22 17:45:30 -07:00
Aman Agrawal e9ff9e34b3 lint: Use --groups to specify specific groups to run.
This helps generalize the use of groups inside zulint.
Introduce list_files to return `by_lang` files dict.
Add feature to create custom groups.
Make custom groups for backend and frontend files.
2019-06-23 22:23:15 -07:00
Raymond Akornor 4dc7f5354d tests: Optimize test-backend performance.
This optimizes test-backend by skipping webhook
tests when run in default mode.

Tweaked by tabbott to extend the documentation and update the CI
commands.
2019-02-19 14:50:41 -08:00
Tim Abbott 6b69cc0b39 lint: Run mypy as part of main linter.
To support this, we add a pass_targets option to the main linter
library, because with current mypy, it's generally counterproductive
to pass the list of files in (can produce spurious errors; isn't
faster).
2018-12-16 21:52:53 -08:00
Vishnu Ks a86faecff5 tools: Rename tools/travis directory to tools/ci. 2018-12-10 11:07:26 -08:00
Tim Abbott ba626dcad6 tools: Move optimize-svg to tools/setup/. 2018-08-09 15:39:57 -07:00
Anders Kaseorg c93f53b463 test-all: Fix shellcheck warnings.
In tools/test-all line 7:
TEMP=`getopt -o f --long force -- "$@"`
     ^-- SC2006: Use $(..) instead of legacy `..`.

In tools/test-all line 24:
    echo "Running $@"
                  ^-- SC2145: Argument mixes string and array. Use * or separate argument.

In tools/test-all line 26:
        printf "\n\e[31;1mFAILED\e[0m $@\n"
               ^-- SC2059: Don't use variables in the printf format string. Use printf "..%s.." "$foo".
                ^-- SC1117: Backslash is literal in "\n". Prefer explicit escaping: "\\n".
                  ^-- SC1117: Backslash is literal in "\e". Prefer explicit escaping: "\\e".
                                ^-- SC1117: Backslash is literal in "\e". Prefer explicit escaping: "\\e".
                                      ^-- SC2145: Argument mixes string and array. Use * or separate argument.
                                        ^-- SC1117: Backslash is literal in "\n". Prefer explicit escaping: "\\n".

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-08-03 09:15:27 -07:00
Greg Price e3c82fa3ec tools/test-all: Fix small desync with CI scripts.
This script and our CI scripts tools/travis/{backend,frontend} have
stayed pretty well in sync in the 6 months since 360c27ded made that
relationship explicit and easy to check!

Just one small exception; so fix that.
2018-02-01 11:38:51 -08:00
derAnfaenger 61aebd036f tools: Remove `.py` extensions from user scripts. 2017-10-11 12:52:36 -07:00
Harshit Bansal 64795adef3 tools/test-all: Pass the `--force` arg to run-mypy script.
While running the mypy script we were not passing the `--force`
argument correctly to the run-mypy which was causing it complain
about provision status.
2017-10-04 12:27:43 -07:00
Greg Price 1ab89b1d89 tools/test-all: Split `tools/lint` to match Travis scripts.
This keeps `test-all` visibly aligned with `travis/frontend` and
`travis/backend`, which helps us keep it substantively aligned.
2017-08-29 15:42:01 -07:00
Tim Abbott b087886d1c travis: Move i18n and capitalization linters to frontend.
Since these usually result from changes to HTML templates and other
frontend-side things, it seems better to group them with the frontend.

[Tweaked by gnprice in whitespace and comments.]
2017-08-29 15:42:01 -07:00
Tim Abbott 6ef55145f5 travis: Merge the static-analysis build into backend.
[Tweaked by gnprice to leave the use of --linecoverage-report
unmodified for now.]
2017-08-29 15:42:01 -07:00
Robert Hönig c5da0ada31 linter: Replace --pep8 with new --frontend/--backend options.
Adds the --frontend and --backend options to replace
--pep8.

Significantly modified by tabbott to use a cleaner framework.
2017-08-27 13:50:53 -07:00
Tim Abbott 8dff14430e tools: Remove old python 3 compatibility checker.
Now that we've migrated over to Python 3, this tool is no longer required.

Fixes #6217.
2017-08-22 14:58:59 -07:00
Tim Abbott debfe708d0 test-all: Fix buggy PYTHONWARNINGS invocation.
Shell only sets variables if they're the first thing on a line.
2017-08-16 11:56:24 -07:00
Greg Price e469578a55 py3: Fix up (almost) all script invocations to rely on shebangs.
This follows up on 207cf6302 from last year to clean up cases that
have apparently popped up since then.  Invoking the scripts directly
makes a cleaner command line in any case, and moreover is essential
to how we control running a Zulip install as either Python 2 or 3
(soon, how we always ensure it runs as Python 3.)

One exception: we're currently forcing `provision` in dev to run
Python 3, while still running both Python 2 and Python 3 jobs in CI.
We use a non-shebang invocation to do the forcing of Python 3.
2017-08-15 17:30:31 -07:00
Greg Price 360c27dedd tests: Bring all the top-level test scripts into alignment on what to test.
Notably, this adds our checks on translated message strings to
`tools/test-all`, so that they don't cause surprise failures in
CI after a branch is pushed.  (Alternately they could have gone
in `tools/lint` to accomplish the same goal, but `makemessages`
which they depend on is quite slow -- on my machine it takes 7s,
compared to 10s for all of `tools/lint`.)
2017-07-25 15:31:32 -07:00
Greg Price cd7cd73538 tests: Reorder tests in top-level test scripts to agree with each other.
This will make it easier to get the scripts to contain the same set of
tests (with explicit, conscious exceptions), and to keep it that way.
2017-07-25 15:31:32 -07:00
Tim Abbott e321891f17 test-all: Don't run SVG optimizer by default. 2017-05-30 11:19:53 -07:00
Cynthia Lin 0600e1eb30 tools: Add optimize-svg tool for checking for unoptimized SVG files. 2017-05-30 11:15:56 -07:00
Joshua Pan 64984f5bf4 Rename tools/lint-all to tools/lint.
Fixes #4574.
2017-04-21 14:57:47 -07:00
Tommy Ip c7e33c6c9f optimization: Use Python to test management commands.
The original test was written in shell script which launches a new
django instance for every tests. By doing it in Python, we avoid
the overhead and reduce the test time to <1 second.

Fixes #3620.
2017-02-11 13:48:16 -08:00
Steve Howell 6de1e8be46 Add test-api to tools/test-all. 2017-01-25 16:33:19 -08:00
Rafid Aslam f897cc5a8b tests: Add --force option to `tools/test-all`
Fixes #2996.
2017-01-03 11:42:53 -08:00
K.Kanakhin 75c4e3191d tests: Add help documentation checking script to CI 2016-12-19 08:31:39 -08:00
Tim Abbott 8b77889f8a test-all: Run the pep8 linter by default. 2016-12-07 23:22:59 -08:00
K.Kanakhin 455301ca13 docs-test: Add documentation test scripts to backend test case.
- Add script to compile documentation build and start crawler
  to check documentation.
- Add documentation test script to backend travis test case.
- Add log level argument to test-documentation script.

Fixes #1492
2016-10-25 11:36:43 -07:00
Steve Howell 7cc1b1ebc4 Add test coverage for parsers in tools/lib.
Now, `tools/test-all` calls a new program called `tools/tests-tools`
that runs unit tests in `test_css_parser.py` and 'test_template_parser.py`.

This puts 100% line coverage on tools/lib/css_parser.py.
This puts about 50% line coverage on tools/lib/template_parser.py.
2016-08-04 10:47:09 -07:00
rahuldeve 3ca53df152 Add test for worker queue autoreloading. 2016-06-26 20:12:37 -07:00
Tim Abbott fbc30c2914 test-all: Add a call to run-mypy.
Using mypy to check the codebase is stable and useful enough that it's
worth including it in the default tests run locally.
2016-05-31 15:00:15 -07:00
Tim Abbott 24fd3bbf55 travis: Test whether migrations are consistent with models.
This should automatically catch mistakes where someone updates the
database models but forgets to generate migrations afterwards.
2016-01-26 20:38:46 -08:00
Vladislav Manchev dfbea01c8f Add support for running OpenBSD in development environment. 2016-01-21 22:33:55 -08:00
Tim Abbott 9d75fd33d9 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.
2015-11-11 21:34:39 -08:00
Steve Howell 29fd84fdbd Rename check-all to lint-all.
(imported from commit 844b2c69748f6d9df8ff1189c006ccf405f787c3)
2013-08-09 13:06:02 -04:00
Steve Howell db33028b98 Added tools/test-js-with-casper symlink.
The test-all script now calls the symlink, and the run script
has been cleaned up to be symlink friendly.

(imported from commit 8abb5c1e5744416e94ff843e50c53e0d0f7e1316)
2013-08-09 13:04:52 -04:00