From ed4d2f4859a9cf0ddb35b226e38157fc3b6aaed7 Mon Sep 17 00:00:00 2001 From: Weyman Fung Date: Wed, 7 Aug 2019 11:53:03 -0700 Subject: [PATCH] Delete duplicate app crashing test - move app instance scaling test to instance_reporting.go - removed dynamic_info.go [finishes #165291993](https://www.pivotaltracker.com/story/show/165291993) Co-authored-by: Dave Walter --- apps/dynamic_info.go | 63 -------------------------------------- apps/instance_reporting.go | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+), 63 deletions(-) delete mode 100644 apps/dynamic_info.go diff --git a/apps/dynamic_info.go b/apps/dynamic_info.go deleted file mode 100644 index fe236a36f..000000000 --- a/apps/dynamic_info.go +++ /dev/null @@ -1,63 +0,0 @@ -package apps - -import ( - . "github.com/cloudfoundry/cf-acceptance-tests/cats_suite_helpers" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/gbytes" - . "github.com/onsi/gomega/gexec" - - "github.com/cloudfoundry-incubator/cf-test-helpers/cf" - "github.com/cloudfoundry-incubator/cf-test-helpers/helpers" - "github.com/cloudfoundry/cf-acceptance-tests/helpers/app_helpers" - "github.com/cloudfoundry/cf-acceptance-tests/helpers/assets" - "github.com/cloudfoundry/cf-acceptance-tests/helpers/random_name" -) - -var _ = AppsDescribe("A running application", func() { - var appName string - - BeforeEach(func() { - appName = random_name.CATSRandomName("APP") - - Expect(cf.Cf("push", - appName, - "-b", Config.GetBinaryBuildpackName(), - "-m", DEFAULT_MEMORY_LIMIT, - "-p", assets.NewAssets().Catnip, - "-c", "./catnip", - "-d", Config.GetAppsDomain()).Wait(Config.CfPushTimeoutDuration())).To(Exit(0)) - }) - - AfterEach(func() { - app_helpers.AppReport(appName) - - Expect(cf.Cf("delete", appName, "-f", "-r").Wait()).To(Exit(0)) - }) - - It("shows crash events and recovers from crashes", func() { - id := helpers.CurlApp(Config, appName, "/id") - helpers.CurlApp(Config, appName, "/sigterm/KILL") - - Eventually(func() string { - return string(cf.Cf("events", appName).Wait().Out.Contents()) - }).Should(MatchRegexp("app.crash")) - - Eventually(func() string { - return helpers.CurlApp(Config, appName, "/id") - }).Should(Not(Equal(id))) - }) - - Context("with multiple instances", func() { - BeforeEach(func() { - Expect(cf.Cf("scale", appName, "-i", "2").Wait(Config.CfPushTimeoutDuration())).To(Exit(0)) - }) - - It("can be queried for state by instance", func() { - app := cf.Cf("app", appName).Wait() - Expect(app).To(Exit(0)) - Expect(app).To(Say("#0")) - Expect(app).To(Say("#1")) - }) - }) -}) diff --git a/apps/instance_reporting.go b/apps/instance_reporting.go index f8e2fd1b4..76a5d1d4e 100644 --- a/apps/instance_reporting.go +++ b/apps/instance_reporting.go @@ -51,4 +51,36 @@ var _ = AppsDescribe("Getting instance information", func() { Expect(app.Out).NotTo(Say("instances: 1/1")) }) }) + + Describe("Scaling instances", func() { + var appName string + + BeforeEach(func() { + appName = random_name.CATSRandomName("APP") + + Expect(cf.Cf("push", + appName, + "-b", Config.GetBinaryBuildpackName(), + "-m", DEFAULT_MEMORY_LIMIT, + "-p", assets.NewAssets().Catnip, + "-c", "./catnip", + "-i", "1", + "-d", Config.GetAppsDomain()).Wait(Config.CfPushTimeoutDuration())).To(Exit(0)) + }) + + AfterEach(func() { + app_helpers.AppReport(appName) + + Expect(cf.Cf("delete", appName, "-f", "-r").Wait()).To(Exit(0)) + }) + + It("can be queried for state by instance", func() { + Expect(cf.Cf("scale", appName, "-i", "2").Wait(Config.CfPushTimeoutDuration())).To(Exit(0)) + + app := cf.Cf("app", appName).Wait() + Expect(app).To(Exit(0)) + Expect(app).To(Say("#0")) + Expect(app).To(Say("#1")) + }) + }) })