public void TestFinished(AutoTest.TestRunners.Shared.Results.TestResult result) { lock (_padLock) { if (_lastSend == DateTime.MinValue) { _lastSend = DateTime.Now; } _currentAssembly = result.Assembly; _testCount++; if (result.State == TestState.Passed && _runCache.Failed.Count(x => x.Value.Name.Equals(result.TestName)) != 0) { _bus.Publish( new LiveTestStatusMessage( _currentAssembly, _totalTestCount, _testCount, new LiveTestStatus[] { }, new LiveTestStatus[] { new LiveTestStatus(result.Assembly, AutoTestTestRunner.ConvertResult(result)) })); _lastSend = DateTime.Now; return; } else if (result.State == TestState.Failed) { _bus.Publish( new LiveTestStatusMessage( _currentAssembly, _totalTestCount, _testCount, new LiveTestStatus[] { new LiveTestStatus(result.Assembly, AutoTestTestRunner.ConvertResult(result)) }, new LiveTestStatus[] { })); _lastSend = DateTime.Now; return; } else if (DateTime.Now > _lastSend.AddSeconds(1)) { _bus.Publish( new LiveTestStatusMessage( _currentAssembly, _totalTestCount, _testCount, new LiveTestStatus[] { }, new LiveTestStatus[] { })); _lastSend = DateTime.Now; return; } } }
public MinimizingPreProcessor(ICache cache, IRunResultCache resultCache, IConfiguration configuration, IOptimizeBuildConfiguration buildOptimizer, IMessageBus bus, ITestRunner[] runners) { _cache = cache; _resultCache = resultCache; _configuration = configuration; _buildOptimizer = buildOptimizer; _bus = bus; _runner = (AutoTestTestRunner)runners.First(x => x.GetType().Name.Equals("AutoTestTestRunner")); _minimizer = new TestMinimizer(configuration.AllSettings("mm-MinimizerDebug") == "true", 1); _profilerData = new ProfilerData(GetDBName(), new BinaryFileProfilerDataParser(), new ForEveryFixtureConstructorOrFixtureChangeContextChangeFinder()); _profilerData.DebugMessage += _profilerData_DebugMessage; Logger.WriteDebug("Minimizing PreProc Created"); }