Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private bool EnsureReportBuildStatus(BuildDefinition definition)
protected const int TotalBuckets = TotalMinutes / BucketSizeInMinutes;
protected const int BucketsPerHour = 60 / BucketSizeInMinutes;

protected Schedule CreateScheduleFromDefinition(BuildDefinition definition)
protected virtual Schedule CreateScheduleFromDefinition(BuildDefinition definition)
{
var bucket = definition.Id % TotalBuckets;
var startHours = bucket / BucketsPerHour;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Microsoft.Extensions.Logging;
using Microsoft.TeamFoundation.Build.WebApi;

namespace PipelineGenerator.Conventions
{
public class WeeklyIntegrationTestingPipelineConvention : IntegrationTestingPipelineConvention
{
public WeeklyIntegrationTestingPipelineConvention(ILogger logger, PipelineGenerationContext context) : base(logger, context)
{
}

protected override string GetDefinitionName(SdkComponent component)
{
return $"{Context.Prefix} - {component.Name} - tests-weekly";
}

protected override Schedule CreateScheduleFromDefinition(BuildDefinition definition)
{
var bucket = definition.Id % TotalBuckets;
var startHours = bucket / BucketsPerHour;
var startMinutes = bucket % BucketsPerHour;

var schedule = new Schedule
{
DaysToBuild = ScheduleDays.Saturday | ScheduleDays.Sunday,
ScheduleOnlyWithChanges = true,
StartHours = FirstSchedulingHour + startHours,
StartMinutes = startMinutes * BucketSizeInMinutes,
TimeZoneId = "Pacific Standard Time",
};
schedule.BranchFilters.Add("+master");

return schedule;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ private PipelineConvention GetPipelineConvention(string convention, PipelineGene
var testLogger = serviceProvider.GetService<ILogger<IntegrationTestingPipelineConvention>>();
return new IntegrationTestingPipelineConvention(testLogger, context);

case "weekly":
var weeklyTestLogger = serviceProvider.GetService<ILogger<WeeklyIntegrationTestingPipelineConvention>>();
return new WeeklyIntegrationTestingPipelineConvention(weeklyTestLogger, context);

default: throw new ArgumentOutOfRangeException(nameof(convention), "Could not find matching convention.");
}
}
Expand Down