Exemple #1
0
        public List <BuildFailureEntity> GetTestCaseFailures(DateTimeOffset startDate, string name, string viewName)
        {
            var filter = FilterUtil
                         .SinceDate(ColumnNames.PartitionKey, startDate)
                         .And(FilterUtil.Column(nameof(BuildFailureEntity.Identifier), name));

            filter = FilterView(filter, viewName);
            var query = new TableQuery <BuildFailureEntity>().Where(filter);

            return(_buildFailureDateTable.ExecuteQuery(query).ToList());
        }
Exemple #2
0
        public List <BuildResultEntity> GetBuildResultsByKindName(DateTimeOffset startDate, string kindName, string viewName)
        {
            var filter = FilterUtil
                         .SinceDate(ColumnNames.PartitionKey, startDate)
                         .And(FilterUtil.Column(nameof(BuildResultEntity.ClassificationName), kindName));

            filter = FilterView(filter, viewName);
            var query = new TableQuery <BuildResultEntity>().Where(filter);

            return(_buildResultDateTable.ExecuteQuery(query).ToList());
        }
Exemple #3
0
        private static FilterUtil FilterView(FilterUtil util, string viewName)
        {
            Debug.Assert(nameof(BuildResultEntity.ViewName) == nameof(BuildFailureEntity.ViewName));

            if (viewName == AzureUtil.ViewNameAll)
            {
                return(util);
            }

            var other = FilterUtil.Column(nameof(BuildResultEntity.ViewName), viewName, ColumnOperator.Equal);

            return(util.And(other));
        }
Exemple #4
0
        /// <summary>
        /// Query counter entities between the specified dates (inclusive)
        /// </summary>
        public static TableQuery <T> CreateTableQuery <T>(DateTimeOffset startDate, DateTimeOffset endDate)
            where T : CounterEntity, new()
        {
            var startDateKey = new DateKey(startDate);
            var endDateKey   = new DateKey(endDate);
            var filter       = FilterUtil
                               .Combine(
                FilterUtil.BetweenDateKeys(ColumnNames.PartitionKey, startDateKey, endDateKey),
                CombineOperator.And,
                FilterUtil.Combine(
                    FilterUtil.Column(nameof(CounterEntity.DateTimeUtcTicks), startDate.UtcTicks, ColumnOperator.GreaterThanOrEqual),
                    CombineOperator.And,
                    FilterUtil.Column(nameof(CounterEntity.DateTimeUtcTicks), endDate.UtcTicks, ColumnOperator.LessThanOrEqual)));

            return(new TableQuery <T>().Where(filter.Filter));
        }