mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 08:44:50 +00:00
BTA
This commit is contained in:
1 parent
2d4ede41dd
commit
8734c38361
2 files changed
+36
-8
No files matched your search
@@ -66,6 +66,29 @@ public class IrisModdedBuildTest {
|
||||
assertEquals("first" + System.lineSeparator() + "last", IrisModdedBuildAction.logTail(log));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void failureSummaryReportsTheNestedBuildOutputBeforeTheRecordedStackTrace() throws Exception {
|
||||
Path log = temporary.newFile().toPath();
|
||||
Files.writeString(log, "> Task :compileJava FAILED\n\n* What went wrong:\nExecution failed for task ':compileJava'.\n\nBUILD FAILED in 20s\n");
|
||||
Exception failure = new IllegalStateException("nested build exited 1");
|
||||
|
||||
String summary = IrisModdedBuildAction.failureSummary(log, failure);
|
||||
|
||||
assertTrue(summary.contains("* What went wrong:"));
|
||||
assertTrue(summary.endsWith("BUILD FAILED in 20s"));
|
||||
assertFalse(summary.contains("nested build exited 1"));
|
||||
assertTrue(Files.readString(log).contains("java.lang.IllegalStateException: nested build exited 1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void failureSummaryReportsAnUnreadableLog() throws Exception {
|
||||
Path log = temporary.getRoot().toPath().resolve("missing/forge.log");
|
||||
Exception failure = new IllegalStateException("log directory could not be created");
|
||||
|
||||
assertEquals("Log could not be read.", IrisModdedBuildAction.failureSummary(log, failure));
|
||||
assertEquals(2, failure.getSuppressed().length);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void failureSummaryBoundsAnUnbrokenFailureLine() throws Exception {
|
||||
Path log = temporary.newFile().toPath();
|
||||
|
||||
Reference in new issue
Block a user