-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensured that beta runs in TeamCity use only beta paths #10025
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import SharedResourceNameBeta | |
import SharedResourceNameGa | ||
import SharedResourceNameVcr | ||
import builds.* | ||
import generated.SweepersList | ||
import generated.SweepersListGa | ||
import jetbrains.buildServer.configs.kotlin.Project | ||
import replaceCharsId | ||
import vcs_roots.HashiCorpVCSRootGa | ||
|
@@ -31,7 +31,7 @@ fun projectSweeperSubProject(allConfig: AllContextParameters): Project { | |
|
||
// Create build config for sweeping project resources | ||
// Uses the HashiCorpVCSRootGa VCS Root so that the latest sweepers in hashicorp/terraform-provider-google are used | ||
val serviceSweeperConfig = BuildConfigurationForProjectSweeper("N/A", ProjectSweeperName, SweepersList, projectId, HashiCorpVCSRootGa, sharedResources, gaConfig) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change looks good, though wanted to comment in case it's not obvious to people reading this PR in future: it's an arbitrary choice about whether we use TPG or TPGB to sweep project resources, but in the past only TPG has been used. Therefore here we use the GA provider (ie the VCS root to the GA provider repo) to sweep project and so it is necessary to use the GA sweeper paths when defining the special project-sweeping project. |
||
val serviceSweeperConfig = BuildConfigurationForProjectSweeper("N/A", ProjectSweeperName, SweepersListGa, projectId, HashiCorpVCSRootGa, sharedResources, gaConfig) | ||
val trigger = NightlyTriggerConfiguration(startHour=12) | ||
serviceSweeperConfig.addTrigger(trigger) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ package tests | |
|
||
import ServiceSweeperName | ||
import jetbrains.buildServer.configs.kotlin.BuildType | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Assert.assertTrue | ||
import org.junit.Test | ||
import jetbrains.buildServer.configs.kotlin.Project | ||
|
@@ -62,6 +63,31 @@ class SweeperTests { | |
assertTrue("env.SKIP_PROJECT_SWEEPER is set to a non-empty string, so project sweepers are skipped. Value = `${value}` ", value != "") | ||
} | ||
|
||
@Test | ||
fun gaNightlyProjectServiceSweeperRunsInGoogle() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding these tests - currently these are fine, but I will update my refactoring PR (#9956) to update these new tests to use the new |
||
val project = googleCloudRootProject(testContextParameters()) | ||
|
||
// Find GA nightly test project | ||
val gaProject: Project? = project.subProjects.find { p-> p.name == gaProjectName} | ||
if (gaProject == null) { | ||
Assert.fail("Could not find the Google (GA) project") | ||
} | ||
val gaNightlyTestProject: Project? = gaProject!!.subProjects.find { p-> p.name == nightlyTestsProjectName} | ||
if (gaNightlyTestProject == null) { | ||
Assert.fail("Could not find the Google (GA) Nightly Test project") | ||
} | ||
|
||
// Find sweeper inside | ||
val sweeper: BuildType? = gaNightlyTestProject!!.buildTypes.find { p-> p.name == ServiceSweeperName} | ||
if (sweeper == null) { | ||
Assert.fail("Could not find the sweeper build in the Google (GA) Nightly Test project") | ||
} | ||
|
||
// Check PACKAGE_PATH is in google (not google-beta) | ||
val value = sweeper!!.params.findRawParam("PACKAGE_PATH")!!.value | ||
assertEquals("./google/sweeper", value) | ||
} | ||
|
||
@Test | ||
fun betaNightlyProjectServiceSweeperSkipsProjectSweep() { | ||
val project = googleCloudRootProject(testContextParameters()) | ||
|
@@ -88,4 +114,29 @@ class SweeperTests { | |
val value = sweeper!!.params.findRawParam("env.SKIP_PROJECT_SWEEPER")!!.value | ||
assertTrue("env.SKIP_PROJECT_SWEEPER is set to a non-empty string, so project sweepers are skipped. Value = `${value}` ", value != "") | ||
} | ||
|
||
@Test | ||
fun betaNightlyProjectServiceSweeperRunsInGoogleBeta() { | ||
val project = googleCloudRootProject(testContextParameters()) | ||
|
||
// Find Beta nightly test project | ||
val betaProject: Project? = project.subProjects.find { p-> p.name == betaProjectName} | ||
if (betaProject == null) { | ||
Assert.fail("Could not find the Google (GA) project") | ||
} | ||
val betaNightlyTestProject: Project? = betaProject!!.subProjects.find { p-> p.name == nightlyTestsProjectName} | ||
if (betaNightlyTestProject == null) { | ||
Assert.fail("Could not find the Google (GA) Nightly Test project") | ||
} | ||
|
||
// Find sweeper inside | ||
val sweeper: BuildType? = betaNightlyTestProject!!.buildTypes.find { p-> p.name == ServiceSweeperName} | ||
if (sweeper == null) { | ||
Assert.fail("Could not find the sweeper build in the Google (GA) Nightly Test project") | ||
} | ||
|
||
// Check PACKAGE_PATH is in google-beta | ||
val value = sweeper!!.params.findRawParam("PACKAGE_PATH")!!.value | ||
assertEquals("./google-beta/sweeper", value) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updating this section - as someone who hasn't used Java/Kotlin professionally before I had a tough time re-tracing my steps when writing this guide, so I'm thankful for someone being a Guinea pig and approaching the local setup as a newcomer!