Commit Graph

21002 Commits

Author SHA1 Message Date
Greg Price
b63e995e82 tornado: Fix a Redis-caused str/bytes bug in status_inquiries.
Because the Redis client returns exclusively bytes -- even for
hash keys -- even on Python 3, the test `'response' in status`
was always returning false, and the line that tries to decode
as JSON was never running, so we were passing `response`
through as a `bytes` object encoding some JSON.

I'm not sure what the impact of this bug was, and in particular
whether something downstream would have fudged it to make up for
this error.
2017-08-25 16:14:33 -07:00
Greg Price
dfbd80f302 email_mirror: Convert subjects back to str from Redis's bytes.
Redis and the Redis client know nothing but bytes.  When we take a
`bytes` object it returns and pass it down as `subject` here, it
causes an exception deep inside message processing if the realm has
any filters, when `bugdown.subject_links` attempts to search the
subject for the filters, which are of course `str` patterns.

For symmetry, make the conversion to bytes on the storing side
explicit too.
2017-08-25 16:14:33 -07:00
Tim Abbott
20c0d27317 test_narrow: Specify subdomains explicitly. 2017-08-25 16:09:52 -07:00
Tim Abbott
edc095db6d test_subs: Explicitly declare subdomains. 2017-08-25 16:09:51 -07:00
Tim Abbott
6caca80ab7 test_presence: Specify subdomains for Zephyr tests. 2017-08-25 16:08:37 -07:00
Tim Abbott
7a5eb9dd9f tornado: Add support for testing with subdomains. 2017-08-25 15:42:58 -07:00
Tim Abbott
acdeaca2a8 test_zephyr: Explictly declare subdomain in requests. 2017-08-25 15:42:50 -07:00
Tim Abbott
43cfe73908 tests: Make requests use the "zulip" subdomain by default.
Previously, we didn't pass customized HTTP_HOST headers when making
network requests.  As we move towards a world where everything is on a
subdomain, we'll want to start doing that.

The vast majority of our test code is written to interact with the
default "zulip" realm, which has a subdomain of "zulip".  While
probably longer-term, we'll wish this was the root domain, for now, we
need to make our HTTP requests match what is expected by the test
code.

This commit almost certainly introduces some weird bugs where code was
expecting a different subdomain but the tests doesn't fail yet.  It's
not clear how to find all of these, but I've done some grepping.
2017-08-25 15:42:49 -07:00
Tim Abbott
ba64d4ee29 server_settings: Add additional subdomains test case.
This will help preserve 100% test coverage as we refactor to set
REALMS_HAVE_SUBDOMAINS=True unconditonally.
2017-08-25 15:42:43 -07:00
Tim Abbott
64e895533b test_docs: Add tests for different subdomain states.
This helps maintain 100% test coverage on the new test_classes code.
2017-08-25 15:42:43 -07:00
Tim Abbott
b0c8404622 tests: Add subdomain option to client_get and friends.
This should help make it easy to set the domain explicitly in tests
where that's important.
2017-08-25 15:42:42 -07:00
Tim Abbott
d449346bb5 puppet: Fix process leaks in small-server configuration.
Whenever you restarted supervisord services, we'd end up leaking one
process from the process_queue group, eventually resulting in running
out of memory.

