Commit Graph

106 Commits

Author SHA1 Message Date
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
Elliott Jin 7ed10da4ad test-backend: Raise zerver/views/report.py test coverage to 100%. 2017-02-28 20:06:00 -08:00
Elliott Jin 11ba94f11a test-backend: Raise zerver/views/integrations.py test coverage to 100%. 2017-02-28 09:31:06 -08:00
Elliott Jin 6bdefb92e9 test-backend: Raise zerver/views/zephyr.py test coverage to 100%. 2017-02-26 20:54:25 -08:00
Elliott Jin f3cd3e8b8d test-backend: Raise zerver/views/invite.py test coverage to 100%. 2017-02-26 16:15:25 -08:00
Elliott Jin cebc67f9b0 test-backend: Raise zerver/views/unsubscribe.py test coverage to 100%. 2017-02-26 16:13:35 -08:00
K.Kanakhin 257bb40698 realm-icon: Add realm icon feature.
- Add realm icon fields to realm model.
- Add migration for new realm model's field.
- Add views for icon uploading and deleting.
- Add routes for realm icons views.
- Add JS widget for realm icon upload setting.
- Add realm icon upload to administration
  organization setting.
- Add tests for realm icons.

Fixes #3660.
2017-02-26 12:16:07 -08:00
Elliott Jin f038cd47d9 test-backend: Raise zerver/views/realm.py test coverage to 100%. 2017-02-25 18:18:29 -08:00
Umair Khan 128beb910b testing: Use TestResult in run_test.
Internally, Django uses TestResult to gather results from testcases.
This commit upgrades the run_test function to use TestResult to compile
result.
2017-02-19 21:04:06 -08:00
Tim Abbott 9ac66b0121 test-backend: Update blacklist of covered files based on CI.
After accidentally merging ecadb33fbc
before I go CI input, I discovered that coverage in my development
environment differs from that in CI :(.
2017-02-18 18:52:59 -08:00
Tim Abbott ecadb33fbc test-backend: Add 100% test coverage assertions.
This adds an assertion, when `test-backend` is run with `--coverage`,
that we have 100% test coverage on a list of files that we expect to.
There's a whitelist/blacklist, managed in tools/test-backend.

Fixes #3363.
2017-02-18 16:34:40 -08:00