Skip to content

Commit

Permalink
Update how we create triggers to enable non-main branches to be teste…
Browse files Browse the repository at this point in the history
…d on schedules
  • Loading branch information
SarahFrench committed Mar 12, 2024
1 parent a6ceb9e commit aa5cfc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class NightlyTriggerConfiguration(
val nightlyTestsEnabled: Boolean = true,
val startHour: Int = DefaultStartHour,
val daysOfWeek: String = DefaultDaysOfWeek,
val daysOfMonth: String = DefaultDaysOfMonth
val daysOfMonth: String = DefaultDaysOfMonth,
val filter: String = "+:refs/heads/main"
)

fun Triggers.runNightly(config: NightlyTriggerConfiguration) {
val filter = "+:refs/heads/main"

schedule{
enabled = config.nightlyTestsEnabled
branchFilter = filter
branchFilter = config.filter
triggerBuild = always() // Run build even if no new commits/pending changes
withPendingChangesOnly = false
enforceCleanCheckout = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ fun featureBranchProviderFunctionSubProject(allConfig: AllContextParameters): Pr
val packageName = "functions" // This project will contain only builds to test this single package
val sharedResourcesEmpty: List<String> = listOf() // No locking when testing functions
val vcrConfig = getVcrAcceptanceTestConfig(allConfig) // Reused below for both MM testing build configs
val trigger = NightlyTriggerConfiguration() // Resued below for running tests against the downstream repos every night.

// Trigger reused below for running tests against the downstream repos every night.
// Need to supply non-default branch filter
val trigger = NightlyTriggerConfiguration(filter="+:refs/heads/$featureBranchProviderFunctionsName")

var parentId: String // To be overwritten when each build config is generated below.

Expand Down

0 comments on commit aa5cfc4

Please sign in to comment.