Replace script runner to use mocha.js tests
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Apr 2016 03:42:29 +0000 (03:42 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Apr 2016 03:42:29 +0000 (03:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=156490

Reviewed by Chris Dumez.

Replaced run-tests.js, which was a whole test harness for running legacy tests by tools/run-tests.py
which is a thin wrapper around mocha.js.

* run-tests.js: Removed.
* tests: Removed.
* tools/run-tests.py: Added.
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@199333 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/run-tests.js [deleted file]
Websites/perf.webkit.org/tools/run-tests.py [new file with mode: 0755]

index 802e7b4..eedc62c 100644 (file)
@@ -1,5 +1,20 @@
 2016-04-11  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Replace script runner to use mocha.js tests
+        https://bugs.webkit.org/show_bug.cgi?id=156490
+
+        Reviewed by Chris Dumez.
+
+        Replaced run-tests.js, which was a whole test harness for running legacy tests by tools/run-tests.py
+        which is a thin wrapper around mocha.js.
+
+        * run-tests.js: Removed.
+        * tests: Removed.
+        * tools/run-tests.py: Added.
+        (main):
+
+2016-04-11  Ryosuke Niwa  <rniwa@webkit.org>
+
         New syncing script sometimes schedules a build request on a wrong builder
         https://bugs.webkit.org/show_bug.cgi?id=156489
 
diff --git a/Websites/perf.webkit.org/run-tests.js b/Websites/perf.webkit.org/run-tests.js
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Websites/perf.webkit.org/tools/run-tests.py b/Websites/perf.webkit.org/tools/run-tests.py
new file mode 100755 (executable)
index 0000000..f95007a
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+import os
+import subprocess
+
+
+def main():
+    tools_dir = os.path.dirname(__file__)
+    root_dir = os.path.abspath(os.path.join(tools_dir, '..'))
+    node_modules_dir = os.path.join(root_dir, 'node_modules')
+
+    os.chdir(root_dir)
+    packages = ['mocha', 'pg']
+    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])
+
+    mocha_path = os.path.join(node_modules_dir, 'mocha/bin/mocha')
+    return subprocess.call([mocha_path, 'unit-tests', 'server-tests'])
+
+if __name__ == "__main__":
+    main()