Beispiel #1
0
        public void Start()
        {
            lock (_padlock)
            {
                Logger.WriteDebug("Starting autotest.net engine");
                BootStrapper.SetBuildConfiguration(
                    new BuildConfiguration((original, @new) => {
                        var detector = new PublicContractChangeDetector();
                        var changes = detector.GetAllPublicContractChangesBetween(original, @new).ToArray();
                        var optimisticBuildPossible = changes.Length == 0;
                        if (!optimisticBuildPossible)
                        {
                            Debug.WriteDebug("Optimistic build changes");
                            foreach (var change in changes)
                                Debug.WriteDebug("\t" + change.ItemChanged);
                        }
                        return optimisticBuildPossible;
                    }));
                BootStrapper.Configure(_writeLocator);
                Logger.WriteDebug("Setting up log writer");
                Logger.SetWriter(BootStrapper.Services.Locate<IWriteDebugInfo>());
                BootStrapper.Container.Register(Component.For<IMessageProxy>()
                                                                .Forward<IConsumerOf<AssembliesMinimizedMessage>>()
                                                                .Forward<IConsumerOf<AbortMessage>>()
                                                                .ImplementedBy<AutoTestMessageProxy>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For<IPreProcessTestruns>().ImplementedBy<MinimizingPreProcessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For<IPreProcessBuildruns>().ImplementedBy<MinimizingBuildPreProcessor>());
                BootStrapper.Container.Register(Component.For<IPreProcessBuildruns>().Forward<IPreProcessTestruns>().ImplementedBy<OnDemanTestrunPreprocessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For<IPreProcessBuildruns>().ImplementedBy<RealtimeChangePreProcessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For<IConsumerOf<FileChangeMessage>>().ImplementedBy<RecursiveRunCauseConsumer>().Named("RecursiveRunConsumer"));
                BootStrapper.Container.Register(Component.For<ICustomIgnoreProvider>().ImplementedBy<IgnoreProvider>());
                Logger.WriteDebug("Setting up message proxy");
                _proxy = BootStrapper.Services.Locate<IMessageProxy>();
                _proxy.SetMessageForwarder(_server);
                _proxy.RunStarted += _proxy_RunStarted;
                _proxy.RunFinished += _proxy_RunFinished;
                _configuration = BootStrapper.Services.Locate<IConfiguration>();
                if (_configuration.DebuggingEnabled)
                    Logger.EnableWriter();
                Logger.WriteDebug("Checking license");
                if (licenseIsInvalid())
                    return;

                _realtimeChangeTracker = new ChangeTracker(getRealtimeRunPreprocessor(), _configuration, BootStrapper.Services.Locate<IMessageBus>(), BootStrapper.Services.Locate<IGenerateBuildList>());
                Logger.WriteDebug("Setting up cache");
                var runCache = BootStrapper.Services.Locate<IRunResultCache>();
                runCache.EnabledDeltas();
                BootStrapper.InitializeCache(_watchPath);
                _watcher = BootStrapper.Services.Locate<IDirectoryWatcher>();
                Logger.WriteDebug("Looking for config in "+_localConfigLocation);
                _watcher.LocalConfigurationIsLocatedAt(_localConfigLocation);
                _watcher.Watch(_watchPath);
                _configuration.ValidateSettings();
                _configuredCustomOutput = _configuration.CustomOutputPath;
                var disableAll = _configuration.AllSettings("mm-AllDisabled").ToLower().Equals("true");
                StartedPaused = _configuration.StartPaused || disableAll;
                _isPaused = StartedPaused;
                setCustomOutputPath();
                var minimizer = getMinimizer();
                minimizer.ProfilerCompletedUpdate += minimizer_ProfilerCompletedUpdate;
                minimizer.ProfilerInitialized += minimizer_ProfilerInitialized;
                minimizer.MinimizerInitialized += minimizer_MinimizerInitialized;
                minimizer.ProfilingStarted += (sender, e) => _server.Send(new ProfiledTestRunStarted());
                minimizer.ProfilerLoadError += profiler_profilercorrupted;
                minimizer.SetManualUpdateProvider(() => _isPaused);
                initializeAllForPreProcessor(minimizer);
                if (disableAll)
                    Pause();
                IsRunning = true;
            }
        }
