Search in sources :

Example 6 with TestResult

use of com.google.devtools.build.lib.rules.test.TestResult in project bazel by bazelbuild.

the class TestResultAnalyzerTest method testIncrementalAnalyzeSetsActionRanTrueWhenThereAreNonCachedResults.

@Test
public void testIncrementalAnalyzeSetsActionRanTrueWhenThereAreNonCachedResults() {
    TestSummary.Builder summaryBuilder = makeTestSummaryBuilder();
    assertFalse(summaryBuilder.peek().actionRan());
    TestResultData testResultData = TestResultData.newBuilder().setRemotelyCached(false).build();
    TestResult result = new TestResult(mock(TestRunnerAction.class), testResultData, /*cached=*/
    false);
    TestSummary.Builder newSummaryBuilder = underTest.incrementalAnalyze(summaryBuilder, result);
    assertTrue(newSummaryBuilder.peek().actionRan());
}
Also used : TestResultData(com.google.devtools.build.lib.view.test.TestStatus.TestResultData) TestResult(com.google.devtools.build.lib.rules.test.TestResult) TestRunnerAction(com.google.devtools.build.lib.rules.test.TestRunnerAction) Test(org.junit.Test)

Example 7 with TestResult

use of com.google.devtools.build.lib.rules.test.TestResult in project bazel by bazelbuild.

the class TestResultAnalyzerTest method testIncrementalAnalyzeSetsActionRanFalseForLocallyCachedTests.

@Test
public void testIncrementalAnalyzeSetsActionRanFalseForLocallyCachedTests() {
    TestSummary.Builder summaryBuilder = makeTestSummaryBuilder();
    assertFalse(summaryBuilder.peek().actionRan());
    TestResultData testResultData = TestResultData.newBuilder().setRemotelyCached(false).build();
    TestResult result = new TestResult(mock(TestRunnerAction.class), testResultData, /*cached=*/
    true);
    TestSummary.Builder newSummaryBuilder = underTest.incrementalAnalyze(summaryBuilder, result);
    assertFalse(newSummaryBuilder.peek().actionRan());
}
Also used : TestResultData(com.google.devtools.build.lib.view.test.TestStatus.TestResultData) TestResult(com.google.devtools.build.lib.rules.test.TestResult) TestRunnerAction(com.google.devtools.build.lib.rules.test.TestRunnerAction) Test(org.junit.Test)

Aggregations

TestResult (com.google.devtools.build.lib.rules.test.TestResult)7 TestRunnerAction (com.google.devtools.build.lib.rules.test.TestRunnerAction)4 TestResultData (com.google.devtools.build.lib.view.test.TestStatus.TestResultData)4 Test (org.junit.Test)4 ImmutableList (com.google.common.collect.ImmutableList)1 Artifact (com.google.devtools.build.lib.actions.Artifact)1 TestExecException (com.google.devtools.build.lib.actions.TestExecException)1 Label (com.google.devtools.build.lib.cmdline.Label)1 TestAttempt (com.google.devtools.build.lib.rules.test.TestAttempt)1 ResolvedPaths (com.google.devtools.build.lib.rules.test.TestRunnerAction.ResolvedPaths)1 Pair (com.google.devtools.build.lib.util.Pair)1 Path (com.google.devtools.build.lib.vfs.Path)1 Builder (com.google.devtools.build.lib.view.test.TestStatus.TestResultData.Builder)1