Commit Graph

1605 Commits

Author SHA1 Message Date
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
Tim Abbott b0f53fd1a8 check-templates: Check left and right sidebars. 2017-03-01 09:08:09 -08:00
Tim Abbott 0712926b84 templates: Rename right-sidebar.html to right_sidebar.html. 2017-03-01 09:02:15 -08:00
Tim Abbott 748ec32349 templates: Rename left-sidebar.html to left_sidebar.html. 2017-03-01 09:00:51 -08:00
Tim Abbott 7fb406b889 lint: Expand lint check for use of .text() without i18n.
Fixes #3705.
2017-02-28 20:37:52 -08:00
Tim Abbott d9ef6281fa lint: Clean json_error/JsonableError lint exceptions.
We primarily need to be checking for literal strings being passed in
without i18n tags, not for code that passes a constructed value in.
2017-02-28 20:26:18 -08:00
Elliott Jin 7ed10da4ad test-backend: Raise zerver/views/report.py test coverage to 100%. 2017-02-28 20:06:00 -08:00
K.Kanakhin 23706a3c9e Add server error response for failed handlebars template compilation.
- Add stamp file creation for the failed templates compilation.
- Add error response to `home` route if stamp file exists. It appears
  just for the development environment.
- Add jinja2 template for failed handlebars templates compilation error.

Fixes #3650.
2017-02-28 09:44:08 -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
Harshit Bansal 3651a432d5 build_emoji: Add `name_to_codepoint` dict to emoji_codes.js file. 2017-02-26 18:28:42 -08:00
Harshit Bansal 1b0d3cbb39 tools/build_emoji: Generate `name_to_codepoint.json` file.
Generate the `name_to_codepoint.json` file in build_emoji which will be
used by bugdown/ to map emoji names to codepoints directly.
2017-02-26 18:28:42 -08:00
Harshit Bansal bc4aef0bc7 emoji: Move zulip-emoji to `images/emoji/unicode`.
Move zulip-emoji from its current location `images/emoji` to
`images/emoji/unicode` and add a symlink in `images/emoji`
to zulip.png in `images/emoji/unicode`.
2017-02-26 18:28:41 -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 5bf83f9e0a change-email: Implement confirmation flow.
This adds to Zulip support for a user changing their own email
address.

It's backed by a huge amount of work by Steve Howell on making email
changes actually work from a UI perspective.

Fixes #734.
2017-02-23 03:15:17 -08:00
adnrs96 3acf8b050d Add Django and html singleton tags support to pretty print.
In this commit we are modifying pretty print tool to support
Django and html singleton tags. For Addition of html singleton
tags template parser was modified to emit psudeo
html singleton end tags to accompany html singleton tags and
token class was updated to have line_span field.
2017-02-22 20:21:58 -08:00
adnrs96 5b5a0bdb80 Improve check-templates error handling.
In this commit we improve the way errors are handled in our
template parser and thus improving the displayed messages in
case of errors. Eg. Errors in case of unbalanced quotes now
makes more sense displaying line and column information
including line where error might be sourced.
2017-02-22 17:39:12 -08:00
Tim Abbott aa6567ee34 queue_workers: Fix confusing --queue_type argument name. 2017-02-22 00:23:26 -08:00
Tim Abbott 2768be7fdf travis: Add logs to rabbitmq consumer debug output. 2017-02-22 00:21:22 -08:00
Tim Abbott 19896460f0 nagios: Fix RabbitMQ Nagios checks running Django as root.
This can cause problems by making the /var/log/zulip files owned by
root (not zulip) and thus not writable by the Zulip user.
2017-02-22 00:20:57 -08:00
Tim Abbott bd1d545a5a travis: Update to handle postgres changes in build env. 2017-02-20 10:44:22 -08:00
Tim Abbott 306b29d414 travis: Improve debuggability of rabbitmq errors. 2017-02-19 23:44:40 -08:00
Tim Abbott 4f2a2a39f9 travis: Increase the supervisor sleep to 15s for now.
The hope is this will help us investigate failures like
https://travis-ci.org/zulip/zulip/jobs/203335213.
2017-02-19 23:41:42 -08:00
Tim Abbott 620f1e444e travis: Fix various bugs in new queue worker test.
* Now queue_workers.py sorts queue names and prints them on their own
  line.  Previously it's output was nondeterministic.
