Commit Graph

116 Commits

Author SHA1 Message Date
Umair Khan a926559889 testing: Use concurrency parameter.
Coverage includes a concurrency parameter which can be used
to track files if multiprocessing is used.
2017-06-06 08:03:25 -07:00
Umair Khan b09b60dfff Revert "test-backend: Enable test coverage in multi-process mode."
This reverts commit a22d6d2c2a.
2017-06-06 13:07:16 +05:00
Pweaver (Paul Weaver) cb311e99d8 Change backend tests to use a webpack stats stub file. 2017-05-25 16:15:32 -07:00
Mehanig 3f5d0e69fb Build and handle jsfiles using webpack instead of django-pipeline.
Also renames bundle.js to translations.js.
2017-05-24 18:38:03 -07:00
Steve Howell 5003283b64 Enforce 100% test coverage for lib/avatar.py. 2017-05-23 20:07:07 -07:00
Jason Michalski a22d6d2c2a test-backend: Enable test coverage in multi-process mode.
We enable data_suffix option when creating Coverage instances which
causes the output files to include the hostname, pid, and random id.
Before each run erase is called which clears all existing coverage data
files. And then at the end of the test run use the combine method which
merges the reports.

We collect coverage in the main process which collects data from
imports and also when running in single process mode. In the workers we
collect coverage in run_subsuite. This creates more stats files than
strictly required but I don't see a better place to save the stats when
stopping workers.

Note that this has the side effect of enabling parallel testing in
Travis CI.
2017-05-23 18:25:13 -07:00
Steve Howell ecdc500440 test-backend: Run only one process for --rerun option. 2017-05-23 16:59:22 -07:00
Umair Khan 286f9a40e7 push_notifications: Bring file to 100% coverage. 2017-05-16 12:26:55 -07:00
Tim Abbott 232592cc9f test_sessions: Extends tests to reach 100% coverage of sessions.py.
Fixes #3980.
2017-05-10 10:12:21 -07:00
Umair Khan 6b1c53059b testing: Run in parallel mode by default.
This commit changes the backend testing framework to run
in parallel mode which is same as --processes=4. If --coverage
is supplied, we enforce serial mode, --processes=1, because
coverage is not compatible with parallel mode at the moment.
2017-05-04 16:06:34 -07:00
K.Kanakhin e2cf6102fb test_tornado.py: Add websocket closing to tornado tests.
- Extend tornado tests with closing WebSocket connection
to avoid leakings warnings.
- Mark test_tornado as having 100% coverage.

Fixes #3942.
2017-04-27 12:05:56 -07:00
Ayush Jain 518d25a0cf Disable proxy setting for test-backend and test-js-with-casper.
This fixes the fact that our test suites would have trouble connecting
to the other parts of the Zulip service when run with a proxy
configuration (e.g. trying to send requests to localhost through the
proxy!).

Thanks for Vishnu Ks for his work on this.

Fixes #971.
2017-04-18 12:35:44 -07:00
Umair Khan bf713bcdfe testing: Don't create DB twice for backend.
In backend tests, only call generate-fixtures when --generate-fixtures
is explicitly passed or is_template_database_current() returns False.

We don't need to flush cache for backend tests because we bounce the key
prefix used to create cache keys before running every test
2017-04-14 10:23:16 +05:00
Adarsh S d54dea819d Add option for re-running failed tests.
This adds the option '--rerun' to the `test-backend` infrastructure.
It runs the tests that failed during the last 'test-backend' run.  It
works by stailing failed test info at var/last_test_failure.json

