Skip to content

Commit

Permalink
NOT TO BE MERGED - force builds to make lots of faked debug logs for …
Browse files Browse the repository at this point in the history
…manual testing in TeamCity
  • Loading branch information
SarahFrench committed Oct 22, 2024
1 parent 8a2f11f commit 7b966a7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ class PackageDetails(private val packageName: String, private val displayName: S
}

steps {
setGitCommitBuildId()
tagBuildToIndicateTriggerMethod()
configureGoEnv()
downloadTerraformBinary()
runAcceptanceTests()
saveArtifactsToGCS()
// setGitCommitBuildId()
// tagBuildToIndicateTriggerMethod()
// configureGoEnv()
// downloadTerraformBinary()
// runAcceptanceTests()
// saveArtifactsToGCS()
make1020DebugLogs() // Make build look like lots of tests have run, without needing to actually run tests
archiveArtifactsIfOverLimit() // Must be after push to GCS step, as this step impacts debug log files
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,28 @@ fun BuildSteps.archiveArtifactsIfOverLimit() {
// parts like ${GIT_HASH_SHORT} without having Kotlin syntax issues. For more info see:
// https://youtrack.jetbrains.com/issue/KT-2425/Provide-a-way-for-escaping-the-dollar-sign-symbol-in-multiline-strings-and-string-templates
})
}

// Part of testing my PR - not to be merged!
fun BuildSteps.make1020DebugLogs() {
step(ScriptBuildStep {
name = "Tasks after running nightly tests: archive artifacts(debug logs) if there are >=1000 before S3 upload"
scriptContent = """
#!/bin/bash
echo "Making a build look like it's run >1000 tests and created >1000 debug logs"
// Folder where debug logs are made
cd %teamcity.build.checkoutDir%
// >1000 files that match the %teamcity.build.checkoutDir%/debug* pattern
touch debug-{0..1050}}.txt
# Allow sanity checking
echo "Listing files matching the artifact rule value %teamcity.build.checkoutDir%/debug*"
ls debug*
""".trimIndent()
// ${'$'} is required to allow creating a script in TeamCity that contains
// parts like ${GIT_HASH_SHORT} without having Kotlin syntax issues. For more info see:
// https://youtrack.jetbrains.com/issue/KT-2425/Provide-a-way-for-escaping-the-dollar-sign-symbol-in-multiline-strings-and-string-templates
})
}

0 comments on commit 7b966a7

Please sign in to comment.