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.
This commit is contained in:
Ayush Jain 2017-03-24 17:18:56 +05:30 committed by Tim Abbott
parent 70b7d4c00b
commit 518d25a0cf
2 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,8 @@ import glob
os.environ["CASPER_TESTS"] = "1" os.environ["CASPER_TESTS"] = "1"
os.environ["PHANTOMJS_EXECUTABLE"] = os.path.join(os.path.dirname(__file__), "../node_modules/.bin/phantomjs") os.environ["PHANTOMJS_EXECUTABLE"] = os.path.join(os.path.dirname(__file__), "../node_modules/.bin/phantomjs")
os.environ["http_proxy"] = ""
os.environ["https_proxy"] = ""
usage = """%prog [options] usage = """%prog [options]
test-js-with-casper # Run all test files test-js-with-casper # Run all test files

View File

@ -113,6 +113,11 @@ if __name__ == "__main__":
TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
os.chdir(os.path.dirname(TOOLS_DIR)) os.chdir(os.path.dirname(TOOLS_DIR))
sys.path.insert(0, os.path.dirname(TOOLS_DIR)) sys.path.insert(0, os.path.dirname(TOOLS_DIR))
# Remove proxy settings for running backend tests
os.environ["http_proxy"] = ""
os.environ["https_proxy"] = ""
from zerver.lib.test_fixtures import is_template_database_current from zerver.lib.test_fixtures import is_template_database_current
from tools.lib.test_script import ( from tools.lib.test_script import (