3
3
4
4
stage ('Checkout') {
5
5
git branch:'master', url: 'https://github.com/uhafner/codingstyle.git', credentialsId: 'github-app'
6
+ }
6
7
8
+ stage ('Git mining') {
9
+ discoverGitReferenceBuild()
10
+ mineRepository()
7
11
}
8
12
9
- stage ('Build and Static Analysis') {
13
+ stage ('Build, Test and Static Analysis') {
10
14
withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
11
15
sh 'mvn -ntp -V -e clean verify -Dmaven.test.failure.ignore -Dgpg.skip'
12
16
}
15
19
recordIssues tool: errorProne(), healthy: 1, unhealthy: 20
16
20
17
21
junit testResults: '**/target/*-reports/TEST-*.xml'
22
+ recordCoverage tools: [[parser: 'JACOCO']], sourceCodeRetention: 'EVERY_BUILD'
18
23
19
24
recordIssues tools: [checkStyle(pattern: 'target/checkstyle-result.xml'),
20
25
spotBugs(pattern: 'target/spotbugsXml.xml'),
@@ -24,25 +29,39 @@ node {
24
29
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
25
30
}
26
31
27
- stage ('Line and Branch Coverage') {
28
- withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
29
- sh "mvn -ntp -V -U -e jacoco:prepare-agent test jacoco:report -Dmaven.test.failure.ignore"
30
- }
31
- publishCoverage adapters: [jacocoAdapter('**/*/jacoco.xml')], sourceFileResolver: sourceFiles('STORE_ALL_BUILD')
32
- }
33
-
34
32
stage ('Mutation Coverage') {
35
33
withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
36
34
sh "mvn -ntp org.pitest:pitest-maven:mutationCoverage"
37
35
}
38
- step([$class : 'PitPublisher', mutationStatsFile : 'target/pit-reports/**/mutations.xml'])
36
+ recordCoverage tools: [[parser : 'PIT']], sourceCodeRetention : 'EVERY_BUILD'
39
37
}
40
38
41
39
stage ('Collect Maven Warnings') {
42
40
recordIssues tool: mavenConsole()
43
41
}
44
42
45
43
stage ('Autograding') {
46
- autoGrade('{"analysis":{"maxScore":100,"weightError":-10,"weightHigh":-5,"weightNormal":-2,"weightLow":-1}, "tests":{"maxScore":100,"weightPassed":1,"weightFailures":-5,"weightSkipped":-1}, "coverage":{"maxScore":100,"weightCovered":1,"weightMissed":-1}, "pit":{"maxScore":100,"weightDetected":1,"weightUndetected":-1}}')
44
+ autoGrade('''
45
+ {
46
+ "analysis": {
47
+ "maxScore": 100,
48
+ "errorImpact": -5,
49
+ "highImpact": -2,
50
+ "normalImpact": -1,
51
+ "lowImpact": -1
52
+ },
53
+ "tests": {
54
+ "maxScore": 100,
55
+ "passedImpact": 0,
56
+ "failureImpact": -5,
57
+ "skippedImpact": -1
58
+ },
59
+ "coverage": {
60
+ "maxScore": 100,
61
+ "coveredPercentageImpact": 0,
62
+ "missedPercentageImpact": -1
63
+ }
64
+ }
65
+ ''')
47
66
}
48
67
}
0 commit comments