Пример #1
0
 public IntegrationResult(string projectName, string workingDirectory, string artifactDirectory) : this()
 {
     ProjectName                   = projectName;
     WorkingDirectory              = workingDirectory;
     ArtifactDirectory             = artifactDirectory;
     this.buildProgressInformation = new Util.BuildProgressInformation(artifactDirectory);
 }
 public void Setup()
 {
     this.mocks = new MockRepository();
     this.logger = this.mocks.StrictMock<ILogger>();
     this.factory = this.mocks.StrictMock<ICruiseServerClientFactory>();
     this.result = this.mocks.StrictMock<IIntegrationResult>();
     SetupResult.For(this.result.Status).PropertyBehavior();
     this.result.Status = IntegrationStatus.Unknown;
     this.buildInfo = this.mocks.StrictMock<BuildProgressInformation>("somewhere", "test");
     SetupResult.For(this.result.BuildProgressInformation).Return(this.buildInfo);
     this.client = this.mocks.StrictMock<CruiseServerClientBase>();
 }
Пример #3
0
        public IntegrationResult(string projectName, string workingDirectory, string artifactDirectory, IntegrationRequest request, IntegrationSummary lastIntegration)
        {
            ProjectName = projectName;
            WorkingDirectory = workingDirectory;
            ArtifactDirectory = artifactDirectory;
            this.request = (lastIntegration.IsInitial()) ? new IntegrationRequest(BuildCondition.ForceBuild, request.Source, request.UserName) : request;
            this.lastIntegration = lastIntegration;
            if ((lastIntegration.Status == IntegrationStatus.Exception)
                || (lastIntegration.Status == IntegrationStatus.Failure))
                failureUsers = lastIntegration.FailureUsers;       // Inherit the previous build's failureUser list if it failed.

            buildProgressInformation = new BuildProgressInformation(artifactDirectory, projectName);

            this.label = this.LastIntegration.Label;
        }
Пример #4
0
		private BuildProgressInformation GetBuildProgressInformation(IIntegrationResult result)
		{
			if (_buildProgressInformation == null)
                _buildProgressInformation = result.BuildProgressInformation;

			return _buildProgressInformation;
		}
        /// <summary>
        /// Tries to run.	
        /// </summary>
        /// <param name="info">The info.</param>
        /// <param name="result">The result.</param>
        /// <returns></returns>
        /// <remarks></remarks>
		protected ProcessResult TryToRun(ProcessInfo info, IIntegrationResult result)
		{
			buildProgressInformation = result.BuildProgressInformation;

			try
			{
				// enable Stdout monitoring
				executor.ProcessOutput += ProcessExecutor_ProcessOutput;

				return executor.Execute(info);
			}
			catch (IOException e)
			{
				throw new BuilderException(
                    this, 
                    string.Format(System.Globalization.CultureInfo.CurrentCulture,"Unable to execute: {0} {1}\n{2}", info.FileName, info.PublicArguments, e), e);
			}
			finally
			{
				// remove Stdout monitoring
				executor.ProcessOutput -= ProcessExecutor_ProcessOutput;
			}
		}