Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge branch '1.0.0' into 456-unit-test-for-signature-transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Usman authored Oct 2, 2017
2 parents 30a5d6d + c00e33a commit a1ede26
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 18 deletions.
8 changes: 7 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,16 @@ module.exports = function (grunt) {
maxBuffer: maxBufferSize
},

coverageSingleExtensive: {
command: 'export NODE_ENV=TEST && node_modules/.bin/istanbul cover --dir test/.coverage-unit --include-pid ./node_modules/.bin/_mocha $TEST',
maxBuffer: maxBufferSize
},

coverageUnit: {
command: 'node_modules/.bin/istanbul cover --dir test/.coverage-unit ./node_modules/.bin/_mocha test/unit/index.js',
maxBuffer: maxBufferSize
},

coverageUnitSlow: {
command: 'node_modules/.bin/istanbul cover --dir test/.coverage-unit ./node_modules/.bin/_mocha test/unit/index.slow.js',
maxBuffer: maxBufferSize
Expand Down Expand Up @@ -153,6 +158,7 @@ module.exports = function (grunt) {
grunt.registerTask('default', ['release']);
grunt.registerTask('release', ['exec:folder', 'obfuscator', 'exec:createBundles', 'exec:package', 'exec:build', 'compress']);
grunt.registerTask('jenkins', ['exec:coverageSingle']);
grunt.registerTask('jenkins-extensive', ['exec:coverageSingleExtensive']);
grunt.registerTask('coverageReport', ['exec:coverageReport']);
grunt.registerTask('eslint-nofix', ['eslint']);
grunt.registerTask('test', ['eslint', 'exec:coverage']);
Expand Down
41 changes: 24 additions & 17 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ def report(){
}

lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {

properties([
parameters([
string(name: 'JENKINS_PROFILE', defaultValue: 'jenkins', description: 'To build cache dependencies and run slow test, change this value to jenkins-extensive.', )
])
])

stage ('Prepare Workspace') {
parallel(
"Build cached dependencies" : {
Expand Down Expand Up @@ -168,7 +175,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/http/get/accounts.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -177,7 +184,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/http/get/blocks.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -186,7 +193,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/http/get/dapps.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -195,7 +202,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/http/get/delegates.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -204,7 +211,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/http/get/loader.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -213,7 +220,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/http/get/multisignatures.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -222,7 +229,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/http/get/multisignatures.post.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -231,7 +238,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/http/get/transactions.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -240,7 +247,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/http/get/peers.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
}, // End node-01 functional tests
Expand All @@ -249,7 +256,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/ws/transport.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -258,7 +265,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/ws/transport.blocks.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -267,7 +274,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/ws/transport.client.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -276,7 +283,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/ws/transport.handshake.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -285,7 +292,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/ws/transport.transactions.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
}, // End Node-02 Tests
Expand All @@ -303,7 +310,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/unit/sql/blockRewards.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},
Expand All @@ -312,7 +319,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/unit/logic/blockReward.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
},// End Node-03 unit tests
Expand All @@ -321,7 +328,7 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
sh '''
export TEST=test/functional/ws/transport.transactions.stress.js TEST_TYPE='FUNC' NODE_ENV='TEST'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
npm run $JENKINS_PROFILE
'''
}
} // End Node-04
Expand Down
5 changes: 5 additions & 0 deletions Jenkinsfile.extensive
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node {
stage('Build extensive testsuite') {
build job: "lisk-core/${env.BRANCH_NAME}", parameters: [string(name: 'JENKINS_PROFILE', value: 'jenkins-extensive')]
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"start": "node app.js",
"jenkins": "./node_modules/.bin/grunt jenkins --verbose",
"jenkins-extensive": "./node_modules/.bin/grunt jenkins-extensive --verbose",
"eslint": "./node_modules/.bin/grunt eslint-nofix --verbose",
"fetchCoverage": "./node_modules/.bin/grunt exec:fetchCoverage --verbose",
"coverageReport": "./node_modules/.bin/grunt coverageReport --verbose",
Expand Down

0 comments on commit a1ede26

Please sign in to comment.