* Simplified grep strategy for removing the "test" worker.
2017-02-19 21:17:42 -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 42cbce9ad6 travis: Add special check for queue processor lists matching. 2017-02-19 16:19:55 -08:00
Tim Abbott d6bbcd2737 travis: Automate updates to production-helper Nagios test.
This list was likely to end up out of date quickly, since it wasn't
documented that you need to update it when adding a queue.  The best
solution is to just not require it to be updated.
2017-02-19 16:19:53 -08:00
Tim Abbott 64898dd0d1 run-dev-queue-processors: Remove dead code. 2017-02-19 13:11:19 -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 473c0ee1fe mypy: Remove now-unused type: ignores. 2017-02-18 17:01:01 -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
Tim Abbott 1abfdc340a lint-all: Soften check for % comprehensions. 2017-02-18 16:29:47 -08:00
Tim Abbott 3ccbc7c114 run-dev: Use a different path for casper test PID file.
This fixes an issue where running the casper tests while a development
server was running would effectively corrupt the PID file.
2017-02-17 16:31:28 -08:00
adnrs96 e84cf7b6f1 tools: Create HTML pretty printer.
In This commit we extend the work being done by @showell in PR#1778
to develop a tool to pretty print html and our handlebar templates
in order to enforce our style convention of 4 Space indentation in
templates.

This commit introduces following changes:
* Fix Py3 Compatibility.
* Add ability to prettify in cases when html tags are not the
  starting of a line and addition of test cases for it.
* Add ability to lint handlebar tags and add test cases for it.
* Add {{else}} as special case of indent.
* Add test cases in general to testing new tool.

@showell Helped me throughout and reviewed this commit.

Fixes #1778
2017-02-15 07:34:43 -08:00
Saumya Rawat dcd9ff642d dev: Fix postgres provision errors with non-postgres-readable homedir.
This fixes an issue where provision would fail if the user's home
directory was setup in such a way that the postgres user couldn't
access it (and thus the `sudo` command here would throw errors about
having a non-readable current working directory).
2017-02-11 23:47:07 -08:00
Saumya Rawat 151d2139ad dev: Clearer postgres error messages in postgres-init-dev-db.
This uses `pg_isready` to provide a clearer error message if postgres
isn't working.

Fixes #2419.
2017-02-11 23:46:56 -08: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
Tim Abbott 879d8cdca0 mypy: Stop using deprecated --silent-imports. 2017-02-10 23:53:44 -08:00
Tim Abbott bb5d81281c mypy: Upgrade to new package name and version 0.571.
Fixes #3448.
2017-02-10 23:53:44 -08:00
Tim Abbott 650469ead6 mypy: Make zerver/lib/ccache.py support python 3. 2017-02-10 23:53:44 -08:00
Tim Abbott 0564bebdbe test-migrations: Fix inverted check. 2017-02-10 16:41:04 -08:00
Tim Abbott 1fbc3b508a test-migrations: Switch to --check from deprecated -e. 2017-02-10 16:08:13 -08:00
Umair Khan e5a16ceb0a testing: Use failfast instead of fatal_errors.
`failfast` has the same meaning as `fatal_errors` in Django's test
runner.
2017-02-10 16:01:43 -08:00
Umair Khan ef0d2a4bb5 logging: Use django.server to filter 200 and 304.
Previously, we were monkey patching the runserver command
in zerver/management/commands/rundjango.py for this.
2017-02-10 15:55:17 -08:00
Abhijeet Kaur 87e8d9036f contrib_bots: Restructure bots to follow a consistent structure.
Now all the bots that are stored in contrib_bots are in the
same file/directory format.
The format is specified here #3427. Add tests.py file for encrypt_bot as well.
Fixes #3427.
2017-02-10 06:44:03 -08:00
Brock Whittaker 1143ed7219 redesign: Change /#settings and /#administration to an overlay.
This also adds a box-shadow to the #deactivate_self_modal so that it
looks similar to the old backdrop.
2017-02-09 23:35:10 -08:00
Tim Abbott 0c363dffca lint: Ban use of deprecated assertEquals. 2017-02-08 16:38:43 -08:00