コード例 #1
0
        public BuildFailureEntity CopyDate()
        {
            var entity = new BuildFailureEntity(this);

            entity.SetEntityKey(GetDateEntityKey(BuildDateTime, BuildId, Identifier));
            return(entity);
        }
コード例 #2
0
        private async Task <List <BuildFailureEntity> > GetUnitTestFailures(BuildInfo buildInfo, string jobKind, PullRequestInfo prInfo)
        {
            // TODO: Resolve this with CoreCLR.  They are producing way too many failures at the moment though
            // and we need to stop uploading 50,000 rows a day until we can resolve this.
            if (buildInfo.Id.JobName.Contains("dotnet_coreclr"))
            {
                return(new List <BuildFailureEntity>(capacity: 0));
            }

            var buildId       = buildInfo.Id;
            var testCaseNames = await _client.GetFailedTestCasesAsync(buildInfo.BuildId);

            // Ignore obnoxious long test names.  This is a temporary work around due to CoreFX generating giantic test
            // names and log files.
            // https://github.com/dotnet/corefx/pull/11905
            if (testCaseNames.Any(x => x.Length > 10000))
            {
                return(new List <BuildFailureEntity>(capacity: 0));
            }

            var entityList = testCaseNames
                             .Select(x => BuildFailureEntity.CreateTestCaseFailure(buildInfo.Date, buildId, x, jobKind: jobKind, machineName: buildInfo.MachineName, prInfo: prInfo))
                             .ToList();

            EnsureTestCaseNamesUnique(entityList);
            return(entityList);
        }
コード例 #3
0
        public BuildFailureEntity CopyExact()
        {
            var entity = new BuildFailureEntity(this);

            entity.SetEntityKey(GetExactEntityKey(BuildId, Identifier));
            return(entity);
        }
コード例 #4
0
 public BuildFailureEntity(BuildFailureEntity other) : this(
         buildId : other.BoundBuildId,
         identifier : other.Identifier,
         buildDate : other.BuildDateTime,
         kind : other.BuildFailureKind,
         jobKind : other.JobKind,
         machineName : other.MachineName,
         prInfo : other.PullRequestInfo)
 {
 }
コード例 #5
0
        public BuildFailureEntity(BuildFailureEntity other) : this(
            buildId: other.BoundBuildId,
            identifier: other.Identifier,
            buildDate: other.BuildDateTime,
            kind: other.BuildFailureKind,
            jobKind: other.JobKind,
            machineName: other.MachineName,
            prInfo: other.PullRequestInfo)
        {

        }
コード例 #6
0
        public void MissingHostName()
        {
            var jobId = JobId.ParseName("test");
            var entity = new BuildFailureEntity()
            {
                BuildNumber = 42,
                JobName = jobId.Name
            };

            var buildId = entity.BoundBuildId;
            Assert.Equal(LegacyUtil.DefaultHost, buildId.Host);
            Assert.Equal(jobId, buildId.JobId);
            Assert.Equal(42, buildId.Number);
        }
コード例 #7
0
 public BuildFailureEntity CopyExact()
 {
     var entity = new BuildFailureEntity(this);
     entity.SetEntityKey(GetExactEntityKey(BuildId, Identifier));
     return entity;
 }
コード例 #8
0
 public BuildFailureEntity CopyDate()
 {
     var entity = new BuildFailureEntity(this);
     entity.SetEntityKey(GetDateEntityKey(BuildDateTime, BuildId, Identifier));
     return entity;
 }