From cd43c70f3cc73392f0df159fd31956f7bef0677c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Fri, 5 Apr 2019 12:45:00 +0000 Subject: [PATCH] Bug 1540569: Set TZ and LC_ALL for jstestbrowser suite following the jstest shell runner. r=ahal The shell runner explicitly sets TZ=PST8PDT and LC_ALL=en_US.UTF-8 for the jstest test suite. Use the same environment defaults when running this test suite in the browser. Differential Revision: https://phabricator.services.mozilla.com/D25908 --HG-- extra : moz-landing-system : lando --- js/src/tests/lib/tests.py | 1 + layout/tools/reftest/runreftest.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/js/src/tests/lib/tests.py b/js/src/tests/lib/tests.py index f904dc13dcfb..149d27e1206c 100644 --- a/js/src/tests/lib/tests.py +++ b/js/src/tests/lib/tests.py @@ -69,6 +69,7 @@ def get_environment_overlay(js_shell): Build a dict of additional environment variables that must be set to run tests successfully. """ + # When updating this also update |buildBrowserEnv| in layout/tools/reftest/runreftest.py. env = { # Force Pacific time zone to avoid failures in Date tests. 'TZ': 'PST8PDT', diff --git a/layout/tools/reftest/runreftest.py b/layout/tools/reftest/runreftest.py index 951a1dd1d79b..dc63c528fd96 100644 --- a/layout/tools/reftest/runreftest.py +++ b/layout/tools/reftest/runreftest.py @@ -437,6 +437,12 @@ class RefTest(object): else: browserEnv["ASAN_OPTIONS"] = "detect_leaks=0" + # Set environment defaults for jstestbrowser. Keep in sync with the + # defaults used in js/src/tests/lib/tests.py. + if options.suite == "jstestbrowser": + browserEnv["TZ"] = "PST8PDT" + browserEnv["LC_ALL"] = "en_US.UTF-8" + for v in options.environment: ix = v.find("=") if ix <= 0: