Permalink
Browse files

optimize jenkins tests, add sonarcloud (#16)

* add sonarcloud & jacoco coverage

* split unit and integrated tests, add sonarcloud to jenkins
  • Loading branch information...
Danconnolly committed Jan 29, 2018
1 parent 98f6252 commit 0a6c3fc6fb400287386221ba951813145e6a2c5e
Showing with 41 additions and 1 deletion.
  1. +8 −0 core/pom.xml
  2. +30 −1 jenkins/Jenkinsfile
  3. +3 −0 pom.xml
View
@@ -50,6 +50,10 @@
</developer>
</developers>
<properties>
<sonar.exclusions>**/*Protos.java,**/ClientState.java,**/ServerState.java</sonar.exclusions>
</properties>
<profiles>
<profile>
<id>dev</id> <!-- default profile -->
@@ -66,6 +70,7 @@
<!-- exclude postgres and mysql tests, these need environment setup -->
<exclude>**/PostgresFullPrunedBlockChainIT.java</exclude>
<exclude>**/MySQLFullPrunedBlockChainIT.java</exclude>
<skipTests>${skipIntegrationTests}</skipTests>
</excludes>
</configuration>
</plugin>
@@ -124,6 +129,7 @@
<exclude>**/core/PeerTest.java</exclude>
<exclude>**/core/TransactionBroadcastTest.java</exclude>
</excludes>
<skipTests>${skipUnitTests}</skipTests>
</configuration>
</plugin>
<plugin>
@@ -351,6 +357,7 @@
<configuration>
<argLine>-Xmx2048m ${surefireArgLine}</argLine><!-- Last argument is required for code coverage to work. -->
<runOrder>alphabetical</runOrder>
<skipTests>${skipUnitTests}</skipTests>
</configuration>
</plugin>
@@ -361,6 +368,7 @@
<configuration>
<runOrder>alphabetical</runOrder>
<argLine>${failsafeArgLine}</argLine>
<skipTests>${skipIntegrationTests}</skipTests>
</configuration>
<executions>
<execution>
View
@@ -16,7 +16,8 @@
// Jenkins integration tests for BitcoinJ Cash
// tested with Jenkins v2.89.3
// required plugins: ansiColor
// required plugins: ansiColor, jaCoCo
// for central jenkins, also need SonarQube scanner plugin
pipeline {
agent {
@@ -53,6 +54,13 @@ pipeline {
}
}
/*
*
* various integration tests
*
*/
// test syncing with testnet
stage('test testnet sync') {
steps {
@@ -70,11 +78,32 @@ pipeline {
}
}
}
/*
*
* other reporting & analysis
*
*/
// perform SonarQube, but only for main dev branch and main repo
stage('SonarQube analysis') {
when {
branch 'cash'
environment name: 'GIT_URL', value: 'https://github.com/bitcoinj-cash/bitcoinj.git'
}
steps {
withSonarQubeEnv('SonarCloud') {
sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar -Dsonar.organization=bitcoinj-cash'
}
}
}
}
post {
always {
junit '**/target/*-reports/*.xml'
jacoco(execPattern: '**/target/jacoco.exec')
}
success {
archive '**/target/*.jar'
View
@@ -59,6 +59,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<generated.sourceDirectory>gen</generated.sourceDirectory>
<slf4j.version>1.7.25</slf4j.version>
<skipTests>false</skipTests>
<skipUnitTests>${skipTests}</skipUnitTests>
<skipIntegrationTests>${skipTests}</skipIntegrationTests>
</properties>

0 comments on commit 0a6c3fc

Please sign in to comment.