Skip to content

Commit f4d5fc9

Browse files
committed
Don't show fault coverage report if there are no mutantadvice provided
1 parent 8c369b0 commit f4d5fc9

File tree

5 files changed

+34
-76
lines changed

5 files changed

+34
-76
lines changed

dist/index.js

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@
8888
"optionalDependencies": {
8989
"@rollup/rollup-linux-x64-gnu": "*"
9090
}
91-
}
91+
}

pawtograder.schema.json

Lines changed: 14 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
"type": "number"
1313
}
1414
},
15-
"required": [
16-
"minimumMutantsDetected",
17-
"pointsToAward"
18-
],
15+
"required": ["minimumMutantsDetected", "pointsToAward"],
1916
"type": "object"
2017
},
2118
"BuildConfig": {
@@ -34,30 +31,19 @@
3431
"additionalProperties": false,
3532
"properties": {
3633
"policy": {
37-
"enum": [
38-
"fail",
39-
"warn",
40-
"ignore"
41-
],
34+
"enum": ["fail", "warn", "ignore"],
4235
"type": "string"
4336
},
4437
"preset": {
4538
"const": "checkstyle",
4639
"type": "string"
4740
}
4841
},
49-
"required": [
50-
"preset",
51-
"policy"
52-
],
42+
"required": ["preset", "policy"],
5343
"type": "object"
5444
},
5545
"preset": {
56-
"enum": [
57-
"java-gradle",
58-
"python-script",
59-
"none"
60-
],
46+
"enum": ["java-gradle", "python-script", "none"],
6147
"type": "string"
6248
},
6349
"script_info": {
@@ -118,9 +104,7 @@
118104
"$ref": "#/definitions/VenvInfo"
119105
}
120106
},
121-
"required": [
122-
"preset"
123-
],
107+
"required": ["preset"],
124108
"type": "object"
125109
},
126110
"GradedPart": {
@@ -139,10 +123,7 @@
139123
"type": "string"
140124
}
141125
},
142-
"required": [
143-
"name",
144-
"gradedUnits"
145-
],
126+
"required": ["name", "gradedUnits"],
146127
"type": "object"
147128
},
148129
"GradedUnit": {
@@ -168,10 +149,7 @@
168149
"type": "string"
169150
}
170151
},
171-
"required": [
172-
"name",
173-
"path"
174-
],
152+
"required": ["name", "path"],
175153
"type": "object"
176154
},
177155
"MutationTestUnit": {
@@ -193,11 +171,7 @@
193171
"type": "string"
194172
}
195173
},
196-
"required": [
197-
"name",
198-
"locations",
199-
"breakPoints"
200-
],
174+
"required": ["name", "locations", "breakPoints"],
201175
"type": "object"
202176
},
203177
"OverlayPawtograderConfig": {
@@ -233,12 +207,7 @@
233207
"type": "string"
234208
}
235209
},
236-
"required": [
237-
"sourceClass",
238-
"targetClass",
239-
"name",
240-
"prompt"
241-
],
210+
"required": ["sourceClass", "targetClass", "name", "prompt"],
242211
"type": "object"
243212
},
244213
"type": "array"
@@ -259,18 +228,11 @@
259228
"type": "array"
260229
}
261230
},
262-
"required": [
263-
"files",
264-
"testFiles"
265-
],
231+
"required": ["files", "testFiles"],
266232
"type": "object"
267233
}
268234
},
269-
"required": [
270-
"grader",
271-
"build",
272-
"submissionFiles"
273-
],
235+
"required": ["grader", "build", "submissionFiles"],
274236
"type": "object"
275237
},
276238
"PawtograderConfig": {
@@ -305,12 +267,7 @@
305267
]
306268
}
307269
},
308-
"required": [
309-
"name",
310-
"tests",
311-
"points",
312-
"testCount"
313-
],
270+
"required": ["name", "tests", "points", "testCount"],
314271
"type": "object"
315272
},
316273
"ScriptInfo": {
@@ -363,11 +320,8 @@
363320
"type": "string"
364321
}
365322
},
366-
"required": [
367-
"cache_key",
368-
"dir_name"
369-
],
323+
"required": ["cache_key", "dir_name"],
370324
"type": "object"
371325
}
372326
}
373-
}
327+
}

src/grading/graders/OverlayGrader.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,15 @@ export class OverlayGrader extends Grader<OverlayPawtograderConfig> {
587587
studentMutationOutput += `${mutantsNotDetected.join('\n')}`
588588
}
589589
this.logger.log('hidden', studentMutationOutput)
590-
testFeedbacks.push({
591-
name: 'Fault Coverage Report',
592-
output: studentMutationOutput,
593-
output_format: 'markdown',
594-
score: 0,
595-
max_score: 0
596-
})
590+
if (this.config.mutantAdvice) {
591+
testFeedbacks.push({
592+
name: 'Fault Coverage Report',
593+
output: studentMutationOutput,
594+
output_format: 'markdown',
595+
score: 0,
596+
max_score: 0
597+
})
598+
}
597599
}
598600
if (this.config.build.student_tests?.student_impl?.report_branch_coverage) {
599601
const passingTestCount = studentTestResults?.filter(

0 commit comments

Comments
 (0)