From 76ea1f18374b6a4b9694abaf5f2a4a8af1375722 Mon Sep 17 00:00:00 2001 From: Michael Krotscheck Date: Wed, 3 Jun 2015 16:16:18 -0700 Subject: Trigger tox from package.json, if necessary. This patch adds several fixes to improve karma test handling. * A postinstall hook was added to package.json, which tests for the existence of .venv. If it is not found, it will invoke tox -e py27 --notest. * Both karma.conf files were taught to automatically detect the directories in which the xstatic dependencies might live, and pick the appropriate directory. postinstall was chosen, because setting up a virtual environment is likely to be useful for more than one type of npm job. Change-Id: I822cb020bd8b2ca8d4f994b9734af5636e4bd144 --- package.json | 1 + 1 file changed, 1 insertion(+) (limited to 'package.json') diff --git a/package.json b/package.json index 4c283bfa8..a431e2458 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "phantomjs": "1.9.17" }, "scripts": { + "postinstall": "if [ ! -d .venv ]; then tox -epy27 --notest; fi", "test": "karma start horizon/karma.conf.js --single-run && karma start openstack_dashboard/karma.conf.js --single-run" }, "dependencies": {} -- cgit v1.2.1