Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-57365] Fixes false positives for MsBuild #174

Merged
merged 2 commits into from
May 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/jenkinsci/analysis-model/compare/analysis-model-5.0.0...master)

### Fixed
- [JENKINS-57365](https://issues.jenkins-ci.org/browse/JENKINS-57365),
[PR#174](https://github.com/jenkinsci/analysis-model/pull/174):
Fixes false positives for MsBuild if e.g. a build project name contains the string info/note/warning.

## [5.0.1](https://github.com/jenkinsci/analysis-model/compare/analysis-model-5.0.0...analysis-model-5.0.1) - 2019-5-12

- [JENKINS-57379](https://issues.jenkins-ci.org/browse/JENKINS-57379),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class MsBuildParser extends RegexpLineParser {
private static final String MS_BUILD_WARNING_PATTERN
= "(?:^(?:.*)Command line warning ([A-Za-z0-9]+):\\s*(.*)\\s*\\[(.*)\\])|"
+ ANT_TASK + "(?:(?:\\s*(?:\\d+|\\d+:\\d+)>)?(?:(?:(?:(.*?)\\((\\d*)(?:,(\\d+))?[a-zA-Z]*?\\)|.*LINK)\\s*:|"
+ "(.*):)\\s*([A-z-_]*\\s?(?:[Nn]ote|[Ii]nfo|[Ww]arning|(?:fatal\\s*)?[Ee]rror))[^A-Za-z0-9]\\s*:?\\s*([A-Za-z0-9\\-_]+)?"
+ "(.*):)\\s*([A-z-_]*\\s(?:[Nn]ote|[Ii]nfo|[Ww]arning|(?:fatal\\s*)?[Ee]rror))[^A-Za-z0-9]\\s*:?\\s*([A-Za-z0-9\\-_]+)?"
+ "\\s*:\\s(?:\\s*([A-Za-z0-9.]+)\\s*:)?\\s*(.*?)(?: \\[([^\\]]*)[/\\\\][^\\]\\\\]+\\])?"
+ "|(.*)\\s*:.*error\\s*(LNK[0-9]+):\\s*(.*)))$";

Expand Down
12 changes: 12 additions & 0 deletions src/test/java/edu/hm/hafner/analysis/parser/MsBuildParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,18 @@ void issue56450() {
});
}

/**
* Parses a file with false positives if a build project name contains info.
*
* @see <a href="http://issues.jenkins-ci.org/browse/JENKINS-57365">Issue 57365</a>
*/
@Test
void issue57365() {
Report warnings = parse("issue57365.txt");

assertThat(warnings).isEmpty();
}

@Override
protected void assertThatIssuesArePresent(final Report report, final SoftAssertions softly) {
softly.assertThat(report)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
311>------ Build started: Project: sysinfo, Configuration: Debug Win32 ------