Search in sources :

Example 21 with AnsiTerminalPrinter

use of com.google.devtools.build.lib.util.io.AnsiTerminalPrinter in project bazel by bazelbuild.

the class TestSummaryTest method testFlakyAttempts.

@Test
public void testFlakyAttempts() throws Exception {
    String expectedString = ANY_STRING + "WARNING" + ANY_STRING + BlazeTestStatus.FLAKY + ANY_STRING + ", failed in 2 out of 3";
    AnsiTerminalPrinter terminalPrinter = Mockito.mock(AnsiTerminalPrinter.class);
    TestSummary summary = basicBuilder.setStatus(BlazeTestStatus.FLAKY).addPassedLogs(getPathList("/a")).addFailedLogs(getPathList("/b", "/c")).build();
    TestSummaryPrinter.print(summary, terminalPrinter, true, false);
    terminalPrinter.print(find(expectedString));
}
Also used : AnsiTerminalPrinter(com.google.devtools.build.lib.util.io.AnsiTerminalPrinter) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Example 22 with AnsiTerminalPrinter

use of com.google.devtools.build.lib.util.io.AnsiTerminalPrinter in project bazel by bazelbuild.

the class TestSummaryTest method testPartialCachedStatus.

@Test
public void testPartialCachedStatus() throws Exception {
    String expectedString = ANY_STRING + "\\(3/4 cached" + ANY_STRING;
    AnsiTerminalPrinter terminalPrinter = Mockito.mock(AnsiTerminalPrinter.class);
    TestSummary summary = createTestSummary(stubTarget, BlazeTestStatus.PASSED, CACHED - 1);
    TestSummaryPrinter.print(summary, terminalPrinter, true, false);
    terminalPrinter.print(find(expectedString));
}
Also used : AnsiTerminalPrinter(com.google.devtools.build.lib.util.io.AnsiTerminalPrinter) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Aggregations

AnsiTerminalPrinter (com.google.devtools.build.lib.util.io.AnsiTerminalPrinter)22 Test (org.junit.Test)20 Matchers.anyString (org.mockito.Matchers.anyString)11 TestCase (com.google.devtools.build.lib.view.test.TestStatus.TestCase)6 ConfiguredTarget (com.google.devtools.build.lib.analysis.ConfiguredTarget)1 ExecutionOptions (com.google.devtools.build.lib.exec.ExecutionOptions)1 AggregatingTestListener (com.google.devtools.build.lib.runtime.AggregatingTestListener)1 TestSummaryOptions (com.google.devtools.build.lib.runtime.TerminalTestResultNotifier.TestSummaryOptions)1 TestResultAnalyzer (com.google.devtools.build.lib.runtime.TestResultAnalyzer)1 Path (com.google.devtools.build.lib.vfs.Path)1 ArrayList (java.util.ArrayList)1 InOrder (org.mockito.InOrder)1