Beispiel #2
0
        public void Start()
        {
            lock (_padlock)
            {
                Logger.WriteDebug("Starting autotest.net engine");
                BootStrapper.SetBuildConfiguration(
                    new BuildConfiguration((original, @new) => {
                    var detector = new PublicContractChangeDetector();
                    var changes  = detector.GetAllPublicContractChangesBetween(original, @new).ToArray();
                    var optimisticBuildPossible = changes.Length == 0;
                    if (!optimisticBuildPossible)
                    {
                        Debug.WriteDebug("Optimistic build changes");
                        foreach (var change in changes)
                        {
                            Debug.WriteDebug("\t" + change.ItemChanged);
                        }
                    }
                    return(optimisticBuildPossible);
                }));
                BootStrapper.Configure(_writeLocator);
                Logger.WriteDebug("Setting up log writer");
                Logger.SetWriter(BootStrapper.Services.Locate <IWriteDebugInfo>());
                BootStrapper.Container.Register(Component.For <IMessageProxy>()
                                                .Forward <IConsumerOf <AssembliesMinimizedMessage> >()
                                                .Forward <IConsumerOf <AbortMessage> >()
                                                .ImplementedBy <AutoTestMessageProxy>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For <IPreProcessTestruns>().ImplementedBy <MinimizingPreProcessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For <IPreProcessBuildruns>().ImplementedBy <MinimizingBuildPreProcessor>());
                BootStrapper.Container.Register(Component.For <IPreProcessBuildruns>().Forward <IPreProcessTestruns>().ImplementedBy <OnDemanTestrunPreprocessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For <IPreProcessBuildruns>().ImplementedBy <RealtimeChangePreProcessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For <IConsumerOf <FileChangeMessage> >().ImplementedBy <RecursiveRunCauseConsumer>().Named("RecursiveRunConsumer"));
                BootStrapper.Container.Register(Component.For <ICustomIgnoreProvider>().ImplementedBy <IgnoreProvider>());
                Logger.WriteDebug("Setting up message proxy");
                _proxy = BootStrapper.Services.Locate <IMessageProxy>();
                _proxy.SetMessageForwarder(_server);
                _proxy.RunStarted  += _proxy_RunStarted;
                _proxy.RunFinished += _proxy_RunFinished;
                _configuration      = BootStrapper.Services.Locate <IConfiguration>();
                if (_configuration.DebuggingEnabled)
                {
                    Logger.EnableWriter();
                }
                Logger.WriteDebug("Checking license");
                if (licenseIsInvalid())
                {
                    return;
                }

                _realtimeChangeTracker = new ChangeTracker(getRealtimeRunPreprocessor(), _configuration, BootStrapper.Services.Locate <IMessageBus>(), BootStrapper.Services.Locate <IGenerateBuildList>());
                Logger.WriteDebug("Setting up cache");
                var runCache = BootStrapper.Services.Locate <IRunResultCache>();
                runCache.EnabledDeltas();
                BootStrapper.InitializeCache(_watchPath);
                _watcher = BootStrapper.Services.Locate <IDirectoryWatcher>();
                Logger.WriteDebug("Looking for config in " + _localConfigLocation);
                _watcher.LocalConfigurationIsLocatedAt(_localConfigLocation);
                _watcher.Watch(_watchPath);
                _configuration.ValidateSettings();
                _configuredCustomOutput = _configuration.CustomOutputPath;
                var disableAll = _configuration.AllSettings("mm-AllDisabled").ToLower().Equals("true");
                StartedPaused = _configuration.StartPaused || disableAll;
                _isPaused     = StartedPaused;
                setCustomOutputPath();
                var minimizer = getMinimizer();
                minimizer.ProfilerCompletedUpdate += minimizer_ProfilerCompletedUpdate;
                minimizer.ProfilerInitialized     += minimizer_ProfilerInitialized;
                minimizer.MinimizerInitialized    += minimizer_MinimizerInitialized;
                minimizer.ProfilingStarted        += (sender, e) => _server.Send(new ProfiledTestRunStarted());
                minimizer.ProfilerLoadError       += profiler_profilercorrupted;
                minimizer.SetManualUpdateProvider(() => _isPaused);
                initializeAllForPreProcessor(minimizer);
                if (disableAll)
                {
                    Pause();
                }
                IsRunning = true;
            }
        }