-
Notifications
You must be signed in to change notification settings - Fork 14
/
Jenkinsfile.autograding
129 lines (120 loc) · 4.44 KB
/
Jenkinsfile.autograding
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
node {
def mvnHome = tool 'mvn-default'
stage ('Checkout') {
checkout scm
}
stage ('Git mining') {
discoverGitReferenceBuild()
mineRepository()
}
stage ('Build, Test and Static Analysis') {
withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
sh 'mvn -ntp -V -e clean verify -Dmaven.test.failure.ignore -Dgpg.skip'
}
recordIssues tools: [java(), javaDoc()], aggregatingResults: 'true', id: 'java', name: 'Java'
recordIssues tool: errorProne(), healthy: 1, unhealthy: 20
junit testResults: '**/target/*-reports/TEST-*.xml'
recordCoverage tools: [[parser: 'JACOCO']], sourceCodeRetention: 'EVERY_BUILD', name: 'Code Coverage'
recordIssues tools: [checkStyle(pattern: 'target/checkstyle-result.xml'),
spotBugs(pattern: 'target/spotbugsXml.xml'),
pmdParser(pattern: 'target/pmd.xml'),
cpd(pattern: 'target/cpd.xml'),
taskScanner(highTags:'FIXME', normalTags:'TODO', includePattern: '**/*.java', excludePattern: 'target/**/*')],
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
}
stage ('Mutation Coverage') {
withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
sh "mvn -ntp org.pitest:pitest-maven:mutationCoverage"
}
recordCoverage tools: [[parser: 'PIT']], id: 'pit', name: 'Mutation Coverage', sourceCodeRetention: 'EVERY_BUILD'
}
stage ('Collect Maven Warnings') {
recordIssues tool: mavenConsole()
}
stage ('Autograding') {
autoGrade('''
{
"tests": {
"tools": [
{
"name": "Tests"
}
],
"name": "JUnit",
"passedImpact": 0,
"skippedImpact": -1,
"failureImpact": -5,
"maxScore": 100
},
"analysis": [
{
"name": "Style",
"id": "style",
"tools": [
{
"id": "checkstyle",
"name": "CheckStyle"
},
{
"id": "pmd",
"name": "PMD"
}
],
"errorImpact": -1,
"highImpact": -1,
"normalImpact": -1,
"lowImpact": -1,
"maxScore": 100
},
{
"name": "Bugs",
"id": "bugs",
"icon": "bug",
"tools": [
{
"id": "spotbugs",
"name": "SpotBugs"
}
],
"errorImpact": -3,
"highImpact": -3,
"normalImpact": -3,
"lowImpact": -3,
"maxScore": 100
}
],
"coverage": [
{
"tools": [
{
"id": "coverage",
"name": "Line Coverage",
"metric": "line"
},
{
"id": "coverage",
"name": "Branch Coverage",
"metric": "branch"
}
],
"name": "Code Coverage",
"maxScore": 100,
"missedPercentageImpact": -1
},
{
"tools": [
{
"id": "pit",
"name": "Mutation Coverage",
"metric": "mutation"
}
],
"name": "Mutation Coverage",
"maxScore": 100,
"missedPercentageImpact": -1
}
]
}
''')
}
}