Skip to content

Commit

Permalink
Adapt test case: maven parser catches errors now as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Nov 17, 2023
1 parent 2d31c7a commit 5ff87dc
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,21 @@ void shouldRemoveConsoleLogNotesBeforeRemovingColorCodes() {

AnalysisResult result = scheduleSuccessfulBuild(job);

assertThat(result).hasTotalSize(2);
assertThat(result).hasTotalSize(4).hasTotalErrorsSize(2).hasTotalNormalPrioritySize(2);
assertThat(result.getIssues().get(0))
.hasSeverity(Severity.WARNING_NORMAL);
assertThat(result.getIssues().get(1))
.hasDescription(
"<pre><code>Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!</code></pre>")
.hasSeverity(Severity.WARNING_NORMAL);
assertThat(result.getIssues().get(2))
.hasSeverity(Severity.ERROR);
assertThat(result.getIssues().get(2).getDescription())
.contains("Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile");
assertThat(result.getIssues().get(3))
.hasSeverity(Severity.ERROR);
assertThat(result.getIssues().get(3).getDescription())
.contains("Re-run Maven using the -X switch to enable full debug logging.");
}

/** Runs the Clang parser on an output file that contains 1 issue. */
Expand Down Expand Up @@ -823,7 +831,8 @@ void shouldShowWarningsOfGroovyParserWhenScanningConsoleLogWhenThatIsPermitted()
* if the test fails unexpectedly
*/
@Test
void shouldShowWarningsOfGroovyParserWhenScanningConsoleLogWhenThatIsPermittedAndUsingAddParser() throws IOException {
void shouldShowWarningsOfGroovyParserWhenScanningConsoleLogWhenThatIsPermittedAndUsingAddParser()
throws IOException {
WorkflowJob job = createPipeline();
ArrayList<String> stages = new ArrayList<>();
catFileContentsByAddingEchosSteps(stages, "pep8Test.txt");
Expand All @@ -837,8 +846,8 @@ void shouldShowWarningsOfGroovyParserWhenScanningConsoleLogWhenThatIsPermittedAn
String id = "another-groovy-pep8";

configuration.addParser(new GroovyParser(id, "Another Groovy Pep8",
"(.*):(\\d+):(\\d+): (\\D\\d*) (.*)",
toString("groovy/pep8.groovy"), ""));
"(.*):(\\d+):(\\d+): (\\D\\d*) (.*)",
toString("groovy/pep8.groovy"), ""));
testGroovyPep8JobIsSuccessful(job, id);
}

Expand Down

0 comments on commit 5ff87dc

Please sign in to comment.