Пример #1
0
        private Build GetLastBuildTime(string teamProjectName, Build build)
        {
            Build secondLastBuild = null;
            try
            {
                secondLastBuild = _helperClass.RetrieveTask<Build>(String.Format(_configurationRestService.RetrieveLastSuccessfulBuildUrl, teamProjectName, build.Definition.Id)).Result.FirstOrDefault() ??
                                  _helperClass.RetrieveTask<Build>(String.Format(_configurationRestService.RetriveLastPartiallyOrFailedUrl, teamProjectName, build.Definition.Id)).Result.FirstOrDefault();
            }
            catch (Exception e)
            {
                LogService.WriteError(e);
                throw;
            }

            return secondLastBuild;
        }
Пример #2
0
 private void TrySetTestResults(Build build, string teamProjectName, BuildInfoDto buildInfoDto)
 {
     if (build.Result != null &&
            (
            build.Result.Equals(Enum.GetName(typeof(StatusEnum.Statuses), StatusEnum.Statuses.partiallySucceeded)) ||
            build.Result.Equals(Enum.GetName(typeof(StatusEnum.Statuses), StatusEnum.Statuses.failed)) 
            )
            )
     {
         SetTestDetails(buildInfoDto, teamProjectName, build.Uri);
     }
 }