use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testLineAfterTracebackIsAlsoParsed.
@Test
public void testLineAfterTracebackIsAlsoParsed() {
String[] lines = new String[] { "ERROR: /home/plumpy/whatever:9:12: Traceback (most recent call last):", "\tFile \"/path/to/root/java/com/google/android/samples/helloroot/BUILD\", line 8", "\t\tpackage_group(name = BAD_FUNCTION(\"hellogoogle...\"), ...\"])", "\tFile \"/path/to/root/java/com/google/android/samples/helloroot/BUILD\", line 9, " + "in package_group", "\t\tBAD_FUNCTION", "name 'BAD_FUNCTION' is not defined." };
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
for (int i = 0; i < lines.length; ++i) {
blazeIssueParser.parseIssue(lines[i]);
}
IssueOutput issue = blazeIssueParser.parseIssue("ERROR: /home/plumpy/whatever:char offsets 1222--1229: name 'grubber' is not defined");
assertThat(issue).isNotNull();
assertThat(issue.getFile().getPath()).isEqualTo("/home/plumpy/whatever");
assertThat(issue.getMessage()).isEqualTo("name 'grubber' is not defined");
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testParseFileNotFoundErrorWithPackage.
@Test
public void testParseFileNotFoundErrorWithPackage() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("ERROR: error loading package 'path/to/package': Extension file not found. Unable to" + " load file '//third_party/bazel:tools/ide/intellij_info.bzl': file doesn't exist" + " or isn't a file");
assertThat(issue).isNotNull();
assertThat(issue.getFile().getPath()).isEqualTo("/root/third_party/bazel/tools/ide/intellij_info.bzl");
assertThat(issue.getMessage()).isEqualTo("file doesn't exist or isn't a file");
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testParseFileNotFoundError.
@Test
public void testParseFileNotFoundError() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("ERROR: Extension file not found. Unable to load file '//third_party/bazel:tools/ide/" + "intellij_info.bzl': file doesn't exist or isn't a file");
assertThat(issue).isNotNull();
assertThat(issue.getFile().getPath()).isEqualTo("/root/third_party/bazel/tools/ide/intellij_info.bzl");
assertThat(issue.getMessage()).isEqualTo("file doesn't exist or isn't a file");
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testParseBuildError.
@Test
public void testParseBuildError() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("ERROR: /root/javatests/package_path/BUILD:42:12: " + "Target '//java/package_path:helloroot_visibility' failed");
assertThat(issue).isNotNull();
assertThat(issue.getFile().getPath()).isEqualTo("/root/javatests/package_path/BUILD");
assertThat(issue.getLine()).isEqualTo(42);
assertThat(issue.getColumn()).isEqualTo(12);
assertThat(issue.getMessage()).isEqualTo("Target '//java/package_path:helloroot_visibility' failed");
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
assertThat(issue.getConsoleHyperlinkRange()).isEqualTo(TextRange.create("ERROR: ".length(), "ERROR: /root/javatests/package_path/BUILD:42:12".length()));
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testIgnoreExitCodeError.
@Test
public void testIgnoreExitCodeError() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("ERROR: //foo/bar:unit_tests: Exit 1.");
assertThat(issue).isNull();
}
Aggregations