Search in sources :

Example 6 with GeneralTestEventsProcessor

use of com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor in project buck by facebook.

the class BuckToGeneralTestEventsConverter method consumeTestRunStarted.

@Override
public void consumeTestRunStarted(long timestamp) {
    final GeneralTestEventsProcessor processor = getProcessor();
    if (processor == null) {
        return;
    }
    processor.onUncapturedOutput("Test run started at " + DateFormatUtil.formatTimeWithSeconds(new Date(timestamp)) + "\n", ProcessOutputTypes.STDOUT);
}
Also used : GeneralTestEventsProcessor(com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor) Date(java.util.Date)

Example 7 with GeneralTestEventsProcessor

use of com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor in project intellij by bazelbuild.

the class BlazeXmlToTestEventsConverter method reportTargetWithoutOutputFiles.

/**
 * If there are no output files, the test may have failed to build, or timed out. Provide a
 * suitable message in the test UI.
 */
private void reportTargetWithoutOutputFiles(Label label, TestStatus status) {
    if (status == TestStatus.PASSED) {
        // Empty test targets do not produce output XML, yet technically pass. Ignore them.
        return;
    }
    GeneralTestEventsProcessor processor = getProcessor();
    TestSuiteStarted suiteStarted = new TestSuiteStarted(label.toString());
    processor.onSuiteStarted(new TestSuiteStartedEvent(suiteStarted, /*locationUrl=*/
    null));
    String targetName = label.targetName().toString();
    processor.onTestStarted(new TestStartedEvent(targetName, /*locationUrl=*/
    null));
    processor.onTestFailure(getTestFailedEvent(targetName, STATUS_EXPLANATIONS.get(status) + " See console output for details", /*content=*/
    null, /*duration=*/
    0));
    processor.onTestFinished(new TestFinishedEvent(targetName, /*duration=*/
    0L));
    processor.onSuiteFinished(new TestSuiteFinishedEvent(label.toString()));
}
Also used : TestStartedEvent(com.intellij.execution.testframework.sm.runner.events.TestStartedEvent) GeneralTestEventsProcessor(com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor) TestSuiteStarted(jetbrains.buildServer.messages.serviceMessages.TestSuiteStarted) TestFinishedEvent(com.intellij.execution.testframework.sm.runner.events.TestFinishedEvent) TestSuiteStartedEvent(com.intellij.execution.testframework.sm.runner.events.TestSuiteStartedEvent) TestSuiteFinishedEvent(com.intellij.execution.testframework.sm.runner.events.TestSuiteFinishedEvent)

Aggregations

GeneralTestEventsProcessor (com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor)7 Date (java.util.Date)4 TestFinishedEvent (com.intellij.execution.testframework.sm.runner.events.TestFinishedEvent)2 TestStartedEvent (com.intellij.execution.testframework.sm.runner.events.TestStartedEvent)2 TestSuiteFinishedEvent (com.intellij.execution.testframework.sm.runner.events.TestSuiteFinishedEvent)2 TestSuiteStartedEvent (com.intellij.execution.testframework.sm.runner.events.TestSuiteStartedEvent)2 TestCaseSummary (com.facebook.buck.intellij.ideabuck.ws.buckevents.parts.TestCaseSummary)1 TestResultsSummary (com.facebook.buck.intellij.ideabuck.ws.buckevents.parts.TestResultsSummary)1 TestFailedEvent (com.intellij.execution.testframework.sm.runner.events.TestFailedEvent)1 TestOutputEvent (com.intellij.execution.testframework.sm.runner.events.TestOutputEvent)1 TestSuiteStarted (jetbrains.buildServer.messages.serviceMessages.TestSuiteStarted)1