Skip to content

Commit

Permalink
Reapply "Disable PTS for promotion builds" (#31851)
Browse files Browse the repository at this point in the history
  • Loading branch information
blindpirate authored Dec 20, 2024
2 parents 3f4c79b + 2eaccae commit 9d20b36
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
18 changes: 16 additions & 2 deletions .teamcity/src/main/kotlin/common/extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,22 @@ fun functionalTestParameters(os: Os, arch: Arch = Arch.AMD64): List<String> {
)
}

fun promotionBuildParameters(dependencyBuildId: RelativeId, extraParameters: String, gitUserName: String, gitUserEmail: String) =
"""-PcommitId=%dep.$dependencyBuildId.build.vcs.number% $extraParameters "-PgitUserName=$gitUserName" "-PgitUserEmail=$gitUserEmail" $pluginPortalUrlOverride %additional.gradle.parameters%"""
fun promotionBuildParameters(
dependencyBuildId: RelativeId,
extraParameters: String,
gitUserName: String,
gitUserEmail: String
): String {
return listOf(
"-PcommitId=%dep.$dependencyBuildId.build.vcs.number%",
extraParameters,
"\"-PgitUserName=$gitUserName\"",
"\"-PgitUserEmail=$gitUserEmail\"",
pluginPortalUrlOverride,
"-DenablePredictiveTestSelection=false",
"%additional.gradle.parameters%"
).joinToString(" ")
}

