Example #1
0
 public static void Main(string[] args)
 {
     var files = new List<string>();
     files.AddRange(args);
     var x = new TestMinimizer(true, Environment.ProcessorCount);
     x.MinimizerMessage += x_MinimizerMessage;
     x.LoadOldCachedFiles(files);
     var tests = x.GetTestsFor(files);
     foreach (var y in tests)
     {
         Console.WriteLine("found test " + y.TestClass + "::" + y.TestName + " in assembly " + y.TestAssembly);
     }
     Console.WriteLine(tests.Count + " total tests found.");
     
     var graph = x.GetGraphFor("System.Void Fohjin.DDD.CommandHandlers.AssignNewBankCardCommandHandler::Execute(Fohjin.DDD.Commands.AssignNewBankCardCommand)", false);
 }
 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");
 }
        public void Initialize()
        {
            // If minimizer is off skip all minimizer and profiler stuff
            if (minimizerGraphsAndRiskIsOff())
                return;

            try
            {
                var assemblies = GetAssemblies();
                Logger.WriteDebug("minimizer isdebug = " + _configuration.AllSettings("mm-MinimizerDebug"));
                _minimizer = new TestMinimizer(_configuration.AllSettings("mm-MinimizerDebug") == "true", 1);
                _minimizer.TranslateHistoryFilePathsWith((s) => { return new PathTranslator(_configuration.WatchToken).Translate(s); });
                _minimizer.MinimizerMessage += MinimizerMinimizerMessage;
                
                _minimizer.DoInitialIndexOf(assemblies);
                InvokeMinimizerInitialized(new EventArgs());
                GC.Collect();
                GC.WaitForPendingFinalizers();
                //if (!minimizerGraphsAndRiskIsOff())
                ThreadPool.QueueUserWorkItem(x => LoadProfilerData());
            }
            catch (Exception ex)
            {
                Logger.Write(ex);
            }
        }