Run test: Disable color output on LUCI

Test: Colors still work locally
Change-Id: I9452de8a6c6274462520f42ce4ddec1449e30696
diff --git a/test/default_run.py b/test/default_run.py
index 3f1baf3..b5afd8c 100755
--- a/test/default_run.py
+++ b/test/default_run.py
@@ -21,9 +21,11 @@
 from subprocess import DEVNULL, PIPE, STDOUT
 from tempfile import NamedTemporaryFile
 
-COLOR_RED = '\033[91m'
-COLOR_BLUE = '\033[94m'
-COLOR_NORMAL = '\033[0m'
+COLOR = (os.environ.get("LUCI_CONTEXT") == None)  # Disable colors on LUCI.
+COLOR_BLUE = '\033[94m' if COLOR else ''
+COLOR_GREEN = '\033[92m' if COLOR else ''
+COLOR_NORMAL = '\033[0m' if COLOR else ''
+COLOR_RED = '\033[91m' if COLOR else ''
 
 def parse_args(argv):
   argp, opt_bool = ArgumentParser(), BooleanOptionalAction
diff --git a/test/run-test b/test/run-test
index 612aa92..2bffe37 100755
--- a/test/run-test
+++ b/test/run-test
@@ -24,10 +24,11 @@
 from shutil import copyfile
 from typing import Optional
 
-COLOR_BLUE = '\033[94m'
-COLOR_GREEN = '\033[92m'
-COLOR_NORMAL = '\033[0m'
-COLOR_RED = '\033[91m'
+COLOR = (os.environ.get("LUCI_CONTEXT") == None)  # Disable colors on LUCI.
+COLOR_BLUE = '\033[94m' if COLOR else ''
+COLOR_GREEN = '\033[92m' if COLOR else ''
+COLOR_NORMAL = '\033[0m' if COLOR else ''
+COLOR_RED = '\033[91m' if COLOR else ''
 
 # Helper class which allows us to access the environment using syntax sugar.
 # E.g. `env.ANDROID_BUILD_TOP` instead of `os.environ["ANDROID_BUILD_TOP"]`.