Fixes #6184.
2017-08-25 12:36:29 -07:00
Tim Abbott
f91a2a8ef2 supervisord: Improve memory footprint for small servers.
This cuts the number of uwsgi and message_sender works for smaller
servers with only 2GB of RAM.
2017-08-25 12:34:41 -07:00
neiljp (Neil Pilgrim)
92985f888b mypy: Adjust check of json from github in update-authors-json. 2017-08-25 12:04:15 -07:00
neiljp (Neil Pilgrim)
a059872856 mypy: Clarify xml.find use in build_emoji:code_point_to_file_name_map. 2017-08-25 12:04:15 -07:00
Tim Abbott
4b709de9c9 python3: Remove six.PY2/six.PY3 checks. 2017-08-25 11:06:43 -07:00
Tim Abbott
4229faf36e tests: Remove old six.PY2 code paths. 2017-08-25 11:05:16 -07:00
Tim Abbott
b8e7369dee mypy: Remove type: ignores not needed in Python 3. 2017-08-25 11:04:20 -07:00
Tim Abbott
55f0555c8d requirements: Update mypy to latest master. 2017-08-25 10:53:10 -07:00
Tim Abbott
b4d698f0db js-dep-visualizer: Report the PNG file as well. 2017-08-25 10:43:37 -07:00
Vaida Plankyte
a492fc80ed hello.html: Change feature images to SVGs. 2017-08-25 10:30:22 -07:00
Tim Abbott
498c298c14 rate_limiter: Fix buggy use of NotImplementedError. 2017-08-25 09:53:09 -07:00
Tim Abbott
8b2cd96126 confirmation: Fix arguments to super().
This and the last half-dozen commits were identified by lgtm.
2017-08-25 09:49:45 -07:00
Tim Abbott
bee86b6e6b send_email: Fix modification of mutable default value. 2017-08-25 09:43:53 -07:00
Tim Abbott
537ad1ff1b templatetags: Fix buggy exception clause. 2017-08-25 00:39:58 -07:00
Tim Abbott
1bb09e35d2 message: Add assertions for invalid recipient types. 2017-08-25 00:39:36 -07:00
Tim Abbott
f3c73e4aa4 actions: Add assertion for invalid flag operations. 2017-08-25 00:34:56 -07:00
Tim Abbott
35f1bbb968 process_new_human_user: Simplify prereg_user logic.
We don't need the old code paths now that we don't have an MitUser
model anymore.
2017-08-25 00:34:06 -07:00
Tim Abbott
8df7deac9d deactivation: Add some styling to make boxes smaller. 2017-08-25 00:16:35 -07:00
Umair Khan
9720d3a986 accounts_register: Use redirect_to_deactivation_notice. 2017-08-25 00:09:06 -07:00
Umair Khan
43c40f6144 Add tests for deactivation notice. 2017-08-25 00:09:06 -07:00
Umair Khan
abda7ee853 Upgrade deactivated.html to use white box. 2017-08-25 00:09:06 -07:00
Umair Khan
b473ff54ce Show realm deactivation notice for login/register.
Fixes #6247
2017-08-25 00:09:06 -07:00
Tim Abbott
07a156c400 notifications: Fix desktop/sound notifications for @all.
It appears that previously, these weren't being triggered.
2017-08-24 23:56:10 -07:00
Tim Abbott
a2c21543bc mentions: Fix mention state being lost after reload.
This fixes a regression introduced in
bc2069aec2, which caused @-all mentions
to not be displayed properly.

Fixes #5317.
2017-08-24 23:47:55 -07:00
Cynthia Lin
8addc9b97e message view: Maintain stream color border on @-mention messages.
Fixes #6241
2017-08-24 23:37:59 -07:00
Tim Abbott
50defd9b70 test_classes: Remove some unnecessary functions. 2017-08-24 23:33:12 -07:00
Tim Abbott
7d08ff69f0 tests: Remove most references to get_api_key.
This test helper doesn't really have value.
2017-08-24 23:30:46 -07:00
Tim Abbott
e2ae096035 test_signup: Fix coverage of remaining find_my_team code. 2017-08-24 23:30:46 -07:00
Tim Abbott
59aae22f99 registration: Fix find_my_team handling of unusual users. 2017-08-24 23:17:08 -07:00
Tim Abbott
ca7075a0a8 test_signup: Clean up find_my_team test suite. 2017-08-24 23:17:08 -07:00
Tim Abbott
eeabed9119 models: Add new get_user_profile_by_api_key helper.
This results in a slight performance increase.
2017-08-24 23:17:08 -07:00
Tim Abbott
80caa5c66f socket: Use get_user_profile_by_id.
This should have a slight performance benefit.
2017-08-24 23:16:42 -07:00
Tim Abbott
ffafa05bd5 decorator: Remove unnecesary import. 2017-08-24 23:16:31 -07:00
Tim Abbott
2aab6e0f49 forms: Replace is_inactive with more comprehensive check.
While we're at it, we clean up the old confusing error messages.
2017-08-24 23:16:31 -07:00
Tim Abbott
b3dbba3ad4 actions: Extract validate_email_for_realm helper. 2017-08-24 23:16:31 -07:00
Tim Abbott
c8f53e55db websocket_client: Use get_system_bot.
This messy code is used only for our websocket Nagios tests, so using
get_system_bot makes sense.
2017-08-24 23:16:18 -07:00
Tim Abbott
e915fa058a test_classes: Stop using get_realm_by_email_domain.
get_realm_by_email_domain was intended to be registration flow code
not used in other code, but it was leaked to a few places.  This
removes one of the main remaining references to it outside the
registration code path.
2017-08-24 21:38:02 -07:00
Tim Abbott
95ed00bade tests: Remove now-unused subscribe_to_stream helper. 2017-08-24 21:38:02 -07:00
Tim Abbott
69059dcac8 tests: Clean up subscribing from webhook tests. 2017-08-24 21:37:57 -07:00