Skip to content

Commit

Permalink
Revert tc fix to avoid pre- and post-sweepers run for every service p…
Browse files Browse the repository at this point in the history
…ackage (#8428) (#5932)

* Revert "Fix the folder to run sweepers (#8425)"

This reverts commit 18d4037c4ba353ac3a93aa9da43c8df2b0d1de46.

* Revert "pre-sweeper and post-sweeper should only run in the google/google-beta package for now (#8423)"

This reverts commit 762c77b0a4e6c28424d08d6cf5951549e109edfd.

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Jul 22, 2023
1 parent 0e2d507 commit b2f8a98
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .changelog/8428.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
2 changes: 1 addition & 1 deletion .teamcity/components/build_config_package.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class packageDetails(name: String, displayName: String, environment: String, bra
// - Compile Test Binary
// - Run via jen20/teamcity-go-test
// - Post-Sweeper
RunAcceptanceTests(providerName, path, packageName)
RunAcceptanceTests(path, packageName)
}

failureConditions {
Expand Down
7 changes: 3 additions & 4 deletions .teamcity/components/generated/build_components.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ fun servicePath(path : String, packageName: String) : String {
return "./%s/%s".format(path, packageName)
}

fun BuildSteps.RunAcceptanceTests(providerName : String, path : String, packageName: String) {
fun BuildSteps.RunAcceptanceTests(path : String, packageName: String) {
var packagePath = servicePath(path, packageName)
var withTestsDirectoryPath = "##teamcity[setParameter name='PACKAGE_PATH' value='%s/tests']".format(packagePath)
var providerPath = "./%s".format(providerName)

// some packages use a ./tests folder, others don't - conditionally append that if needed
step(ScriptBuildStep {
Expand All @@ -64,7 +63,7 @@ fun BuildSteps.RunAcceptanceTests(providerName : String, path : String, packageN

step(ScriptBuildStep{
name = "Pre-Sweeper"
scriptContent = "go test -v \"$providerPath\" -sweep=\"%SWEEPER_REGIONS%\" -sweep-allow-failures -sweep-run=\"%SWEEP_RUN%\" -timeout 30m"
scriptContent = "go test -v \"%PACKAGE_PATH%\" -sweep=\"%SWEEPER_REGIONS%\" -sweep-allow-failures -sweep-run=\"%SWEEP_RUN%\" -timeout 30m"
})

if (useTeamCityGoTest) {
Expand All @@ -89,7 +88,7 @@ fun BuildSteps.RunAcceptanceTests(providerName : String, path : String, packageN

step(ScriptBuildStep{
name = "Post-Sweeper"
scriptContent = "go test -v \"$providerPath\" -sweep=\"%SWEEPER_REGIONS%\" -sweep-allow-failures -sweep-run=\"%SWEEP_RUN%\" -timeout 30m"
scriptContent = "go test -v \"%PACKAGE_PATH%\" -sweep=\"%SWEEPER_REGIONS%\" -sweep-allow-failures -sweep-run=\"%SWEEP_RUN%\" -timeout 30m"
})
}

Expand Down

0 comments on commit b2f8a98

Please sign in to comment.