Skip to content

Commit 6a799bd

Browse files
authored
Merge pull request #119 from mkocher/clean-up-tests
Clean up tests
2 parents cdc0907 + 0a18ee1 commit 6a799bd

File tree

8 files changed

+7
-189
lines changed

8 files changed

+7
-189
lines changed

acceptance_test/assets/bwats-release/jobs/slow-compile/monit

Lines changed: 0 additions & 9 deletions
This file was deleted.

acceptance_test/assets/bwats-release/jobs/slow-compile/spec

Lines changed: 0 additions & 10 deletions
This file was deleted.

acceptance_test/assets/bwats-release/jobs/slow-compile/templates/run.ps1

Lines changed: 0 additions & 6 deletions
This file was deleted.

acceptance_test/assets/bwats-release/packages/slow-compile/packaging

Lines changed: 0 additions & 20 deletions
This file was deleted.

acceptance_test/assets/bwats-release/packages/slow-compile/spec

Lines changed: 0 additions & 8 deletions
This file was deleted.

acceptance_test/assets/bwats-release/src/slow-compile/main.go

Lines changed: 0 additions & 40 deletions
This file was deleted.

acceptance_test/assets/slow-compile-manifest.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

acceptance_test/main_test.go

Lines changed: 7 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,16 @@ const GoZipFile = "go1.12.7.windows-amd64.zip"
2525
const GolangURL = "https://storage.googleapis.com/golang/" + GoZipFile
2626
const LgpoUrl = "https://download.microsoft.com/download/8/5/C/85C25433-A1B0-4FFA-9429-7E023E7DA8D8/LGPO.zip"
2727
const lgpoFile = "LGPO.exe"
28-
const redeployRetries = 10
29-
3028
const windowsVersion = "windows-2019"
3129

3230
var (
33-
boshCommand *BoshCommand
34-
deploymentName string
35-
manifestPath string
36-
stemcellName string
37-
stemcellVersion string
38-
releaseVersion string
39-
tightLoopStemcellVersions []string
40-
testConfig *TestConfig
31+
boshCommand *BoshCommand
32+
deploymentName string
33+
manifestPath string
34+
stemcellName string
35+
stemcellVersion string
36+
releaseVersion string
37+
testConfig *TestConfig
4138
)
4239

4340
var _ = BeforeSuite(func() {
@@ -78,14 +75,6 @@ var _ = BeforeSuite(func() {
7875
})
7976

8077
var _ = AfterSuite(func() {
81-
// Delete the releases created by the tight loop test
82-
for index, version := range tightLoopStemcellVersions {
83-
if index == len(tightLoopStemcellVersions)-1 {
84-
continue // Last release is still being used by the deployment, so it cannot be deleted yet
85-
}
86-
err := boshCommand.Run(fmt.Sprintf("delete-release bwats-release/%s", version))
87-
Expect(err).NotTo(HaveOccurred())
88-
}
8978
if testConfig.SkipCleanup {
9079
return
9180
}
@@ -96,11 +85,6 @@ var _ = AfterSuite(func() {
9685
Expect(err).NotTo(HaveOccurred())
9786
err = boshCommand.Run(fmt.Sprintf("delete-release bwats-release/%s", releaseVersion))
9887
Expect(err).NotTo(HaveOccurred())
99-
if len(tightLoopStemcellVersions) != 0 {
100-
releaseVersion := tightLoopStemcellVersions[len(tightLoopStemcellVersions)-1]
101-
err = boshCommand.Run(fmt.Sprintf("delete-release bwats-release/%s", releaseVersion))
102-
Expect(err).NotTo(HaveOccurred())
103-
}
10488

10589
if boshCommand.CertPath != "" {
10690
Expect(os.RemoveAll(boshCommand.CertPath)).To(Succeed())
@@ -115,29 +99,6 @@ var _ = Describe("BOSH Windows", func() {
11599
).WithTimeout(time.Second * 65).Should(gbytes.Say("60 seconds passed"))
116100
})
117101

118-
It("successfully runs redeploy in a tight loop", func() {
119-
pwd, err := os.Getwd()
120-
Expect(err).To(BeNil())
121-
releaseDir := filepath.Join(pwd, "assets", "bwats-release")
122-
123-
for i := 0; i < redeployRetries; i++ {
124-
By(fmt.Sprintf("Redeploy attempt: #%d\n", i))
125-
126-
releaseVersion := fmt.Sprintf("0.dev+%s", getTimestamp())
127-
tightLoopStemcellVersions = append(tightLoopStemcellVersions, releaseVersion)
128-
Expect(boshCommand.RunIn(fmt.Sprintf("create-release --force --version %s", releaseVersion), releaseDir)).To(Succeed())
129-
130-
Expect(boshCommand.RunIn("upload-release", releaseDir)).To(Succeed())
131-
132-
err = testConfig.deploy(boshCommand, deploymentName, stemcellVersion, releaseVersion)
133-
134-
if err != nil {
135-
downloadLogs("check-multiple", "simple-job", 0, boshCommand)
136-
Fail(err.Error())
137-
}
138-
}
139-
})
140-
141102
It("checks system dependencies and security, auto update has turned off, currently has a Service StartType of 'Manual' and initially had a StartType of 'Delayed', and password is randomized", func() {
142103
err := boshCommand.RunErrand("check-system", deploymentName)
143104
Expect(err).NotTo(HaveOccurred())
@@ -158,26 +119,6 @@ var _ = Describe("BOSH Windows", func() {
158119
Expect(err).NotTo(HaveOccurred())
159120
})
160121

161-
Context("slow compiling go package", func() {
162-
var slowCompilingDeploymentName string
163-
164-
AfterEach(func() {
165-
err := boshCommand.Run(fmt.Sprintf("--deployment=%s delete-deployment", slowCompilingDeploymentName))
166-
Expect(err).NotTo(HaveOccurred())
167-
})
168-
169-
It("deploys when there is a slow to compile go package", func() {
170-
pwd, err := os.Getwd()
171-
Expect(err).NotTo(HaveOccurred())
172-
manifestPath = filepath.Join(pwd, "assets", "slow-compile-manifest.yml")
173-
174-
slowCompilingDeploymentName = buildDeploymentName("stemcell-acceptance-test-slow-compile")
175-
176-
err = testConfig.deployWithManifest(boshCommand, slowCompilingDeploymentName, stemcellVersion, releaseVersion, manifestPath)
177-
Expect(err).NotTo(HaveOccurred())
178-
})
179-
})
180-
181122
Context("ssh enabled", func() {
182123
It("allows SSH connection", func() {
183124
err := boshCommand.Run(fmt.Sprintf("--deployment=%s ssh --opts=-T --command=exit", deploymentName))

0 commit comments

Comments
 (0)