Merge "[FAB-16147] Compilation and Lint Checks" into release-1.4

This commit is contained in:
Simon Stone 2019-08-02 09:31:08 +00:00 committed by Gerrit Code Review
commit d26e27e0d1
13 changed files with 9617 additions and 47 deletions

21
Jenkinsfile vendored
View file

@ -136,6 +136,27 @@
} }
} }
} }
// Run Commercial Paper tests
stage('Run Commercial Paper Tests') {
steps {
script {
// making the output color coded
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) {
try {
dir("$ROOTDIR/$BASE_DIR/scripts/ci_scripts") {
// Run fabcar tests
sh './ciScript.sh --commercialpaper_Tests'
}
}
catch (err) {
failure_stage = "commercialpaper_Tests"
currentBuild.result = 'FAILURE'
throw err
}
}
}
}
}
} // stages } // stages
post { post {
always { always {

View file

@ -0,0 +1,4 @@
bin/
.classpath
.settings/
.gradle

View file

@ -0,0 +1,17 @@
.PHONY: all
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
all: digibank magnetocorp
digibank:
cd ${ROOT_DIR}/../organization/$@/application-java; mvn clean compile package
cd ${ROOT_DIR}/../organization/$@/contract-java; ./gradlew clean build shadowJar
cd ${ROOT_DIR}/../organization/$@/application; npm install && npm run lint
cd ${ROOT_DIR}/../organization/$@/contract; npm install && npm run lint
magnetocorp:
cd ${ROOT_DIR}/../organization/$@/application-java; mvn clean compile package
cd ${ROOT_DIR}/../organization/$@/contract-java; ./gradlew clean build shadowJar
cd ${ROOT_DIR}/../organization/$@/application; npm install && npm run lint
cd ${ROOT_DIR}/../organization/$@/contract; npm install && npm run lint

View file

@ -4,6 +4,7 @@
"description": "", "description": "",
"main": "buy.js", "main": "buy.js",
"scripts": { "scripts": {
"lint": "eslint .",
"test": "rm -rf _idwallet && node addToWallet.js && node buy.js" "test": "rm -rf _idwallet && node addToWallet.js && node buy.js"
}, },
"keywords": [], "keywords": [],

View file

@ -82,7 +82,7 @@ async function main() {
} finally { } finally {
// Disconnect from the gateway // Disconnect from the gateway
console.log('Disconnect from Fabric gateway.') console.log('Disconnect from Fabric gateway.');
gateway.disconnect(); gateway.disconnect();
} }

View file

@ -1,3 +1,5 @@
.gradle/ .gradle/
build/ build/
bin/ bin/
.classpath
.settings/

View file

@ -74,7 +74,7 @@ public class CommercialPaperContract implements ContractInterface {
// create an instance of the paper // create an instance of the paper
CommercialPaper paper = CommercialPaper.createInstance(issuer, paperNumber, issueDateTime, maturityDateTime, CommercialPaper paper = CommercialPaper.createInstance(issuer, paperNumber, issueDateTime, maturityDateTime,
faceValue,""); faceValue,issuer,"");
// Smart contract, rather than paper, moves paper into ISSUED state // Smart contract, rather than paper, moves paper into ISSUED state
paper.setIssued(); paper.setIssued();

View file

@ -0,0 +1 @@
node_modules/

File diff suppressed because it is too large Load diff

View file

@ -4,6 +4,7 @@
"description": "", "description": "",
"main": "issue.js", "main": "issue.js",
"scripts": { "scripts": {
"lint": "eslint .",
"test": "rm -rf _idwallet && node addToWallet.js && node issue.js" "test": "rm -rf _idwallet && node addToWallet.js && node issue.js"
}, },
"keywords": [], "keywords": [],

View file

@ -0,0 +1 @@
node_modules/

File diff suppressed because it is too large Load diff

View file

@ -30,6 +30,9 @@ Parse_Arguments() {
--fabcar_Tests) --fabcar_Tests)
fabcar_Tests fabcar_Tests
;; ;;
--commercialpaper_Tests)
commercialpaper_Tests
;;
--pull_Thirdparty_Images) --pull_Thirdparty_Images)
pull_Thirdparty_Images pull_Thirdparty_Images
;; ;;
@ -139,5 +142,14 @@ fabcar_Tests() {
echo "node version ------> $(node -v)" echo "node version ------> $(node -v)"
echo "-----------> Execute FabCar Tests" echo "-----------> Execute FabCar Tests"
./fabcar.sh ./fabcar.sh
echo "Also running the compilation and lint tests of CommercialPaper"
make -f ../../commercial-paper/.build/makefile
}
# run commercial paper tests
commercialpaper_Tests() {
echo
echo "-----------> Execute Commercial Paper Tests"
make -f ../../commercial-paper/.build/makefile
} }
Parse_Arguments $@ Parse_Arguments $@