Skip to content

Commit b48b42e

Browse files
davewalterBirdrock
andauthored
Merge pull request #432 from cloudfoundry/174257193-cats-continued
Initial work to make the apps suite run on cf-for-k8s [finishes #174542950](https://www.pivotaltracker.com/story/show/174542950) Co-authored-by: Andrew Wittrock <[email protected]>
2 parents e556824 + 8fbb5d5 commit b48b42e

26 files changed

+243
-175
lines changed

apps/admin_buildpack_lifecycle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var _ = AppsDescribe("Admin Buildpacks", func() {
3232
buildpackArchivePath string
3333
)
3434

35-
SkipOnK8s()
35+
SkipOnK8s("Custom buildpacks not supported")
3636

3737
noAppDetectedErrorRegexp := "NoAppDetectedError|An app was not successfully detected by any available buildpack"
3838
buildpackCompileFailedRegexp := "BuildpackCompileFailed|App staging failed in the buildpack compile phase"

apps/app_stack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var _ = AppsDescribe("Specifying a specific stack", func() {
3434
tmpdir string
3535
)
3636

37-
SkipOnK8s()
37+
SkipOnK8s("Custom stacks not yet supported")
3838

3939
matchingFilename := func(appName string) string {
4040
return fmt.Sprintf("stack-match-%s", appName)

apps/app_staging_environment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var _ = AppsDescribe("Buildpack Environment", func() {
3232
tmpdir string
3333
)
3434

35-
SkipOnK8s()
35+
SkipOnK8s("Custom buildpacks not yet supported")
3636

3737
matchingFilename := func(appName string) string {
3838
return fmt.Sprintf("buildpack-environment-match-%s", appName)

apps/buildpack_cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var _ = AppsDescribe("Buildpack cache", func() {
3232
buildpackArchivePath string
3333
)
3434

35-
SkipOnK8s()
35+
SkipOnK8s("Custom buildpacks not yet supported")
3636

3737
matchingFilename := func(appName string) string {
3838
return fmt.Sprintf("buildpack-for-buildpack-cache-test-%s", appName)

apps/changing_start_command.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ var _ = AppsDescribe("Changing an app's start command", func() {
3535
Context("by using the command flag", func() {
3636
var expectedNullResponse string
3737

38+
SkipOnK8s("Custom start command not supported")
39+
3840
BeforeEach(func() {
3941

4042
appUrl := "https://" + appName + "." + Config.GetAppsDomain()
@@ -91,6 +93,8 @@ var _ = AppsDescribe("Changing an app's start command", func() {
9193
Resources []AppResource `json:"resources"`
9294
}
9395

96+
SkipOnK8s("Multi-buildpack apps not supported")
97+
9498
BeforeEach(func() {
9599
Expect(cf.Cf("push", appName, "-b", Config.GetNodejsBuildpackName(), "-m", DEFAULT_MEMORY_LIMIT, "-p", assets.NewAssets().NodeWithProcfile).Wait(Config.CfPushTimeoutDuration())).To(Exit(0))
96100
})

apps/crashing.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import (
1717
var _ = AppsDescribe("Crashing", func() {
1818
var appName string
1919

20+
SkipOnK8s("Multi-buildpack apps not supported")
21+
2022
BeforeEach(func() {
2123
appName = random_name.CATSRandomName("APP")
2224
})

apps/default_environment_variables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ exit 1
6262
var appName string
6363
var buildpackName string
6464

65-
SkipOnK8s()
65+
SkipOnK8s("Custom buildpacks not yet supported")
6666

6767
BeforeEach(func() {
6868
appName = random_name.CATSRandomName("APP")

apps/delete_route.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
1010
"github.com/cloudfoundry-incubator/cf-test-helpers/helpers"
1111
"github.com/cloudfoundry/cf-acceptance-tests/helpers/app_helpers"
12-
"github.com/cloudfoundry/cf-acceptance-tests/helpers/assets"
1312
"github.com/cloudfoundry/cf-acceptance-tests/helpers/random_name"
1413
)
1514

@@ -27,12 +26,10 @@ var _ = AppsDescribe("Delete Route", func() {
2726
nullSession := helpers.CurlSkipSSL(Config.GetSkipSSLValidation(), appUrl).Wait()
2827
expectedNullResponse = string(nullSession.Buffer().Contents())
2928

30-
Expect(cf.Cf("push",
29+
Expect(cf.Cf(app_helpers.CatnipWithArgs(
3130
appName,
32-
"-b", Config.GetBinaryBuildpackName(),
3331
"-m", DEFAULT_MEMORY_LIMIT,
34-
"-p", assets.NewAssets().Catnip,
35-
"-c", "./catnip",
32+
)...,
3633
).Wait(Config.CfPushTimeoutDuration())).To(Exit(0))
3734
Eventually(func() string {
3835
return helpers.CurlAppRoot(Config, appName)

apps/droplet_uploading_and_downloading.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ func unpackTarball(tarballPath string) {
5252
var _ = AppsDescribe("Uploading and Downloading droplets", func() {
5353
var helloWorldAppName string
5454

55+
SkipOnK8s("App droplets not supported")
56+
5557
BeforeEach(func() {
5658
helloWorldAppName = random_name.CATSRandomName("APP")
5759

apps/environment_variables_group.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ exit 1
102102
var buildpackName string
103103
var envVarName string
104104

105-
SkipOnK8s()
105+
SkipOnK8s("Custom buildpacks not yet supported")
106106

107107
BeforeEach(func() {
108108
appName = random_name.CATSRandomName("APP")
@@ -163,12 +163,9 @@ exit 1
163163
extendEnv("running", envVarName, envVarValue)
164164
})
165165

166-
Expect(cf.Cf("push",
166+
Expect(cf.Cf(app_helpers.CatnipWithArgs(
167167
appName,
168-
"-b", Config.GetBinaryBuildpackName(),
169-
"-m", DEFAULT_MEMORY_LIMIT,
170-
"-p", assets.NewAssets().Catnip,
171-
"-c", "./catnip",
168+
"-m", DEFAULT_MEMORY_LIMIT)...,
172169
).Wait(Config.CfPushTimeoutDuration())).To(Exit(0))
173170

174171
env := helpers.CurlApp(Config, appName, "/env.json")

apps/instance_reporting.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"github.com/cloudfoundry-incubator/cf-test-helpers/workflowhelpers"
66
. "github.com/cloudfoundry/cf-acceptance-tests/cats_suite_helpers"
77
"github.com/cloudfoundry/cf-acceptance-tests/helpers/app_helpers"
8-
"github.com/cloudfoundry/cf-acceptance-tests/helpers/assets"
98
"github.com/cloudfoundry/cf-acceptance-tests/helpers/random_name"
109
. "github.com/onsi/ginkgo"
1110
. "github.com/onsi/gomega"
@@ -24,12 +23,9 @@ var _ = AppsDescribe("Getting instance information", func() {
2423

2524
appName = random_name.CATSRandomName("APP")
2625

27-
Eventually(cf.Cf(
28-
"push", appName,
29-
"-p", assets.NewAssets().Binary,
30-
"-b", "binary_buildpack",
31-
"-m", DEFAULT_MEMORY_LIMIT,
32-
"-c", "./app"),
26+
Eventually(cf.Cf(app_helpers.BinaryWithArgs(
27+
appName,
28+
"-m", DEFAULT_MEMORY_LIMIT)...),
3329
Config.CfPushTimeoutDuration()).Should(Exit(0))
3430
})
3531

@@ -42,7 +38,13 @@ var _ = AppsDescribe("Getting instance information", func() {
4238

4339
It("fails with insufficient resources", func() {
4440
scale := cf.Cf("scale", appName, "-m", workflowhelpers.RUNAWAY_QUOTA_MEM_LIMIT, "-f")
45-
Eventually(scale).Should(Or(Say("insufficient"), Say("down")))
41+
scaleMatch := "insufficient"
42+
43+
if Config.RunningOnK8s() {
44+
scaleMatch = "Insufficient"
45+
}
46+
47+
Eventually(scale).Should(Or(Say(scaleMatch), Say("down")))
4648
scale.Kill()
4749

4850
app := cf.Cf("app", appName)
@@ -57,14 +59,10 @@ var _ = AppsDescribe("Getting instance information", func() {
5759
BeforeEach(func() {
5860
appName = random_name.CATSRandomName("APP")
5961

60-
Expect(cf.Cf("push",
62+
Expect(cf.Cf(app_helpers.CatnipWithArgs(
6163
appName,
62-
"-b", Config.GetBinaryBuildpackName(),
6364
"-m", DEFAULT_MEMORY_LIMIT,
64-
"-p", assets.NewAssets().Catnip,
65-
"-c", "./catnip",
66-
"-i", "1",
67-
).Wait(Config.CfPushTimeoutDuration())).To(Exit(0))
65+
"-i", "1")...).Wait(Config.CfPushTimeoutDuration())).To(Exit(0))
6866
})
6967

7068
AfterEach(func() {

apps/large_payload.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
1212
"github.com/cloudfoundry-incubator/cf-test-helpers/helpers"
1313
"github.com/cloudfoundry/cf-acceptance-tests/helpers/app_helpers"
14-
"github.com/cloudfoundry/cf-acceptance-tests/helpers/assets"
1514
"github.com/cloudfoundry/cf-acceptance-tests/helpers/random_name"
1615
)
1716

@@ -25,12 +24,9 @@ var _ = AppsDescribe("Large_payload", func() {
2524
})
2625
It("should be able to curl for a large response body", func() {
2726
appName = random_name.CATSRandomName("APP")
28-
Expect(cf.Cf("push",
27+
Expect(cf.Cf(app_helpers.CatnipWithArgs(
2928
appName,
30-
"-b", Config.GetBinaryBuildpackName(),
31-
"-m", DEFAULT_MEMORY_LIMIT,
32-
"-p", assets.NewAssets().Catnip,
33-
"-c", "./catnip",
29+
"-m", DEFAULT_MEMORY_LIMIT)...,
3430
).Wait(Config.CfPushTimeoutDuration())).To(Exit(0))
3531

3632
Eventually(func() int {

0 commit comments

Comments
 (0)