Esempio n. 1
0
 internal TestRequestManager(CommandLineOptions commandLineOptions, ITestPlatform testPlatform, TestRunResultAggregator testRunResultAggregator, ITestPlatformEventSource testPlatformEventSource, InferHelper inferHelper, Task <IMetricsPublisher> metricsPublisher)
 {
     this.testPlatform            = testPlatform;
     this.commandLineOptions      = commandLineOptions;
     this.testRunResultAggregator = testRunResultAggregator;
     this.testPlatformEventSource = testPlatformEventSource;
     this.inferHelper             = inferHelper;
     this.metricsPublisher        = metricsPublisher;
 }
Esempio n. 2
0
        internal static void RaiseTestRunError(TestLoggerManager loggerManager, TestRunResultAggregator testRunResultAggregator, Exception exception)
        {
            // testRunResultAggregator can be null, if error is being raised in discovery context.
            testRunResultAggregator?.MarkTestRunFailed();

            TestRunMessageEventArgs errorMessage = new TestRunMessageEventArgs(TestMessageLevel.Error, exception.Message);

            loggerManager.SendTestRunMessage(errorMessage);

            // Send inner exception only when its message is different to avoid duplicate.
            if (exception is TestPlatformException && exception.InnerException != null && string.Compare(exception.Message, exception.InnerException.Message, StringComparison.CurrentCultureIgnoreCase) != 0)
            {
                errorMessage = new TestRunMessageEventArgs(TestMessageLevel.Error, exception.InnerException.Message);
                loggerManager.SendTestRunMessage(errorMessage);
            }
        }
Esempio n. 3
0
        internal TestRequestManager(CommandLineOptions commandLineOptions, ITestPlatform testPlatform, TestLoggerManager testLoggerManager, TestRunResultAggregator testRunResultAggregator, ITestPlatformEventSource testPlatformEventSource)
        {
            this.testPlatform            = testPlatform;
            this.commandLineOptions      = commandLineOptions;
            this.testLoggerManager       = testLoggerManager;
            this.testRunResultAggregator = testRunResultAggregator;
            this.testPlatformEventSource = testPlatformEventSource;

            // Always enable logging for discovery or run requests
            this.testLoggerManager.EnableLogging();

            if (!this.commandLineOptions.IsDesignMode)
            {
                var consoleLogger = new ConsoleLogger();
                this.testLoggerManager.AddLogger(consoleLogger, ConsoleLogger.ExtensionUri, null);
            }
        }
Esempio n. 4
0
        internal TestRequestManager(CommandLineOptions commandLineOptions, ITestPlatform testPlatform, TestLoggerManager testLoggerManager, TestRunResultAggregator testRunResultAggregator, ITestPlatformEventSource testPlatformEventSource)
        {
            this.testPlatform            = testPlatform;
            this.commandLineOptions      = commandLineOptions;
            this.testLoggerManager       = testLoggerManager;
            this.testRunResultAggregator = testRunResultAggregator;
            this.testPlatformEventSource = testPlatformEventSource;

            // Always enable logging for discovery or run requests
            this.testLoggerManager.EnableLogging();

            // TODO: Is this required for design mode
            // Add console logger as a listener to logger events.
            var consoleLogger = new ConsoleLogger();

            consoleLogger.Initialize(this.testLoggerManager.LoggerEvents, null);
        }
Esempio n. 5
0
 internal TestRequestManager(
     CommandLineOptions commandLineOptions,
     ITestPlatform testPlatform,
     TestRunResultAggregator testRunResultAggregator,
     ITestPlatformEventSource testPlatformEventSource,
     InferHelper inferHelper,
     Task <IMetricsPublisher> metricsPublisher,
     IProcessHelper processHelper,
     ITestRunAttachmentsProcessingManager attachmentsProcessingManager)
 {
     this.testPlatform                    = testPlatform;
     this.commandLineOptions              = commandLineOptions;
     this.testRunResultAggregator         = testRunResultAggregator;
     this.TestPlatformEventSourceInstance = testPlatformEventSource;
     this.inferHelper                  = inferHelper;
     this.metricsPublisher             = metricsPublisher;
     this.processHelper                = processHelper;
     this.attachmentsProcessingManager = attachmentsProcessingManager;
 }
Esempio n. 6
0
        internal static void RaiseTestRunWarning(TestLoggerManager loggerManager, TestRunResultAggregator testRunResultAggregator, string warningMessage)
        {
            TestRunMessageEventArgs testRunMessage = new TestRunMessageEventArgs(TestMessageLevel.Warning, warningMessage);

            loggerManager.SendTestRunMessage(testRunMessage);
        }