Skip to content

Commit

Permalink
TeamCity: Ensure nightly tests use same git commit (GoogleCloudPlatfo…
Browse files Browse the repository at this point in the history
  • Loading branch information
BBBmau authored Sep 9, 2024
1 parent 1009499 commit cc6f95c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fun Triggers.runNightly(config: NightlyTriggerConfiguration) {

schedule{
enabled = config.nightlyTestsEnabled
branchFilter = "+:" + config.branch // returns "+:/refs/heads/main" if default
branchFilter = "+:" + config.branch // returns "+:/refs/heads/nightly-test" if default
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 @@ -25,7 +25,7 @@ const val DefaultDaysOfWeek = "*"
const val DefaultDaysOfMonth = "*"

// This represents the default branch to be used for testing
const val DefaultBranchName = "refs/heads/main"
const val DefaultBranchName = "refs/heads/nightly-test"

// Value used to make long-running builds fail due to a timeout
const val DefaultBuildTimeoutDuration = 60 * 12 // 12 hours in minutes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ class NightlyTestProjectsTests {

assertTrue("Build configuration `${bt.name}` should contain a CRON/'schedulingTrigger' trigger", found)

// Check that nightly test is being ran on main branch
var isDefault: Boolean = false
if (schedulingTrigger.branchFilter == "+:refs/heads/main"){
isDefault = true
// Check that nightly test is being ran on the nightly-test branch
var isNightlyTestBranch: Boolean = false
if (schedulingTrigger.branchFilter == "+:refs/heads/nightly-test"){
isNightlyTestBranch = true
}
assertTrue("Build configuration `${bt.name} is using the default branch;", isDefault)
assertTrue("Build configuration `${bt.name}` is using the nightly-test branch filter;", isNightlyTestBranch)
}
}
}

0 comments on commit cc6f95c

Please sign in to comment.