github.com/loafoe/cli@v7.1.0+incompatible/integration/v6/push/multiple_apps_in_manifest_test.go (about)

     1  package push
     2  
     3  import (
     4  	"path/filepath"
     5  
     6  	"code.cloudfoundry.org/cli/integration/helpers"
     7  	. "github.com/onsi/ginkgo"
     8  	. "github.com/onsi/gomega"
     9  	. "github.com/onsi/gomega/gbytes"
    10  	. "github.com/onsi/gomega/gexec"
    11  )
    12  
    13  var _ = Describe("pushes multiple apps with a single manifest file", func() {
    14  	var (
    15  		firstApp  string
    16  		secondApp string
    17  	)
    18  
    19  	BeforeEach(func() {
    20  		firstApp = helpers.NewAppName()
    21  		secondApp = helpers.NewAppName()
    22  	})
    23  
    24  	When("the apps are new", func() {
    25  		Context("with no global properties", func() {
    26  			It("pushes multiple apps with a single push", func() {
    27  				helpers.WithHelloWorldApp(func(dir string) {
    28  					helpers.WriteManifest(filepath.Join(dir, "manifest.yml"), map[string]interface{}{
    29  						"applications": []map[string]string{
    30  							{
    31  								"name": firstApp,
    32  							},
    33  							{
    34  								"name": secondApp,
    35  							},
    36  						},
    37  					})
    38  
    39  					session := helpers.CustomCF(helpers.CFEnv{WorkingDirectory: dir}, PushCommandName)
    40  					Eventually(session).Should(Say(`Getting app info\.\.\.`))
    41  
    42  					// firstApp
    43  					Eventually(session).Should(Say(`Creating app with these attributes\.\.\.`))
    44  					Eventually(session).Should(Say(`\+\s+name:\s+%s`, firstApp))
    45  					Eventually(session).Should(Say(`\s+routes:`))
    46  					Eventually(session).Should(Say(`(?i)\+\s+%s.%s`, firstApp, helpers.DefaultSharedDomain()))
    47  
    48  					// secondApp
    49  					Eventually(session).Should(Say(`Creating app with these attributes\.\.\.`))
    50  					Eventually(session).Should(Say(`\+\s+name:\s+%s`, secondApp))
    51  					Eventually(session).Should(Say(`\s+routes:`))
    52  					Eventually(session).Should(Say(`(?i)\+\s+%s.%s`, secondApp, helpers.DefaultSharedDomain()))
    53  
    54  					Eventually(session).Should(Say(`Creating app %s\.\.\.`, firstApp))
    55  					Eventually(session).Should(Say(`Mapping routes\.\.\.`))
    56  					Eventually(session).Should(Say(`Uploading files\.\.\.`))
    57  					Eventually(session).Should(Say("100.00%"))
    58  					Eventually(session).Should(Say(`Waiting for API to complete processing files\.\.\.`))
    59  					helpers.ConfirmStagingLogs(session)
    60  					Eventually(session).Should(Say(`Waiting for app to start\.\.\.`))
    61  					Eventually(session).Should(Say(`requested state:\s+started`))
    62  
    63  					Eventually(session).Should(Say(`Creating app %s\.\.\.`, secondApp))
    64  					Eventually(session).Should(Say(`Mapping routes\.\.\.`))
    65  					Eventually(session).Should(Say(`Uploading files\.\.\.`))
    66  					Eventually(session).Should(Say("100.00%"))
    67  					Eventually(session).Should(Say(`Waiting for API to complete processing files\.\.\.`))
    68  					helpers.ConfirmStagingLogs(session)
    69  					Eventually(session).Should(Say(`Waiting for app to start\.\.\.`))
    70  					Eventually(session).Should(Say(`requested state:\s+started`))
    71  					Eventually(session).Should(Exit(0))
    72  				})
    73  
    74  				session := helpers.CF("app", firstApp)
    75  				Eventually(session).Should(Say(`name:\s+%s`, firstApp))
    76  				Eventually(session).Should(Exit(0))
    77  
    78  				session = helpers.CF("app", secondApp)
    79  				Eventually(session).Should(Say(`name:\s+%s`, secondApp))
    80  				Eventually(session).Should(Exit(0))
    81  			})
    82  		})
    83  	})
    84  })