private BeforeLaunchFinishingEventArgs NotifyFinishing(FinishLaunchRequest request) { var args = new BeforeLaunchFinishingEventArgs(_service, _configuration, request); Notify(() => ReportEventsSource.RaiseBeforeLaunchFinishing(_reportEventsSource, this, args)); return(args); }
private AfterLaunchFinishedEventArgs NotifyFinished() { var args = new AfterLaunchFinishedEventArgs(_service, _configuration); Notify(() => ReportEventsSource.RaiseAfterLaunchFinished(_reportEventsSource, this, args)); return(args); }
private BeforeTestStartingEventArgs NotifyStarting(StartTestItemRequest request) { var args = new BeforeTestStartingEventArgs(_service, _configuration, request); Notify(() => ReportEventsSource.RaiseBeforeTestStarting(_reportEventsSource, this, args)); return(args); }
public TestReporter(IClientService service, IConfiguration configuration, ILaunchReporter launchReporter, ITestReporter parentTestReporter, IRequestExecuter requestExecuter, IExtensionManager extensionManager, ReportEventsSource reportEventNotifier) { _service = service; _configuration = configuration; _requestExecuter = requestExecuter; _extensionManager = extensionManager; _reportEventsSource = reportEventNotifier; LaunchReporter = launchReporter; ParentTestReporter = parentTestReporter; }
public LaunchReporter(IClientService service, IConfiguration configuration, IRequestExecuter requestExecuter, IExtensionManager extensionManager) { _service = service; if (configuration != null) { _configuration = configuration; } else { var jsonPath = System.IO.Path.GetDirectoryName(new Uri(typeof(LaunchReporter).Assembly.CodeBase).LocalPath) + "/orangebeard.config.json"; _configuration = new ConfigurationBuilder().AddJsonFile(jsonPath).AddEnvironmentVariables().Build(); } _requestExecuter = requestExecuter ?? new RequestExecuterFactory(_configuration).Create(); _extensionManager = extensionManager ?? throw new ArgumentNullException(nameof(extensionManager)); _reportEventsSource = new ReportEventsSource(); if (extensionManager.ReportEventObservers != null) { foreach (var reportEventObserver in extensionManager.ReportEventObservers) { try { reportEventObserver.Initialize(_reportEventsSource); } catch (Exception initExp) { TraceLogger.Error($"Unhandled exception while initializing of {reportEventObserver.GetType().FullName}: {initExp}"); } } } // identify whether launch is already started by any external system var externalLaunchUuid = _configuration.GetValue <string>("Launch:Id", null); if (externalLaunchUuid != null) { _isExternalLaunchId = true; _launchInfo = new LaunchInfo { Uuid = externalLaunchUuid }; } // identify whether launch should be rerun _rerunOfUuid = _configuration.GetValue <string>("Launch:RerunOf", null); _isRerun = _configuration.GetValue("Launch:Rerun", false); }
public static void RaiseAfterTestFinished(ReportEventsSource source, ITestReporter testReporter, AfterTestFinishedEventArgs args) { source.OnAfterTestFinished?.Invoke(testReporter, args); }
public static void RaiseBeforeTestFinishing(ReportEventsSource source, ITestReporter testReporter, BeforeTestFinishingEventArgs args) { source.OnBeforeTestFinishing?.Invoke(testReporter, args); }
public static void RaiseAfterLaunchFinished(ReportEventsSource source, ILaunchReporter launchReporter, AfterLaunchFinishedEventArgs args) { source.OnAfterLaunchFinished?.Invoke(launchReporter, args); }
public static void RaiseBeforeLaunchFinishing(ReportEventsSource source, ILaunchReporter launchReporter, BeforeLaunchFinishingEventArgs args) { source.OnBeforeLaunchFinishing?.Invoke(launchReporter, args); }