From 2cdd02dc4d409e496d742f90a1ee34744ef5c164 Mon Sep 17 00:00:00 2001 From: Matteo Perelli Date: Tue, 31 Jan 2017 14:50:11 +0100 Subject: [PATCH 1/3] 'pree2e' and 'ci' scripts added --- README.md | 8 +++++++- package.json | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dd4fa20b90..9dab50fa11 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,8 @@ E2E tests use Protractor + Selenium server + browsers. You can find the configur `./protractor.conf.js` Protractor is installed as 'local' as a dev dependency. If you are going to execute tests locally you need to run (once time only): -`npm run webdriver:update`. +`npm run webdriver:update` +(for your convenience this command is now auto runned each time 'e2e' command is called). If you are going to use a remote test enviroment you need to edit the './protractor.conf.js'. Follow the instructions you will find inside it. @@ -141,6 +142,11 @@ Place your tests at the following path: and run: `npm run e2e` +### Continuous Integration (CI) Test +To run all the tests (e.g.: to run tests with Continuous Integration software) you can execute: +`npm run ci` +Keep in mind that this command prerequisites are the sum of unit test and E2E tests. + ## Other commands There are many more commands in the `scripts` section of `package.json`. Most of these are executed by one of the commands mentioned above. diff --git a/package.json b/package.json index 80e4c9c8d9..5d2c580299 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,9 @@ "docs": "typedoc --options typedoc.json ./src", "lint": "tslint \"src/**/*.ts\" || true", "global": "npm install -g angular-cli nodemon npm-check-updates rimraf ts-node typedoc typescript webpack webpack-bundle-size-analyzer rollup marked node-gyp", + "ci": "npm run lint && npm run test && npm run e2e", "protractor": "node node_modules/protractor/bin/protractor", + "pree2e": "npm run webdriver:update", "e2e": "npm run protractor", "test": "karma start --single-run", "test:watch": "karma start --no-single-run --auto-watch", From 5c17f5a3aa31e1b3aa85b5d849faa79053ee295f Mon Sep 17 00:00:00 2001 From: Matteo Perelli Date: Tue, 21 Feb 2017 16:25:19 +0100 Subject: [PATCH 2/3] CI script updated --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5d2c580299..5a906cca87 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "clean:prod": "npm run clean:ngc && npm run clean:json && npm run clean:css && npm run clean:css:ts && npm run clean:scss:ts && npm run clean:css:shim:ts && npm run clean:scss:shim:ts && npm run clean:dist", "clean": "npm run clean:log && npm run clean:prod && npm run clean:coverage && npm run clean:node", "sass": "node-sass src -o src --include-path node_modules --output-style compressed -q", - "postcss": "node_modules/postcss-cli/bin/postcss -c postcss.config.json", + "postcss": "node node_modules/postcss-cli/bin/postcss -c postcss.config.json", "style": "npm run sass && npm run postcss", "style:watch": "nodemon -e scss -w src -x \"npm run style\"", "rollup": "rollup -c rollup-server.js && rollup -c rollup-client.js", @@ -53,7 +53,7 @@ "docs": "typedoc --options typedoc.json ./src", "lint": "tslint \"src/**/*.ts\" || true", "global": "npm install -g angular-cli nodemon npm-check-updates rimraf ts-node typedoc typescript webpack webpack-bundle-size-analyzer rollup marked node-gyp", - "ci": "npm run lint && npm run test && npm run e2e", + "ci": "npm run lint && npm run build:prod:ngc:json && npm run test && npm-run-all -p -r server e2e", "protractor": "node node_modules/protractor/bin/protractor", "pree2e": "npm run webdriver:update", "e2e": "npm run protractor", @@ -150,6 +150,7 @@ "karma-webpack": "1.8.0", "node-sass": "4.0.0", "nodemon": "1.11.0", + "npm-run-all": "^4.0.1", "postcss-cli": "^2.6.0", "protractor": "~4.0.14", "protractor-istanbul-plugin": "~2.0.0", From bbb4ca197ff09662003d63ae7b078cdedf21b277 Mon Sep 17 00:00:00 2001 From: Matteo Perelli Date: Mon, 13 Mar 2017 10:03:22 +0100 Subject: [PATCH 3/3] Concurrently replaced with npm-run-all --- package.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 40dd81144d..8711980df1 100644 --- a/package.json +++ b/package.json @@ -41,9 +41,9 @@ "start": "npm run server", "start:dev": "npm run clean:prod && npm run build && npm run server:dev", "watch": "webpack -w & npm run style:watch", - "watch:dev:server": "concurrently \"npm run server:dev:watch\" \"npm run watch\"", + "watch:dev:server": "npm-run-all -p server:dev:watch watch", "watch:dev": "npm run clean:prod && npm run build && npm run watch:dev:server", - "watch:prod:server": "concurrently \"npm run server\" \"npm run watch\"", + "watch:prod:server": "npm-run-all -p server watch", "watch:prod": "npm run build:prod:ngc:json && npm run watch:prod:server", "predebug": "npm run build", "debug": "node --debug-brk dist/server/index.js", @@ -130,7 +130,6 @@ "autoprefixer": "6.5.4", "awesome-typescript-loader": "2.2.4", "codelyzer": "2.0.0-beta.3", - "concurrently": "3.1.0", "cookie-parser": "1.4.3", "copy-webpack-plugin": "4.0.1", "css-loader": "^0.26.0", @@ -154,7 +153,7 @@ "karma-webpack": "1.8.0", "node-sass": "4.0.0", "nodemon": "1.11.0", - "npm-run-all": "^4.0.1", + "npm-run-all": "4.0.2", "postcss-cli": "^2.6.0", "protractor": "~4.0.14", "protractor-istanbul-plugin": "~2.0.0",