Title: [227395] trunk/Websites/perf.webkit.org
Revision
227395
Author
dewei_...@apple.com
Date
2018-01-22 20:39:10 -0800 (Mon, 22 Jan 2018)

Log Message

'run-test.py' script should make sure 'node_modules' directory exists before installing node packages.
https://bugs.webkit.org/show_bug.cgi?id=181808

Reviewed by Ryosuke Niwa.

'run-test.py' will fail if 'node_modules' does not exist before running this script.
Instead of calling 'os.chdir' to change directory, use 'cwd' in subprocess instead.

* tools/run-tests.py: Added the logic to ensure 'node_modules' exists.
Also use 'cwd' in subprocess.call instead of calling 'os.chdir' ahead.

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (227394 => 227395)


--- trunk/Websites/perf.webkit.org/ChangeLog	2018-01-23 04:08:55 UTC (rev 227394)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2018-01-23 04:39:10 UTC (rev 227395)
@@ -1,3 +1,16 @@
+2018-01-18  Dewei Zhu  <dewei_...@apple.com>
+
+        'run-test.py' script should make sure 'node_modules' directory exists before installing node packages.
+        https://bugs.webkit.org/show_bug.cgi?id=181808
+
+        Reviewed by Ryosuke Niwa.
+
+        'run-test.py' will fail if 'node_modules' does not exist before running this script.
+        Instead of calling 'os.chdir' to change directory, use 'cwd' in subprocess instead.
+
+        * tools/run-tests.py: Added the logic to ensure 'node_modules' exists.
+        Also use 'cwd' in subprocess.call instead of calling 'os.chdir' ahead.
+
 2018-01-20  Dewei Zhu  <dewei_...@apple.com>
 
         Extend 'ifBuilt' config key to set property based on whether certain repositories are built or not.

Modified: trunk/Websites/perf.webkit.org/tools/run-tests.py (227394 => 227395)


--- trunk/Websites/perf.webkit.org/tools/run-tests.py	2018-01-23 04:08:55 UTC (rev 227394)
+++ trunk/Websites/perf.webkit.org/tools/run-tests.py	2018-01-23 04:39:10 UTC (rev 227395)
@@ -10,12 +10,12 @@
     root_dir = os.path.abspath(os.path.join(tools_dir, '..'))
     node_modules_dir = os.path.join(root_dir, 'node_modules')
 
-    os.chdir(root_dir)
+    os.makedirs(node_modules_dir)
     packages = ['mocha', 'pg', 'form-data']
     for package_name in packages:
         target_dir = os.path.join(node_modules_dir, package_name)
         if not os.path.isdir(target_dir):
-            subprocess.call(['npm', 'install', package_name])
+            subprocess.call(['npm', 'install', package_name], cwd=node_modules_dir)
 
     mocha_path = os.path.join(node_modules_dir, 'mocha/bin/mocha')
     test_paths = sys.argv[1:] or ['unit-tests', 'server-tests']
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to