public string GateTicsReport(TicsInputRepoModel inputModel) { CodeMetricsSqldbRepository sqldbRepository = new CodeMetricsSqldbRepository(); TicsReportParser ticsReportParser = new TicsReportParser(sqldbRepository); GitRepositoryHandler gitRepositoryHandler = new GitRepositoryHandler(); TicsToolExecutor ticsToolExecutor = new TicsToolExecutor(ticsReportParser); string inputRepo = inputModel.gitRepo; ticsReportParser.Persist(inputRepo); gitRepositoryHandler.CloneGithubRepository(inputRepo); ticsToolExecutor.ExecuteTicsTool(); int ticsErrors = ticsToolExecutor.ParseReport(); int gatingStatusOnPreviousRun = ticsReportParser.GateOnPreviousRun(inputRepo); string result; if (gatingStatusOnPreviousRun == -1) { result = CheckGatingCondition(ticsErrors, inputModel.TicsErrorsThreshold); } else if (gatingStatusOnPreviousRun == 0) { result = CheckGatingCondition(ticsErrors, inputModel.TicsErrorsThreshold) + " Less Errors than Previous Run"; } else { result = CheckGatingCondition(ticsErrors, inputModel.TicsErrorsThreshold) + " Same Or More Errors than Previous Run"; } return(result); }
public string GateSimianReport(InputRepoModel inputModel) { CodeMetricsSqldbRepository sqldbRepository = new CodeMetricsSqldbRepository(); SimianReportParser simianReportParser = new SimianReportParser(sqldbRepository); GitRepositoryHandler gitRepositoryHandler = new GitRepositoryHandler(); SimianToolExecutor simianToolExecutor = new SimianToolExecutor(simianReportParser); string inputRepo = inputModel.gitRepo; simianReportParser.Persist(inputRepo); gitRepositoryHandler.CloneGithubRepository(inputRepo); int simianExitCode = simianToolExecutor.ExecuteSimianTool(simianOptions); int simianDuplicates = simianToolExecutor.ParseReport(); int gatingStatusOnPreviousRun = simianReportParser.GateOnPreviousRun(inputRepo); string result; if (gatingStatusOnPreviousRun == -1) { result = CheckGatingCondition(simianExitCode, simianDuplicates, inputModel.SimianDuplicatesThreshold); } else if (gatingStatusOnPreviousRun == 0) { result = CheckGatingCondition(simianExitCode, simianDuplicates, inputModel.SimianDuplicatesThreshold) + " Less Duplicates than Previous Run"; } else { result = CheckGatingCondition(simianExitCode, simianDuplicates, inputModel.SimianDuplicatesThreshold) + "More Duplicates than Previous Run"; } return(result); }
public void TestMethod1() { gitHandler.CloneGithubRepository(@"https://github.com/97rajnish/CaseStudy"); Assert.IsTrue(Directory.Exists(@"C:\Temp\CaseStudy1")); }