public static void Use(bfgCluster testCluster, bfgWorkerManager workerManager) { if (testCluster != null) { _testCluster = testCluster; } if (workerManager != null) { TestArenaWorkerManager = workerManager; // new bfgWorkerManager(_testCluster); } }
public static string ClientId = bfgCfg.Detect().Id.Split('-').FirstOrDefault(); //get from cfg file if exists public bfgWorkerManager(bfgCluster workerCluster, IObservable <StartUnitTest[]> cfg, SystemStatusPublisher systemStatus, IResolveTypes resolver, IRxnManager <IRxn> eventManager, IAppStatusCfg appStatusCfg, IAppServiceRegistry appServiceRegistry, IZipService zipService, IAppStatusStore appCmds, IAppStatusServiceClient appStatus, IAppServiceDiscovery serviceDiscovery, IUpdateServiceClient appUpdates) { _workerCluster = workerCluster; _cfg = cfg; _resolver = resolver; _eventManager = eventManager; _appStatusCfg = appStatusCfg; _appServiceRegistry = appServiceRegistry; _zipService = zipService; _appCmds = appCmds; _appStatus = appStatus; _serviceDiscovery = serviceDiscovery; _appUpdates = appUpdates; systemStatus.Process(new AppStatusInfoProviderEvent() { ReporterName = nameof(bfgWorkerManager), Component = "Status", Info = WorkerManagerStatus }).Until(); }
public static IEnumerable <string> GetAllTagsRunnableByCluster(bfgCluster workerCluster) { return(workerCluster.Workflow.Workers.Values.SelectMany(w => GetTagsFromWorker(w)).Distinct()); }
public static IDisposable StartTestArena(string[] args, IObservable <StartUnitTest[]> testCfg, bfgCluster cluster, bfgWorkerManager workerManager, IRxnManager <IRxn> toFireOn, IAppServiceDiscovery discovery) { "Starting up TestArena".LogDebug(); if (_started.HasValue) { _started = DateTime.Now; } var stopAdvertising = bfgTestArenaApi.AdvertiseForWorkers(discovery, "all", $"http://{RxnApp.GetIpAddress()}:888"); theBfg.Use(cluster, workerManager); var stopWorkers = Disposable.Empty; if (args.Any(a => a.BasicallyEquals("fire"))) { stopWorkers = theBfg.StartTestArenaWorkers(args, testCfg).Until(); } var stopFiring = StartFiringWorkflow(args, testCfg, toFireOn); return(new CompositeDisposable(stopAdvertising, stopWorkers, stopFiring)); }