Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

WIP : refactor jenkinsfile with new npm targets #2364

Closed
wants to merge 12 commits into from
18 changes: 4 additions & 14 deletions deploy/release.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You haven't changed anything but making it more opaque. I do NOT think this is good.

}
}

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'
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want to export API_URL and use inmemory mode at the same time?
When we set NODE_ENV=inmemory mode, planner uses the mock services. It will ignore the API_URL.
Also, run_functional_tests script always sets NODE_ENV=inmemory mode and then starts the planner. You could write this line as
npm run -s setupFuncTestEnv && cd runtime && npm install && ./tests/run_functional_tests.sh smokeTest

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jarifibrahim thanks! now, this is what exactly I am trying to find out.
I am just extracting contents from release.groovy to npm targets. It was mentioned here in https://github.com/fabric8-ui/fabric8-planner/blob/master/deploy/release.groovy#L20
can you please confirm we do not need it this way?
And I am trying your suggestion, let's see.

},
"license": "Apache-2.0",
"contributors": [
Expand Down