AMBARI-7549. Modify pom.xml for ambari-web so that it runs unit tests upon running "mvn test".(jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0f7dcba1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0f7dcba1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0f7dcba1 Branch: refs/heads/branch-alerts-dev Commit: 0f7dcba1165d2bd7de4ae01b92947746fcb9eebc Parents: e9f2b4a Author: Jaimin Jetly <[email protected]> Authored: Thu Oct 2 11:04:39 2014 -0700 Committer: Jaimin Jetly <[email protected]> Committed: Thu Oct 2 11:04:39 2014 -0700 ---------------------------------------------------------------------- ambari-web/package.json | 47 +++++++++++++++++++++++--------------------- ambari-web/pom.xml | 28 ++++++++++++-------------- 2 files changed, 38 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0f7dcba1/ambari-web/package.json ---------------------------------------------------------------------- diff --git a/ambari-web/package.json b/ambari-web/package.json index e8098da..be5a225 100644 --- a/ambari-web/package.json +++ b/ambari-web/package.json @@ -1,29 +1,25 @@ { - "name":"Ambari", - "description":"Front-end package for the Apache Ambari Project", - "version":"1.0.0", - "homepage":"", - "repository":{ - "type":"git", - "url":"" + "name": "Ambari", + "description": "Front-end package for the Apache Ambari Project", + "version": "1.7.0", + "homepage": "http://ambari.apache.org/", + "repository": { + "type": "git", + "url": "https://git-wip-us.apache.org/repos/asf/ambari/repo?p=ambari.git;a=summary" }, - "engines":{ - "node":"~0.6.10 || 0.8 || 0.9 || 0.10" + "dependencies": { + "javascript-brunch": ">= 1.0 < 1.5", + "css-brunch": ">= 1.0 < 1.5", + "uglify-js-brunch": ">= 1.0 < 1.5", + "clean-css-brunch": ">= 1.0 < 1.5", + "ember-precompiler-brunch": ">= 1.0 < 1.5", + "less-brunch": ">= 1.0 < 1.5", + "cssstyle": "0.2.3" }, - "scripts":{ - "start":"brunch watch --server" - }, - "dependencies":{ - "javascript-brunch":">= 1.0 < 1.5", - "css-brunch":">= 1.0 < 1.5", - "uglify-js-brunch":">= 1.0 < 1.5", - "clean-css-brunch":">= 1.0 < 1.5", - "ember-precompiler-brunch":">= 1.0 < 1.5", - "less-brunch":">= 1.0 < 1.5", - "cssstyle":"0.2.3" - }, - "devDependencies":{ + "devDependencies": { + "phantomjs": "^1.9.2", "mocha":"1.9.0", + "mocha-phantomjs": "^3.1.6", "chai":"~1.9.0", "sinon":"=1.7.3", "sinon-chai":"~2.5.0", @@ -36,5 +32,12 @@ "karma-coverage": "~0.2.0", "karma-commonjs-require": "~0.0.1", "karma-ember-precompiler-brunch": "~0.0.1" + }, + "scripts": { + "start": "brunch watch --server", + "test": "node_modules/mocha-phantomjs/bin/mocha-phantomjs public/test/test.html" + }, + "engines": { + "node": "~0.6.10 || 0.8 || 0.9 || 0.10" } } http://git-wip-us.apache.org/repos/asf/ambari/blob/0f7dcba1/ambari-web/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-web/pom.xml b/ambari-web/pom.xml index 4501690..65e568d 100644 --- a/ambari-web/pom.xml +++ b/ambari-web/pom.xml @@ -23,7 +23,6 @@ <relativePath>../ambari-project</relativePath> </parent> <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.ambari</groupId> <artifactId>ambari-web</artifactId> <packaging>pom</packaging> <name>Ambari Web</name> @@ -139,12 +138,6 @@ <arg value="${basedir}/toggle-experimental.sh"/> <arg value="${enableExperimental}"/> </exec> - <exec dir="${basedir}" executable="gzip" failonerror="true"> - <arg value="-f"/> - <arg value="public/javascripts/app.js"/> - <arg value="public/javascripts/vendor.js"/> - <arg value="public/stylesheets/app.css"/> - </exec> </target> </configuration> </execution> @@ -155,23 +148,28 @@ <goal>run</goal> </goals> <configuration> - <target name="ambari-web-test"> + <target name="ambari-web unit tests" unless="${skipTests}"> + <exec dir="${basedir}" executable="npm" failonerror="true"> + <env key="PYTHON" value="${basedir}/../ambari-common/src/main/unix/ambari-python-wrap" /> + <arg value="test"/> + </exec> </target> </configuration> </execution> <execution> - <id>package</id> - <phase>package</phase> + <id>gzip amabri-web content</id> + <phase>prepare-package</phase> <goals> <goal>run</goal> </goals> <configuration> <target name="ambari-web-package"> - <!-- - <copy toDir="${project.build.directory}/ambari-server-${project.version}-dist/ambari-server-${project.version}/web/"> - <fileset dir="${basedir}/../ambari-web/public"/> - </copy> - --> + <exec dir="${basedir}" executable="gzip" failonerror="true"> + <arg value="-f"/> + <arg value="public/javascripts/app.js"/> + <arg value="public/javascripts/vendor.js"/> + <arg value="public/stylesheets/app.css"/> + </exec> </target> </configuration> </execution>
