Skip to content

Commit 6626b6a

Browse files
committed
acceptance_test: remove auto-generated pre-start content
It seems like there was at one point some code in acceptance_test/main_test.go which updated the simple-job/pre-start.ps1 to include a counter which was incremented when redeploys happened. While some related code exists (file Open) nothing is ever written to that file. This change removes the seemingly auto-generated content in pre-start.ps1 and replaces it with something that prints a date.
1 parent 31b4132 commit 6626b6a

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Write-Host "Running pre-start script..."
2-
Write-Host "Redeploy attempt #0"Write-Host "Redeploy attempt #1"Write-Host "Redeploy attempt #2"Write-Host "Redeploy attempt #3"Write-Host "Redeploy attempt #4"Write-Host "Redeploy attempt #5"Write-Host "Redeploy attempt #6"Write-Host "Redeploy attempt #7"Write-Host "Redeploy attempt #8"Write-Host "Redeploy attempt #9"
2+
Write-Host "The time is $(Get-Date)"
3+
Write-Host "Finishing pre-start script..."

acceptance_test/main_test.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,8 @@ var _ = Describe("BOSH Windows", func() {
118118
Expect(err).To(BeNil())
119119
releaseDir := filepath.Join(pwd, "assets", "bwats-release")
120120

121-
f, err := os.OpenFile(filepath.Join(releaseDir, "jobs", "simple-job", "templates", "pre-start.ps1"),
122-
os.O_APPEND|os.O_WRONLY, 0600)
123-
Expect(err).ToNot(HaveOccurred())
124-
defer f.Close() //nolint:errcheck
125-
126121
for i := 0; i < redeployRetries; i++ {
127-
GinkgoWriter.Printf("Redeploy attempt: #%d\n", i)
122+
By(fmt.Sprintf("Redeploy attempt: #%d\n", i))
128123

129124
version := fmt.Sprintf("0.dev+%d", getTimestampInMs())
130125
tightLoopStemcellVersions = append(tightLoopStemcellVersions, version)
@@ -234,9 +229,7 @@ type StemcellYML struct {
234229

235230
func fetchStemcellInfo(stemcellPath string) (StemcellYML, error) {
236231
var stemcellInfo StemcellYML
237-
tempDir, err := os.MkdirTemp("", "")
238-
Expect(err).NotTo(HaveOccurred())
239-
defer os.RemoveAll(tempDir) //nolint:errcheck
232+
tempDir := GinkgoT().TempDir()
240233

241234
cmd := exec.Command("tar", "xf", stemcellPath, "-C", tempDir, "stemcell.MF")
242235
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)

0 commit comments

Comments
 (0)