/**
* Align with build-logic/cleanup/src/main/java/gradlebuild/cleanup/services/KillLeakingJavaProcesses.java
Expand Down
18 changes: 9 additions & 9 deletions .teamcity/src/test/kotlin/PromotionProjectTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class PromotionProjectTests {
val steps = nightlySnapshot.steps.items
assertEquals(3, steps.size)

val expectedGradleParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_ReadyforNightly_Trigger.build.vcs.number% "-PgitUserName=bot-teamcity" "[email protected]" $pluginPortalUrlOverride %additional.gradle.parameters%"""
val expectedGradleParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_ReadyforNightly_Trigger.build.vcs.number% "-PgitUserName=bot-teamcity" "[email protected]" $pluginPortalUrlOverride -DenablePredictiveTestSelection=false %additional.gradle.parameters%"""

val checkReady = gradleStep(steps, 0)
checkReady.assertTasks("prepReleaseNightly checkNeedToPromote")
Expand All @@ -100,7 +100,7 @@ class PromotionProjectTests {

val step = gradleStep(steps, 0)
step.assertTasks("clean promoteStartReleaseCycle")
assertEquals("""-PcommitId=%dep.Gradle_Master_Check_Stage_ReadyforNightly_Trigger.build.vcs.number% -PconfirmationCode=%confirmationCode% "-PgitUserName=%gitUserName%" "-PgitUserEmail=%gitUserEmail%" $pluginPortalUrlOverride %additional.gradle.parameters%""", step.gradleParams)
assertEquals("""-PcommitId=%dep.Gradle_Master_Check_Stage_ReadyforNightly_Trigger.build.vcs.number% -PconfirmationCode=%confirmationCode% "-PgitUserName=%gitUserName%" "-PgitUserEmail=%gitUserEmail%" $pluginPortalUrlOverride -DenablePredictiveTestSelection=false %additional.gradle.parameters%""", step.gradleParams)
}

@Test
Expand All @@ -124,7 +124,7 @@ class PromotionProjectTests {
val steps = nightlySnapshot.steps.items
assertEquals(3, steps.size)

val expectedGradleParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_QuickFeedback_Trigger.build.vcs.number% "-PgitUserName=bot-teamcity" "[email protected]" $pluginPortalUrlOverride %additional.gradle.parameters%"""
val expectedGradleParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_QuickFeedback_Trigger.build.vcs.number% "-PgitUserName=bot-teamcity" "[email protected]" $pluginPortalUrlOverride -DenablePredictiveTestSelection=false %additional.gradle.parameters%"""

val checkReady = gradleStep(steps, 0)
checkReady.assertTasks("prepReleaseNightly checkNeedToPromote")
Expand All @@ -147,7 +147,7 @@ class PromotionProjectTests {
val steps = nightlySnapshot.steps.items
assertEquals(3, steps.size)

val expectedGradleParams = """-PcommitId=%dep.Gradle_Master_Check_Stage_QuickFeedback_Trigger.build.vcs.number% -PpromotedBranch=%branch.qualifier% "-PgitUserName=bot-teamcity" "[email protected]" $pluginPortalUrlOverride %additional.gradle.parameters%"""
val expectedGradleParams = """-PcommitId=%dep.Gradle_Master_Check_Stage_QuickFeedback_Trigger.build.vcs.number% -PpromotedBranch=%branch.qualifier% "-PgitUserName=bot-teamcity" "[email protected]" $pluginPortalUrlOverride -DenablePredictiveTestSelection=false %additional.gradle.parameters%"""

val checkReady = gradleStep(steps, 0)
checkReady.assertTasks("prepSnapshot checkNeedToPromote")
Expand All @@ -170,7 +170,7 @@ class PromotionProjectTests {
val steps = nightlySnapshot.steps.items
assertEquals(2, steps.size)

val expectedParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_QuickFeedback_Trigger.build.vcs.number% "-PgitUserName=bot-teamcity" "[email protected]" $pluginPortalUrlOverride %additional.gradle.parameters%"""
val expectedParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_QuickFeedback_Trigger.build.vcs.number% "-PgitUserName=bot-teamcity" "[email protected]" $pluginPortalUrlOverride -DenablePredictiveTestSelection=false %additional.gradle.parameters%"""

val checkReady = gradleStep(steps, 0)
checkReady.assertTasks("prepReleaseNightly checkNeedToPromote")
Expand All @@ -189,7 +189,7 @@ class PromotionProjectTests {
val steps = nightlySnapshot.steps.items
assertEquals(2, steps.size)

val expectedGradleParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_QuickFeedback_Trigger.build.vcs.number% "-PgitUserName=bot-teamcity" "[email protected]" $pluginPortalUrlOverride %additional.gradle.parameters%"""
val expectedGradleParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_QuickFeedback_Trigger.build.vcs.number% "-PgitUserName=bot-teamcity" "[email protected]" $pluginPortalUrlOverride -DenablePredictiveTestSelection=false %additional.gradle.parameters%"""

val checkReady = gradleStep(steps, 0)
checkReady.assertTasks("prepReleaseNightly checkNeedToPromote")
Expand All @@ -208,7 +208,7 @@ class PromotionProjectTests {
val steps = nightlySnapshot.steps.items
assertEquals(3, steps.size)

val expectedGradleParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_ReadyforRelease_Trigger.build.vcs.number% -PconfirmationCode=%confirmationCode% "-PgitUserName=%gitUserName%" "-PgitUserEmail=%gitUserEmail%" $pluginPortalUrlOverride %additional.gradle.parameters%"""
val expectedGradleParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_ReadyforRelease_Trigger.build.vcs.number% -PconfirmationCode=%confirmationCode% "-PgitUserName=%gitUserName%" "-PgitUserEmail=%gitUserEmail%" $pluginPortalUrlOverride -DenablePredictiveTestSelection=false %additional.gradle.parameters%"""

val checkReady = gradleStep(steps, 0)
checkReady.assertTasks("prepFinalRelease checkNeedToPromote")
Expand All @@ -231,7 +231,7 @@ class PromotionProjectTests {
val steps = nightlySnapshot.steps.items
assertEquals(3, steps.size)

val expectedGradleParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_ReadyforRelease_Trigger.build.vcs.number% -PconfirmationCode=%confirmationCode% "-PgitUserName=%gitUserName%" "-PgitUserEmail=%gitUserEmail%" $pluginPortalUrlOverride %additional.gradle.parameters%"""
val expectedGradleParams = """-PcommitId=%dep.Gradle_Release_Check_Stage_ReadyforRelease_Trigger.build.vcs.number% -PconfirmationCode=%confirmationCode% "-PgitUserName=%gitUserName%" "-PgitUserEmail=%gitUserEmail%" $pluginPortalUrlOverride -DenablePredictiveTestSelection=false %additional.gradle.parameters%"""

val checkReady = gradleStep(steps, 0)
checkReady.assertTasks("prepRc checkNeedToPromote")
Expand Down Expand Up @@ -260,7 +260,7 @@ class PromotionProjectTests {
val steps = nightlySnapshot.steps.items
assertEquals(3, steps.size)

val expectedGradleParams = """-PcommitId=%dep.Gradle_${branch.toCapitalized()}_Check_Stage_ReadyforRelease_Trigger.build.vcs.number% -PconfirmationCode=%confirmationCode% "-PgitUserName=%gitUserName%" "-PgitUserEmail=%gitUserEmail%" $pluginPortalUrlOverride %additional.gradle.parameters%"""
val expectedGradleParams = """-PcommitId=%dep.Gradle_${branch.toCapitalized()}_Check_Stage_ReadyforRelease_Trigger.build.vcs.number% -PconfirmationCode=%confirmationCode% "-PgitUserName=%gitUserName%" "-PgitUserEmail=%gitUserEmail%" $pluginPortalUrlOverride -DenablePredictiveTestSelection=false %additional.gradle.parameters%"""

val checkReady = gradleStep(steps, 0)
checkReady.assertTasks("prepMilestone checkNeedToPromote")
Expand Down

0 comments on commit 9d20b36

Please sign in to comment.