Exemplo n.º 1
0
        public bool PrepareRunsetForExecution()
        {
            try
            {
                Reporter.ToLog(eLogLevel.INFO, string.Format("Preparing {0} for Execution", GingerDicser.GetTermResValue(eTermResKey.RunSet)));

                if (!ShowAutoRunWindow)
                {
                    Reporter.ToLog(eLogLevel.INFO, string.Format("Loading {0} Runners", GingerDicser.GetTermResValue(eTermResKey.RunSet)));
                    mRunsetExecutor.InitRunners();
                }

                if (mRunSetConfig.RunWithAnalyzer)
                {
                    Reporter.ToLog(eLogLevel.INFO, string.Format("Running {0} Analyzer", GingerDicser.GetTermResValue(eTermResKey.RunSet)));
                    AnalyzerUtils analyzerUtils = new AnalyzerUtils();
                    if (analyzerUtils.AnalyzeRunset(mRunSetConfig, true))
                    {
                        Reporter.ToLog(eLogLevel.WARN, string.Format("Stopping {0} execution due to Analyzer issues", GingerDicser.GetTermResValue(eTermResKey.RunSet)));
                        return(false);
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                Reporter.ToLog(eLogLevel.ERROR, string.Format("Unexpected error occurred while preparing {0} for Execution", GingerDicser.GetTermResValue(eTermResKey.RunSet)), ex);
                return(false);
            }
        }
        public async void OpenRunSet(string runSetName, string envName)
        {
            SolutionRepository SR           = WorkSpace.Instance.SolutionRepository;
            var             envs            = SR.GetAllRepositoryItems <ProjEnvironment>();
            ProjEnvironment projEnvironment = (from x in SR.GetAllRepositoryItems <ProjEnvironment>() where x.Name == envName select x).SingleOrDefault();
            RunSetConfig    runSetConfig    = (from x in SR.GetAllRepositoryItems <RunSetConfig>() where x.Name == runSetName select x).SingleOrDefault();
            RunsetExecutor  runsetExecutor  = new RunsetExecutor();

            WorkSpace.Instance.RunsetExecutor         = runsetExecutor;
            runsetExecutor.RunSetConfig               = runSetConfig;
            runsetExecutor.RunsetExecutionEnvironment = projEnvironment;
            runsetExecutor.InitRunners();
            await runsetExecutor.RunRunset();
        }