From: rniwa@webkit.org Date: Tue, 12 Apr 2016 03:42:29 +0000 (+0000) Subject: Replace script runner to use mocha.js tests X-Git-Url: https://git.webkit.org/?p=WebKit.git;a=commitdiff_plain;h=20b0482183beb97021d77cfb6800d84d6139aacc 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): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@199333 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Websites/perf.webkit.org/ChangeLog b/Websites/perf.webkit.org/ChangeLog index 802e7b4..eedc62c 100644 --- a/Websites/perf.webkit.org/ChangeLog +++ b/Websites/perf.webkit.org/ChangeLog @@ -1,5 +1,20 @@ 2016-04-11 Ryosuke Niwa + 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 + 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 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 index 0000000..f95007a --- /dev/null +++ b/Websites/perf.webkit.org/tools/run-tests.py @@ -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()