Skip to content

Commit d9c73af

Browse files
Tyler Phelanastrieanna
authored andcommitted
Only run brats tests on windows that work
- We now run the tests against all stacks [#144938923] Signed-off-by: Leah Hanson <lhanson@pivotal.io>
1 parent e03c12e commit d9c73af

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

src/binary/brats/brats_suite_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ func CopyBrats(_version string) *cutlass.App {
5454
return cutlass.New(dir)
5555
}
5656

57+
func CopyBratsWindows(_version string) *cutlass.App {
58+
dir, err := cutlass.CopyFixture(filepath.Join(bratshelper.Data.BpDir, "fixtures", "windows_app"))
59+
Expect(err).ToNot(HaveOccurred())
60+
return cutlass.New(dir)
61+
}
62+
5763
func PushApp(app *cutlass.App) {
5864
Expect(app.Push()).To(Succeed())
5965
Eventually(app.InstanceStates, 20*time.Second).Should(Equal([]string{"RUNNING"}))
@@ -64,3 +70,12 @@ func ApiHasStackAssociation() bool {
6470
Expect(err).NotTo(HaveOccurred())
6571
return supported
6672
}
73+
74+
func CanRunForOneOfStacks(stacks ...string) bool {
75+
for _, stack := range stacks {
76+
if os.Getenv("CF_STACK") == stack {
77+
return true
78+
}
79+
}
80+
return false
81+
}

src/binary/brats/brats_test.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@ package brats_test
22

33
import (
44
"github.com/cloudfoundry/libbuildpack/bratshelper"
5+
"github.com/cloudfoundry/libbuildpack/cutlass"
56
. "github.com/onsi/ginkgo"
67
)
78

89
var _ = Describe("Binary buildpack", func() {
9-
bratshelper.UnbuiltBuildpack("", CopyBrats)
10-
bratshelper.DeployingAnAppWithAnUpdatedVersionOfTheSameBuildpack(CopyBrats)
11-
bratshelper.DeployAppWithExecutableProfileScript("", CopyBrats)
12-
bratshelper.DeployAnAppWithSensitiveEnvironmentVariables(CopyBrats)
10+
var copyBrats (func(string) *cutlass.App)
11+
if CanRunForOneOfStacks("cflinuxfs2", "cflinuxfs3") {
12+
copyBrats = CopyBrats
13+
bratshelper.UnbuiltBuildpack("", copyBrats)
14+
bratshelper.DeployAppWithExecutableProfileScript("", copyBrats)
15+
bratshelper.DeployingAnAppWithAnUpdatedVersionOfTheSameBuildpack(copyBrats)
16+
} else {
17+
copyBrats = CopyBratsWindows
18+
}
19+
20+
bratshelper.DeployAnAppWithSensitiveEnvironmentVariables(copyBrats)
21+
1322
})

0 commit comments

Comments
 (0)