puppeteer: Rename CASPER_TESTS env variable to PUPPETEER_TESTS.

Also modified few comments to match with the changes.
This commit is contained in:
Dinesh 2020-09-05 13:37:07 +00:00 committed by Steve Howell
parent f2b3afcd56
commit c64888048f
5 changed files with 12 additions and 15 deletions

View File

@ -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", "")

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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',