Cleaned up by Umair Khan and Tim Abbott.
2017-04-12 11:35:31 -07:00
Tim Abbott 36bb2bf54a AdminZulipHandler: Bring logging_handlers.py to 100% test coverage.
This involved fixing some unupdated code in one code path.
2017-03-26 13:10:43 -07:00
Elliott Jin 98ddb4453e test-backend: Raise zerver/views/home.py test coverage to 100%. 2017-03-25 18:16:16 -07:00
Elliott Jin 1c0d58f897 test-backend: Raise zerver/views/auth.py test coverage to 100%. 2017-03-25 18:16:16 -07:00
Tim Abbott a6ae546f59 test_events: Bring zerver/lib/events.py to 100% coverage. 2017-03-23 22:43:10 -07:00
Umair Khan 2d4a1f93ff testing: Bring zproject.backends coverage to 100%. 2017-03-23 17:12:58 -07:00
Tim Abbott 06492738b5 dev: Expose coverage and built documentation to web.
This makes it much more convenient for developers to access coverage
and built developer documentation.
2017-03-23 13:10:06 -07:00
Umair Khan 0fc946aef4 testing: Add reverse option to test runner. 2017-03-22 12:07:21 -07:00
Umair Khan 2f243d8808 testing: Control parallelism through cmd args. 2017-03-22 11:59:30 -07:00
Umair Khan a2aeddba6b testing: Add infrastructure for running backend tests in parallel.
This doesn't yet provide an option to actually run the backend tests
parallelized yet.
2017-03-21 10:59:12 -07:00
Elliott Jin 1138057209 test-backend: Raise zerver/views/registration.py test coverage to 100%. 2017-03-18 18:11:59 -07:00
Tim Abbott e7b3ea8fab coverage: Require 100% coverage in analytics. 2017-03-14 17:11:25 -07:00
Umair Khan cdb07c7005 Fix test_get_old_messages_with_narrow_pm_with.
Fixes #3940.
2017-03-14 09:38:24 -07:00
Umair Khan 32849b80ad Django 1.10: Url pattern doesn't use _callback_str.
Fixes #3941
2017-03-09 00:50:12 -08:00
Elliott Jin 8d936601d3 test-backend: Raise zerver/views/test_upload.py test coverage to 100%. 2017-03-08 11:42:25 -08:00
Elliott Jin 3127ebfa3b test-backend: Raise zerver/views/events_register.py test coverage to 100%. 2017-03-07 19:47:16 -08:00
Tim Abbott b6f53d6c14 coverage: bring zerver/lib/validator.py to 100% coverage. 2017-03-05 00:53:27 -08:00
Tim Abbott e95f139308 coverage: bring zerver/lib/response.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott 89decf6ded coverage: bring zerver/lib/request.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott e7ff3415ab coverage: bring test_helpers.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott 546fb9199d coverage: bring test_classes.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott e3cfb256dd coverage: Bring zerver.lib.narrow.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott 56b1f79fe3 integrations: Fix email integration being listed unconditionally. 2017-03-05 00:53:26 -08:00
Tim Abbott 5050e42212 test-backend: Document # nocoverage comments. 2017-03-04 23:47:16 -08:00
Tim Abbott e7389b4162 test-backend: Require 100% coverage on tests by default. 2017-03-04 23:39:34 -08:00
Tim Abbott 6c12a49d04 test_auth_backends: Remove now-unnecessary compatibility code.
This code was added as part of the Django 1.10 migration to make our
tests work with both Django 1.8 and 1.10.  Now that we're on 1.10,
it's no longer required.
2017-03-04 23:38:46 -08:00
Tim Abbott 39704bac6c test_bugdown: Remove unused common_bugdown_test. 2017-03-04 23:35:46 -08:00
Tim Abbott 1a8bc5f383 coverage: Bring test_decorators to 100% coverage. 2017-03-04 23:34:28 -08:00
Tim Abbott c73c3c52f8 test_email_mirror: Fix TestCommandMTA.
The test didn't actually use the mock, due to an incorrect import
path.
2017-03-04 23:28:48 -08:00
Tim Abbott 6ea3a9cb1d coverage: Bring test_templates.py to 100% coverage. 2017-03-04 23:28:48 -08:00
Tim Abbott d8171b2efc coverage: Bring tests.py to 100% coverage. 2017-03-04 23:17:36 -08:00
Tim Abbott 768307d921 coverage: Bring test_events to 100% coverage. 2017-03-04 23:12:32 -08:00
Tim Abbott 538570b7c1 test_subs: Bring to 100% test coverage. 2017-03-04 23:07:56 -08:00
Tim Abbott 065651b4fe coverage: Exclude uncovered lines in test_signup. 2017-03-04 23:01:50 -08:00
Tim Abbott bc0cd7eb90 coverage: Move coverage config to tools/coveragerc. 2017-03-04 22:48:05 -08:00
Tim Abbott 63664264b8 test-backend: Disable verbose coverage display. 2017-03-04 22:48:05 -08:00
Tim Abbott d90f7c72a3 zephyr: Fix broken postgres regular expression logic and add tests.
Like many rare-case code with new tests, it turns out that the logic
for handling null characters in our Zephyr postgres query escaping
never worked, in multiple ways.  First, it always changed the second
character in s, not the current one being inspected, and second, the
value it replaced it with was no the correct postgres escape of the
null byte.  We fix this and add tests.

This completes the effort to get zerver/views/messages.py to 100%
test coverage.

Fixes #1006.
2017-03-01 10:38:48 -08:00