Add baseline file for testing
This commit is contained in:
parent
5a2824507f
commit
5526cfdcf4
3 changed files with 11 additions and 2 deletions
4
.github/workflows/bld.yml
vendored
4
.github/workflows/bld.yml
vendored
|
@ -28,9 +28,9 @@ jobs:
|
||||||
working-directory: examples
|
working-directory: examples
|
||||||
run: ./bld download
|
run: ./bld download
|
||||||
|
|
||||||
- name: Run tests [examples]
|
- name: Run Detekt [examples]
|
||||||
working-directory: examples
|
working-directory: examples
|
||||||
run: ./bld compile test
|
run: ./bld compile detekt
|
||||||
|
|
||||||
- name: Download dependencies
|
- name: Download dependencies
|
||||||
run: ./bld download
|
run: ./bld download
|
||||||
|
|
|
@ -264,6 +264,7 @@ class DetektOperationTest {
|
||||||
var op = new DetektOperation()
|
var op = new DetektOperation()
|
||||||
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example",
|
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example",
|
||||||
"example", "Example"))
|
"example", "Example"))
|
||||||
|
.baseline("src/test/resources/detekt-baseline.xml")
|
||||||
.maxIssues(8);
|
.maxIssues(8);
|
||||||
assertThatNoException().isThrownBy(op::execute);
|
assertThatNoException().isThrownBy(op::execute);
|
||||||
}
|
}
|
||||||
|
@ -281,6 +282,7 @@ class DetektOperationTest {
|
||||||
var op = new DetektOperation()
|
var op = new DetektOperation()
|
||||||
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example",
|
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example",
|
||||||
"example", "Example"))
|
"example", "Example"))
|
||||||
|
.baseline("src/test/resources/detekt-baseline.xml")
|
||||||
.report(new Report(ReportId.HTML, html.getAbsolutePath()))
|
.report(new Report(ReportId.HTML, html.getAbsolutePath()))
|
||||||
.report(new Report(ReportId.XML, xml.getAbsolutePath()))
|
.report(new Report(ReportId.XML, xml.getAbsolutePath()))
|
||||||
.report(new Report(ReportId.TXT, txt.getAbsolutePath()))
|
.report(new Report(ReportId.TXT, txt.getAbsolutePath()))
|
||||||
|
@ -299,6 +301,7 @@ class DetektOperationTest {
|
||||||
var op = new DetektOperation()
|
var op = new DetektOperation()
|
||||||
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example",
|
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example",
|
||||||
"example", "Example"))
|
"example", "Example"))
|
||||||
|
.baseline("src/test/resources/detekt-baseline.xml")
|
||||||
.debug(true);
|
.debug(true);
|
||||||
assertThatThrownBy(op::execute).isInstanceOf(ExitStatusException.class);
|
assertThatThrownBy(op::execute).isInstanceOf(ExitStatusException.class);
|
||||||
}
|
}
|
||||||
|
|
6
src/test/resources/detekt-baseline.xml
Normal file
6
src/test/resources/detekt-baseline.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" ?>
|
||||||
|
<SmellBaseline>
|
||||||
|
<ManuallySuppressedIssues/>
|
||||||
|
<CurrentIssues>
|
||||||
|
</CurrentIssues>
|
||||||
|
</SmellBaseline>
|
Loading…
Add table
Add a link
Reference in a new issue