void ExecuteRunSet() { Reporter.ToLog(eLogLevel.INFO, string.Format("Executing {0}... ", GingerDicser.GetTermResValue(eTermResKey.RunSet))); try { Stopwatch stopwatch = Stopwatch.StartNew(); mCLIHandler.Execute(WorkSpace.Instance.RunsetExecutor); stopwatch.Stop(); Reporter.ToLog(eLogLevel.INFO, "Execution Elapsed time: " + stopwatch.Elapsed); if (WorkSpace.Instance.RunsetExecutor.RunSetExecutionStatus == Execution.eRunStatus.Passed) { Reporter.ToLog(eLogLevel.INFO, string.Format(">> {0} executed and passed, exit code: 0", GingerDicser.GetTermResValue(eTermResKey.RunSet))); Environment.ExitCode = 0; //success } else { Reporter.ToLog(eLogLevel.WARN, string.Format(">> No indication found for successful {0} execution, exit code: 1", GingerDicser.GetTermResValue(eTermResKey.RunSet))); Environment.ExitCode = 1; //failure } } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, string.Format("Unexpected exception occurred during {0} execution, exit code 1", GingerDicser.GetTermResValue(eTermResKey.RunSet)), ex); Environment.ExitCode = 1; //failure } Reporter.ToLog(eLogLevel.INFO, "Closing Solution and doing Cleanup..."); mCLIHelper.CloseSolution(); }
private void PerformLoadAndExecution(string configurations) { Reporter.ToLog(eLogLevel.DEBUG, "Loading Configurations..."); mCLIHandler.LoadContent(configurations, mCLIHelper, WorkSpace.Instance.RunsetExecutor); if (mCLIHelper.CLIType != eCLIType.Script) { if (!mCLIHelper.LoadSolution()) { return;//failed to load Solution; } if (!mCLIHelper.LoadRunset(WorkSpace.Instance.RunsetExecutor)) { return;//failed to load Run set } if (!mCLIHelper.PrepareRunsetForExecution()) { return; //Failed to perform execution perperations } mCLIHelper.SetTestArtifactsFolder(); } Reporter.ToLog(eLogLevel.DEBUG, string.Format("Executing...")); Execute(); Reporter.ToLog(eLogLevel.DEBUG, "Closing Solution and doing Cleanup..."); mCLIHelper.CloseSolution(); }
async Task ExecuteRunSet() { Reporter.ToLog(eLogLevel.INFO, string.Format("Executing {0}... ", GingerDicser.GetTermResValue(eTermResKey.RunSet))); try { Stopwatch stopwatch = Stopwatch.StartNew(); await mCLIHandler.Execute(WorkSpace.Instance.RunsetExecutor); stopwatch.Stop(); Reporter.ToLog(eLogLevel.INFO, "Execution Elapsed time: " + stopwatch.Elapsed); if (WorkSpace.Instance.RunsetExecutor.RunSetExecutionStatus == Execution.eRunStatus.Passed) { Reporter.ToLog(eLogLevel.INFO, string.Format(">> {0} executed and passed, exit code: 0", GingerDicser.GetTermResValue(eTermResKey.RunSet))); Environment.ExitCode = 0; //success } else { Reporter.ToLog(eLogLevel.WARN, string.Format(">> No indication found for successful {0} execution, exit code: 1", GingerDicser.GetTermResValue(eTermResKey.RunSet))); Environment.ExitCode = 1; //failure } } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, string.Format("Unexpected exception occurred during {0} execution, exit code 1", GingerDicser.GetTermResValue(eTermResKey.RunSet)), ex); Environment.ExitCode = 1; //failure } //self healing changes check-in in source control if (WorkSpace.Instance.RunsetExecutor.RunSetConfig.SelfHealingConfiguration.SaveChangesInSourceControl || mCLIHelper.SelfHealingCheckInConfigured) { mCLIHelper.SaveAndCommitSelfHealingChanges(); } Reporter.ToLog(eLogLevel.INFO, "Closing Solution and doing Cleanup..."); mCLIHelper.CloseSolution(); }