Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

puppeteer: Rename CASPER_TESTS env variable to PUPPETEER_TESTS.

Dineshc64888048f7a
diff --git a/tools/test-js-with-puppeteer b/tools/test-js-with-puppeteer
index 6943ecace89..c59ecd94ea0 100755
--- a/tools/test-js-with-puppeteer
+++ b/tools/test-js-with-puppeteer
@@ -9,11 +9,8 @@ ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Request the special webpack setup for frontend integration tests,
# where webpack assets are compiled up front rather than running in
-# watch mode. We prefer the same for puppeteer, so the below line
-# makes the webpack similar to casper.
-#
-# TODO: Eventually, we'll want to rename this parameter.
-os.environ["CASPER_TESTS"] = "1"
+# watch mode.
+os.environ["PUPPETEER_TESTS"] = "1"
os.environ["CHROMIUM_EXECUTABLE"] = os.path.join(ZULIP_PATH, "node_modules/.bin/chromium")
os.environ.pop("http_proxy", "")
diff --git a/tools/webpack b/tools/webpack
index 9af7afb2ea3..aea54c43fc6 100755
--- a/tools/webpack
+++ b/tools/webpack
@@ -132,7 +132,7 @@ parser.add_argument('--disable-host-check',
help='Disable host check for webpack-dev-server')
args = parser.parse_args()
-if "CASPER_TESTS" in os.environ:
+if "PUPPETEER_TESTS" in os.environ:
build_for_prod_or_casper(args.quiet)
elif args.test:
build_for_most_tests()
diff --git a/zerver/lib/cache.py b/zerver/lib/cache.py
index c95473134d5..63029f46d54 100644
--- a/zerver/lib/cache.py
+++ b/zerver/lib/cache.py
@@ -69,12 +69,12 @@ def remote_cache_stats_finish() -> None:
remote_cache_total_time += (time.time() - remote_cache_time_start)
def get_or_create_key_prefix() -> str:
- if settings.CASPER_TESTS:
- # This sets the prefix for the benefit of the Casper tests.
+ if settings.PUPPETEER_TESTS:
+ # This sets the prefix for the benefit of the Puppeteer tests.
#
# Having a fixed key is OK since we don't support running
- # multiple copies of the casper tests at the same time anyway.
- return 'casper_tests:'
+ # multiple copies of the puppeteer tests at the same time anyway.
+ return 'puppeteer_tests:'
elif settings.TEST_SUITE:
# The Python tests overwrite KEY_PREFIX on each test, but use
# this codepath as well, just to save running the more complex
diff --git a/zproject/computed_settings.py b/zproject/computed_settings.py
index 72b3529faac..53faad97123 100644
--- a/zproject/computed_settings.py
+++ b/zproject/computed_settings.py
@@ -99,7 +99,7 @@ TEST_SUITE = False
# The new user tutorial is enabled by default, but disabled for client tests.
TUTORIAL_ENABLED = True
# This is overridden in test_settings.py for the test suites
-CASPER_TESTS = False
+PUPPETEER_TESTS = False
# This is overridden in test_settings.py for the test suites
RUNNING_OPENAPI_CURL_TEST = False
# This is overridden in test_settings.py for the test suites
diff --git a/zproject/test_extra_settings.py b/zproject/test_extra_settings.py
index 9433e7bde21..9d1a3f69d28 100644
--- a/zproject/test_extra_settings.py
+++ b/zproject/test_extra_settings.py
@@ -45,8 +45,8 @@ else:
CAMO_URI = 'https://external-content.zulipcdn.net/external_content/'
CAMO_KEY = 'dummy'
-CASPER_TESTS = "CASPER_TESTS" in os.environ
-if CASPER_TESTS:
+PUPPETEER_TESTS = "PUPPETEER_TESTS" in os.environ
+if PUPPETEER_TESTS:
# Disable search pills prototype for production use
SEARCH_PILLS_ENABLED = False
@@ -107,7 +107,7 @@ CACHES['database'] = {
SESSION_ENGINE = "django.contrib.sessions.backends.db"
# Use production config from Webpack in tests
-if CASPER_TESTS:
+if PUPPETEER_TESTS:
WEBPACK_FILE = 'webpack-stats-production.json'
else:
WEBPACK_FILE = os.path.join('var', 'webpack-stats-test.json')
@@ -117,7 +117,7 @@ WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = os.path.join(DEPLOY_ROOT, WEBPACK_FILE
# Don't auto-restart Tornado server during automated tests
AUTORELOAD = False
-if not CASPER_TESTS:
+if not PUPPETEER_TESTS:
# Use local memory cache for backend tests.
CACHES['default'] = {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',