run-test.py script should make sure 'node_modules' directory exist before installing
https://bugs.webkit.org/show_bug.cgi?id=181808
Summary run-test.py script should make sure 'node_modules' directory exist before ins...
dewei_zhu
Reported 2018-01-18 12:41:06 PST
run-test.py script should make sure 'node_modules' directory exist before installing
Attachments
Patch (1.96 KB, patch)
2018-01-18 12:42 PST, dewei_zhu
rniwa: review+
dewei_zhu
Comment 1 2018-01-18 12:42:23 PST
Aakash Jain
Comment 2 2018-01-23 20:25:55 PST
This change causes unit-tests to fail as mkdir fails when the directory already exists. [~]$ tools/run-tests.py unit-tests Traceback (most recent call last): File "tools/run-tests.py", line 25, in <module> main() File "tools/run-tests.py", line 13, in main os.makedirs(node_modules_dir) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 17] File exists: '/Volume/Data/OpenSource/Websites/perf.webkit.org/node_modules'
Aakash Jain
Comment 3 2018-01-23 20:27:18 PST
Aakash Jain
Comment 4 2018-01-23 20:40:48 PST
Comment on attachment 331651 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=331651&action=review > Websites/perf.webkit.org/tools/run-tests.py:13 > + os.makedirs(node_modules_dir) This fails when the directory already exists. Should check first if the directory exists. e.g.: if not os.path.exists(node_modules_dir): os.makedirs(node_modules_dir)
dewei_zhu
Comment 5 2018-01-24 00:34:29 PST
Comment on attachment 331651 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=331651&action=review >> Websites/perf.webkit.org/tools/run-tests.py:13 >> + os.makedirs(node_modules_dir) > > This fails when the directory already exists. Should check first if the directory exists. e.g.: > > if not os.path.exists(node_modules_dir): > os.makedirs(node_modules_dir) You are right. I'll land the fix.
Note You need to log in before you can comment on or make changes to this bug.