From 661efe44446fef7d0008fa23c24227b6f1d885e5 Mon Sep 17 00:00:00 2001 From: Pranav Gore Date: Wed, 13 Dec 2017 21:02:24 +0530 Subject: [PATCH 01/11] keep only relative stuff in jenkinsfile. abstract build steps from jenkins. --- deploy/release.groovy | 18 ++++-------------- package.json | 6 +++++- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/deploy/release.groovy b/deploy/release.groovy index 8eb6c14b1..1fee46570 100644 --- a/deploy/release.groovy +++ b/deploy/release.groovy @@ -2,29 +2,19 @@ def ci (){ stage('build planner npm'){ container('ui'){ - sh 'npm install' - sh 'npm run build' - sh 'npm pack dist/' + sh 'npm run build-planner' } } stage('unit test'){ container('ui'){ - sh 'npm run test:unit' + sh 'npm run unit-test' } } stage('func test'){ - dir('runtime'){ - container('ui'){ - sh ''' - /usr/bin/Xvfb :99 -screen 0 1440x900x24 & - export API_URL=https://api.prod-preview.openshift.io/api/ - export NODE_ENV=inmemory - npm install - ./tests/run_functional_tests.sh smokeTest -''' - } + container('ui'){ + sh 'npm run func-test' } } } diff --git a/package.json b/package.json index 5b8ef850c..3b002fa13 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,11 @@ "clean:all": "gulp clean:all", "reinstall": "rimraf node_modules && npm --force cache clean && npm install", "test:unit": "gulp test:unit", - "semantic-release": "semantic-release pre && gulp build && cp -r .git dist && npm publish dist/ && semantic-release post" + "semantic-release": "semantic-release pre && gulp build && cp -r .git dist && npm publish dist/ && semantic-release post", + "build-planner": "npm run install && npm run build && npm pack dist/", + "unit-test": "npm run test:unit", + "setupFuncTestEnv": "cd runtime && /usr/bin/Xvfb :99 -screen 0 1440x900x24 & && export API_URL=https://api.prod-preview.openshift.io/api/ && export NODE_ENV=inmemory && npm install", + "func-test": "npm run -s setupFuncTestEnv && ./tests/run_functional_tests.sh smokeTest" }, "license": "Apache-2.0", "contributors": [ From 67f116f61c5da64c1087cb79e45f6ecc2ad627e7 Mon Sep 17 00:00:00 2001 From: Pranav Gore Date: Wed, 13 Dec 2017 21:05:08 +0530 Subject: [PATCH 02/11] fix npm install command --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b002fa13..2240f9b71 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "reinstall": "rimraf node_modules && npm --force cache clean && npm install", "test:unit": "gulp test:unit", "semantic-release": "semantic-release pre && gulp build && cp -r .git dist && npm publish dist/ && semantic-release post", - "build-planner": "npm run install && npm run build && npm pack dist/", + "build-planner": "npm install && npm run build && npm pack dist/", "unit-test": "npm run test:unit", "setupFuncTestEnv": "cd runtime && /usr/bin/Xvfb :99 -screen 0 1440x900x24 & && export API_URL=https://api.prod-preview.openshift.io/api/ && export NODE_ENV=inmemory && npm install", "func-test": "npm run -s setupFuncTestEnv && ./tests/run_functional_tests.sh smokeTest" From b70361f061dad25e4bced38f909aaf577489c22c Mon Sep 17 00:00:00 2001 From: Pranav Gore Date: Wed, 13 Dec 2017 21:13:54 +0530 Subject: [PATCH 03/11] reorder commands --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2240f9b71..179d0568d 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "semantic-release": "semantic-release pre && gulp build && cp -r .git dist && npm publish dist/ && semantic-release post", "build-planner": "npm install && npm run build && npm pack dist/", "unit-test": "npm run test:unit", - "setupFuncTestEnv": "cd runtime && /usr/bin/Xvfb :99 -screen 0 1440x900x24 & && export API_URL=https://api.prod-preview.openshift.io/api/ && export NODE_ENV=inmemory && npm install", - "func-test": "npm run -s setupFuncTestEnv && ./tests/run_functional_tests.sh smokeTest" + "setupFuncTestEnv": "/usr/bin/Xvfb :99 -screen 0 1440x900x24 &", + "func-test": "npm run -s setupFuncTestEnv && cd runtime && export API_URL=https://api.prod-preview.openshift.io/api/ && export NODE_ENV=inmemory && npm install && ./tests/run_functional_tests.sh smokeTest" }, "license": "Apache-2.0", "contributors": [ From 9cdd2ede708367700cf47a318bfd9b07fad2fcda Mon Sep 17 00:00:00 2001 From: Pranav Gore Date: Thu, 14 Dec 2017 09:08:28 +0530 Subject: [PATCH 04/11] no need to export API_URL and func tests are always in "inmemory" mode so no need to export that as well. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 179d0568d..b1c6a2d42 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "build-planner": "npm install && npm run build && npm pack dist/", "unit-test": "npm run test:unit", "setupFuncTestEnv": "/usr/bin/Xvfb :99 -screen 0 1440x900x24 &", - "func-test": "npm run -s setupFuncTestEnv && cd runtime && export API_URL=https://api.prod-preview.openshift.io/api/ && export NODE_ENV=inmemory && npm install && ./tests/run_functional_tests.sh smokeTest" + "func-test": "npm run -s setupFuncTestEnv && cd runtime && npm install && ./tests/run_functional_tests.sh smokeTest" }, "license": "Apache-2.0", "contributors": [ From ed271ffc6a7fa84877e67beb70df68b9ae9d1ba4 Mon Sep 17 00:00:00 2001 From: Pranav Gore Date: Thu, 14 Dec 2017 10:47:05 +0530 Subject: [PATCH 05/11] introduce an error to make fabric8-ui build fail --- package.json | 1 + src/app/components/planner-list/planner-list.module.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/package.json b/package.json index b1c6a2d42..05a6a103e 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "ngx-widgets": "^2.3.2", "patternfly-ng": "^0.13.5", "reflect-metadata": "^0.1.10", + "rh-ngx-datatable": "^11.1.11", "rxjs": "^5.0.1", "zone.js": "^0.8.18" }, diff --git a/src/app/components/planner-list/planner-list.module.ts b/src/app/components/planner-list/planner-list.module.ts index 00b7d1e6a..9d2dc5efc 100644 --- a/src/app/components/planner-list/planner-list.module.ts +++ b/src/app/components/planner-list/planner-list.module.ts @@ -20,6 +20,7 @@ import { WidgetsModule } from 'ngx-widgets'; +import { NgxDatatableModule } from '../../../../node_modules/rh-ngx-datatable'; import { ActionModule, ListModule } from 'patternfly-ng'; import { Logger } from 'ngx-base'; import { AuthenticationService } from 'ngx-login-client'; From 38570bf595fd3f5f619da5707270dd4f62d02908 Mon Sep 17 00:00:00 2001 From: Pranav Gore Date: Thu, 14 Dec 2017 11:41:46 +0530 Subject: [PATCH 06/11] keep '/usr/bin/Xvfb :99 -screen 0 1440x900x24 &` in Jenkinsfile. --- deploy/release.groovy | 5 ++++- package.json | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/deploy/release.groovy b/deploy/release.groovy index 1fee46570..7e48c3edc 100644 --- a/deploy/release.groovy +++ b/deploy/release.groovy @@ -14,7 +14,10 @@ def ci (){ stage('func test'){ container('ui'){ - sh 'npm run func-test' + sh ''' + /usr/bin/Xvfb :99 -screen 0 1440x900x24 & + npm run func-test + ''' } } } diff --git a/package.json b/package.json index 05a6a103e..a450b1d4b 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,7 @@ "semantic-release": "semantic-release pre && gulp build && cp -r .git dist && npm publish dist/ && semantic-release post", "build-planner": "npm install && npm run build && npm pack dist/", "unit-test": "npm run test:unit", - "setupFuncTestEnv": "/usr/bin/Xvfb :99 -screen 0 1440x900x24 &", - "func-test": "npm run -s setupFuncTestEnv && cd runtime && npm install && ./tests/run_functional_tests.sh smokeTest" + "func-test": "cd runtime && npm install && ./tests/run_functional_tests.sh smokeTest" }, "license": "Apache-2.0", "contributors": [ From 6d08bc951f37816250c2276f0e9154f6f7d09b0f Mon Sep 17 00:00:00 2001 From: Pranav Gore Date: Thu, 14 Dec 2017 15:28:12 +0530 Subject: [PATCH 07/11] Keep func-tests in jenkins for now. --- deploy/release.groovy | 14 +++++++++----- package.json | 5 ++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/deploy/release.groovy b/deploy/release.groovy index 7e48c3edc..9f11a6fc4 100644 --- a/deploy/release.groovy +++ b/deploy/release.groovy @@ -13,12 +13,16 @@ def ci (){ } stage('func test'){ - container('ui'){ - sh ''' - /usr/bin/Xvfb :99 -screen 0 1440x900x24 & - npm run func-test + dir('runtime'){ + container('ui'){ + sh ''' + /usr/bin/Xvfb :99 -screen 0 1440x900x24 & + export API_URL=https://api.prod-preview.openshift.io/api/ + export NODE_ENV=inmemory + npm install + ./tests/run_functional_tests.sh smokeTest ''' - } + } } } diff --git a/package.json b/package.json index a450b1d4b..daab3bad0 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,8 @@ "reinstall": "rimraf node_modules && npm --force cache clean && npm install", "test:unit": "gulp test:unit", "semantic-release": "semantic-release pre && gulp build && cp -r .git dist && npm publish dist/ && semantic-release post", - "build-planner": "npm install && npm run build && npm pack dist/", - "unit-test": "npm run test:unit", - "func-test": "cd runtime && npm install && ./tests/run_functional_tests.sh smokeTest" + "build-planner": "npm cache clean && npm install && npm run build && npm pack dist/", + "unit-test": "npm run test:unit" }, "license": "Apache-2.0", "contributors": [ From e422ac3c4356c245b7b54b125afd6da53c6e363b Mon Sep 17 00:00:00 2001 From: Pranav Gore Date: Thu, 14 Dec 2017 15:40:04 +0530 Subject: [PATCH 08/11] format groovy --- deploy/release.groovy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deploy/release.groovy b/deploy/release.groovy index 9f11a6fc4..b3002a46f 100644 --- a/deploy/release.groovy +++ b/deploy/release.groovy @@ -16,12 +16,12 @@ def ci (){ dir('runtime'){ container('ui'){ sh ''' - /usr/bin/Xvfb :99 -screen 0 1440x900x24 & - export API_URL=https://api.prod-preview.openshift.io/api/ - export NODE_ENV=inmemory - npm install - ./tests/run_functional_tests.sh smokeTest - ''' + /usr/bin/Xvfb :99 -screen 0 1440x900x24 & + export API_URL=https://api.prod-preview.openshift.io/api/ + export NODE_ENV=inmemory + npm install + ./tests/run_functional_tests.sh smokeTest +''' } } } From 1e5d6ac1f60779cd7d739282ec553e700000c78f Mon Sep 17 00:00:00 2001 From: Pranav Gore Date: Thu, 14 Dec 2017 15:40:59 +0530 Subject: [PATCH 09/11] missing closing bracket --- deploy/release.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/release.groovy b/deploy/release.groovy index b3002a46f..52684b693 100644 --- a/deploy/release.groovy +++ b/deploy/release.groovy @@ -23,6 +23,7 @@ def ci (){ ./tests/run_functional_tests.sh smokeTest ''' } + } } } From 6dcbaa6c8aab2da8f24b2c7b1312e553f1fc85b2 Mon Sep 17 00:00:00 2001 From: Pranav Gore Date: Thu, 14 Dec 2017 15:43:14 +0530 Subject: [PATCH 10/11] facing error for cache clean - npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. npm ERR! npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index daab3bad0..3e797bd51 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "reinstall": "rimraf node_modules && npm --force cache clean && npm install", "test:unit": "gulp test:unit", "semantic-release": "semantic-release pre && gulp build && cp -r .git dist && npm publish dist/ && semantic-release post", - "build-planner": "npm cache clean && npm install && npm run build && npm pack dist/", + "build-planner": "npm install && npm run build && npm pack dist/", "unit-test": "npm run test:unit" }, "license": "Apache-2.0", From 2613e6b2412414b59d63ac0582756c0c298b2c6c Mon Sep 17 00:00:00 2001 From: Pranav Gore Date: Thu, 14 Dec 2017 18:28:56 +0530 Subject: [PATCH 11/11] remove new module --- package.json | 1 - src/app/components/planner-list/planner-list.module.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/package.json b/package.json index 3e797bd51..157118cb8 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,6 @@ "ngx-widgets": "^2.3.2", "patternfly-ng": "^0.13.5", "reflect-metadata": "^0.1.10", - "rh-ngx-datatable": "^11.1.11", "rxjs": "^5.0.1", "zone.js": "^0.8.18" }, diff --git a/src/app/components/planner-list/planner-list.module.ts b/src/app/components/planner-list/planner-list.module.ts index 9d2dc5efc..00b7d1e6a 100644 --- a/src/app/components/planner-list/planner-list.module.ts +++ b/src/app/components/planner-list/planner-list.module.ts @@ -20,7 +20,6 @@ import { WidgetsModule } from 'ngx-widgets'; -import { NgxDatatableModule } from '../../../../node_modules/rh-ngx-datatable'; import { ActionModule, ListModule } from 'patternfly-ng'; import { Logger } from 'ngx-base'; import { AuthenticationService } from 'ngx-login-client';