Example #1
0
 private RunFinishedInfo getRunFinishedInfo(RunFinishedMessage message) {
     var report = message.Report;
     var text = string.Format(
                 "Ran {0} build(s) ({1} succeeded, {2} failed) and {3} test(s) ({4} passed, {5} failed, {6} ignored)",
                 report.NumberOfProjectsBuilt,
                 report.NumberOfBuildsSucceeded,
                 report.NumberOfBuildsFailed,
                 report.NumberOfTestsRan,
                 report.NumberOfTestsPassed,
                 report.NumberOfTestsFailed,
                 report.NumberOfTestsIgnored);
     var succeeded = !(report.NumberOfBuildsFailed > 0 || report.NumberOfTestsFailed > 0);
     return new RunFinishedInfo(text, succeeded, report);
 }
 private void runFinished(RunFinishedMessage msg)
 {
     _syncContext.Post(x =>
     {
         if (((RunFinishedMessage)x).Report.Aborted)
         {
             if (ShowRunInformation)
             {
                 setProgress(ImageStates.None, "", false, null);
                 printMessage(new RunMessages(RunMessageType.Normal, "last build/test run was aborted"));
             }
         }
         else
         {
             var i = getRunFinishedInfo((RunFinishedMessage)x);
             var runType = i.Succeeded ? RunMessageType.Succeeded : RunMessageType.Failed;
             setProgress(runType == RunMessageType.Succeeded ? ImageStates.Green : ImageStates.Red, "", false, null);
             printMessage(new RunMessages(runType, i.Text));
             generateSummary(i.Report);
         }
         _isRunning = false;
         organizeListItemBehaviors(listViewFeedback.SelectedItems);
     }, msg);
 }
Example #3
0
 private void runFinished(RunFinishedMessage msg)
 {
     _syncContext.Post(x =>
     {
         if (((RunFinishedMessage)x).Report.Aborted)
         {
             if (ShowRunInformation)
                 printMessage(new RunMessages(RunMessageType.Normal, "last build/test run was aborted"));
         }
         else
         {
             var i = getRunFinishedInfo((RunFinishedMessage)x);
             var runType = i.Succeeded ? RunMessageType.Succeeded : RunMessageType.Failed;
             printMessage(new RunMessages(runType, i.Text));
             generateSummary(i.Report);
         }
         _isRunning = false;
     }, msg);
 }
 private void sendAnalytics(RunFinishedMessage message)
 {
     if (message.Report.Aborted)
     {
         Analytics.SendEvent("RunAborted");
     }
     else if (message.Report.NumberOfBuildsFailed == 0 && message.Report.NumberOfTestsFailed == 0)
     {
         Analytics.SendEvent("RunPassed");
     }
     else if (message.Report.NumberOfBuildsFailed > 0)
     {
         Analytics.SendEvent("BuildFailed");
     }
     else
     {
         Analytics.SendEvent("TestsFailed");
     }
 }
 private RunStatus setRunStatus(RunFinishedMessage message)
 {
     if (message.Report.Aborted)
     {
         return RunStatus.Aborted;
     }
     if (message.Report.NumberOfBuildsFailed == 0 && message.Report.NumberOfTestsFailed == 0)
     {
         return RunStatus.Green;
     }
     if (message.Report.NumberOfBuildsFailed == 0)
     {
         return RunStatus.Red;
     }
     return RunStatus.Red;
 }
 private static string GetFinishedMessage(RunFinishedMessage message)
 {
     var report = message.Report;
     var failed = report.NumberOfBuildsFailed > 0 || report.NumberOfTestsFailed > 0;
     var text = "";
     if (failed)
     {
         text = string.Format(
                     "Ran {0} build(s) ({1} succeeded, {2} failed) and {3} test(s) ({4} passed, {5} failed, {6} ignored)",
                     report.NumberOfProjectsBuilt,
                     report.NumberOfBuildsSucceeded,
                     report.NumberOfBuildsFailed,
                     report.NumberOfTestsRan,
                     report.NumberOfTestsPassed,
                     report.NumberOfTestsFailed,
                     report.NumberOfTestsIgnored);
         
     }
     else
     {
         text = string.Format(
                     "Ran {0} build(s) and {1} test(s)",
                     report.NumberOfProjectsBuilt,
                     report.NumberOfTestsRan);
     }
     var statusText = failed ? "FAILED: " : "Succeeded: ";
     return statusText + text;
 }
 private void runFinished(RunFinishedMessage x)
 {
     if (((RunFinishedMessage)x).Report.Aborted)
     {
         if (ShowRunInformation)
         {
             var i = getRunFinishedInfo((RunFinishedMessage)x);
             var runType = i.Succeeded ? RunMessageType.Succeeded : RunMessageType.Failed;
             setProgress(runType == RunMessageType.Succeeded ? ImageStates.Green : ImageStates.Red, "", false, null);
             printMessage(new RunMessages(runType, i.Text));
             generateSummary(i.Report);
         }
     }
     else
     {
         var i = getRunFinishedInfo((RunFinishedMessage)x);
         var runType = i.Succeeded ? RunMessageType.Succeeded : RunMessageType.Failed;
         setProgress(runType == RunMessageType.Succeeded ? ImageStates.Green : ImageStates.Red, "", false, null);
         printMessage(new RunMessages(runType, i.Text));
         generateSummary(i.Report);
     }
     _isRunning = false;
     organizeListItemBehaviors();
 }