mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 03:53:50 +00:00 
			
		
		
		
	puppeteer: Rename CASPER_TESTS env variable to PUPPETEER_TESTS.
Also modified few comments to match with the changes.
This commit is contained in:
		| @@ -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, | # Request the special webpack setup for frontend integration tests, | ||||||
| # where webpack assets are compiled up front rather than running in | # where webpack assets are compiled up front rather than running in | ||||||
| # watch mode. We prefer the same for puppeteer, so the below line | # watch mode. | ||||||
| # makes the webpack similar to casper. | os.environ["PUPPETEER_TESTS"] = "1" | ||||||
| # |  | ||||||
| # TODO: Eventually, we'll want to rename this parameter. |  | ||||||
| os.environ["CASPER_TESTS"] = "1" |  | ||||||
|  |  | ||||||
| os.environ["CHROMIUM_EXECUTABLE"] = os.path.join(ZULIP_PATH, "node_modules/.bin/chromium") | os.environ["CHROMIUM_EXECUTABLE"] = os.path.join(ZULIP_PATH, "node_modules/.bin/chromium") | ||||||
| os.environ.pop("http_proxy", "") | os.environ.pop("http_proxy", "") | ||||||
|   | |||||||
| @@ -132,7 +132,7 @@ parser.add_argument('--disable-host-check', | |||||||
|                     help='Disable host check for webpack-dev-server') |                     help='Disable host check for webpack-dev-server') | ||||||
|  |  | ||||||
| args = parser.parse_args() | args = parser.parse_args() | ||||||
| if "CASPER_TESTS" in os.environ: | if "PUPPETEER_TESTS" in os.environ: | ||||||
|     build_for_prod_or_casper(args.quiet) |     build_for_prod_or_casper(args.quiet) | ||||||
| elif args.test: | elif args.test: | ||||||
|     build_for_most_tests() |     build_for_most_tests() | ||||||
|   | |||||||
| @@ -69,12 +69,12 @@ def remote_cache_stats_finish() -> None: | |||||||
|     remote_cache_total_time += (time.time() - remote_cache_time_start) |     remote_cache_total_time += (time.time() - remote_cache_time_start) | ||||||
|  |  | ||||||
| def get_or_create_key_prefix() -> str: | def get_or_create_key_prefix() -> str: | ||||||
|     if settings.CASPER_TESTS: |     if settings.PUPPETEER_TESTS: | ||||||
|         # This sets the prefix for the benefit of the Casper tests. |         # This sets the prefix for the benefit of the Puppeteer tests. | ||||||
|         # |         # | ||||||
|         # Having a fixed key is OK since we don't support running |         # Having a fixed key is OK since we don't support running | ||||||
|         # multiple copies of the casper tests at the same time anyway. |         # multiple copies of the puppeteer tests at the same time anyway. | ||||||
|         return 'casper_tests:' |         return 'puppeteer_tests:' | ||||||
|     elif settings.TEST_SUITE: |     elif settings.TEST_SUITE: | ||||||
|         # The Python tests overwrite KEY_PREFIX on each test, but use |         # The Python tests overwrite KEY_PREFIX on each test, but use | ||||||
|         # this codepath as well, just to save running the more complex |         # this codepath as well, just to save running the more complex | ||||||
|   | |||||||
| @@ -99,7 +99,7 @@ TEST_SUITE = False | |||||||
| # The new user tutorial is enabled by default, but disabled for client tests. | # The new user tutorial is enabled by default, but disabled for client tests. | ||||||
| TUTORIAL_ENABLED = True | TUTORIAL_ENABLED = True | ||||||
| # This is overridden in test_settings.py for the test suites | # 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 | # This is overridden in test_settings.py for the test suites | ||||||
| RUNNING_OPENAPI_CURL_TEST = False | RUNNING_OPENAPI_CURL_TEST = False | ||||||
| # This is overridden in test_settings.py for the test suites | # This is overridden in test_settings.py for the test suites | ||||||
|   | |||||||
| @@ -45,8 +45,8 @@ else: | |||||||
|     CAMO_URI = 'https://external-content.zulipcdn.net/external_content/' |     CAMO_URI = 'https://external-content.zulipcdn.net/external_content/' | ||||||
|     CAMO_KEY = 'dummy' |     CAMO_KEY = 'dummy' | ||||||
|  |  | ||||||
| CASPER_TESTS = "CASPER_TESTS" in os.environ | PUPPETEER_TESTS = "PUPPETEER_TESTS" in os.environ | ||||||
| if CASPER_TESTS: | if PUPPETEER_TESTS: | ||||||
|     # Disable search pills prototype for production use |     # Disable search pills prototype for production use | ||||||
|     SEARCH_PILLS_ENABLED = False |     SEARCH_PILLS_ENABLED = False | ||||||
|  |  | ||||||
| @@ -107,7 +107,7 @@ CACHES['database'] = { | |||||||
| SESSION_ENGINE = "django.contrib.sessions.backends.db" | SESSION_ENGINE = "django.contrib.sessions.backends.db" | ||||||
|  |  | ||||||
| # Use production config from Webpack in tests | # Use production config from Webpack in tests | ||||||
| if CASPER_TESTS: | if PUPPETEER_TESTS: | ||||||
|     WEBPACK_FILE = 'webpack-stats-production.json' |     WEBPACK_FILE = 'webpack-stats-production.json' | ||||||
| else: | else: | ||||||
|     WEBPACK_FILE = os.path.join('var', 'webpack-stats-test.json') |     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 | # Don't auto-restart Tornado server during automated tests | ||||||
| AUTORELOAD = False | AUTORELOAD = False | ||||||
|  |  | ||||||
| if not CASPER_TESTS: | if not PUPPETEER_TESTS: | ||||||
|     # Use local memory cache for backend tests. |     # Use local memory cache for backend tests. | ||||||
|     CACHES['default'] = { |     CACHES['default'] = { | ||||||
|         'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', |         'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user