This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit a8dcba79 authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Optimize Sonar Integration

parent 57659b41
Branches
Tags
1 merge request!17Initial Merge to Prepare Release 1.0.0
...@@ -10,6 +10,7 @@ pipeline { ...@@ -10,6 +10,7 @@ pipeline {
// Install the Maven version configured as "M3" and add it to the path. // Install the Maven version configured as "M3" and add it to the path.
maven "/usr/share/maven" maven "/usr/share/maven"
jdk "java-11" jdk "java-11"
nodejs "Node15.11"
} }
stages { stages {
stage('Compile and Test') { stage('Compile and Test') {
...@@ -25,13 +26,19 @@ pipeline { ...@@ -25,13 +26,19 @@ pipeline {
milestone 2 milestone 2
junit(testResults: 'target/test-results/test/**/*.xml', healthScaleFactor: 100) junit(testResults: 'target/test-results/test/**/*.xml', healthScaleFactor: 100)
jacoco(execPattern: 'target/jacoco/test.exec', sourcePattern: 'src/main/java', sourceInclusionPattern: '**/*.java') jacoco(execPattern: 'target/jacoco/test.exec', sourcePattern: 'src/main/java', sourceInclusionPattern: '**/*.java')
sh "npm test"
withSonarQubeEnv('SonarQube Production') { sh "mvn jacoco:report"
sh "mvn -Dsonar.projectName=GitSearch -Dsonar.projectKey=GITSEARCH -Dsonar.coverage.jacoco.xmlReportPaths=target/jacoco/test/jacoco.xml jacoco:report sonar:sonar"
}
} }
} }
stage('SonarAnalysis') {
steps {
milestone 3
def scannerHome = tool 'SonarQube Scanner';
withSonarQubeEnv('SonarQube Production') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
} }
post { post {
......
...@@ -139,5 +139,8 @@ ...@@ -139,5 +139,8 @@
"jestSonar": { "jestSonar": {
"reportPath": "target/test-results/jest", "reportPath": "target/test-results/jest",
"reportFile": "TESTS-results-sonar.xml" "reportFile": "TESTS-results-sonar.xml"
} },
"jest": {
"testResultsProcessor": "jest-sonar-reporter"
}
} }
sonar.projectKey=gitsearch sonar.projectKey=GITSEARCH
sonar.projectName=gitsearch generated by jhipster sonar.projectName=gitsearch generated by jhipster
sonar.projectVersion=1.0 sonar.projectVersion=1.0
......
...@@ -48,7 +48,7 @@ public class SearchService { ...@@ -48,7 +48,7 @@ public class SearchService {
protected PluginManagementService pluginManagementService; protected PluginManagementService pluginManagementService;
/** just for test implementation **/ /** just for test implementation **/
public static int NUM_TESTRESULTS = 23; public static final int NUM_TESTRESULTS = 23;
public SearchService() { public SearchService() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment