github.com/liamawhite/cli-with-i18n@v6.32.1-0.20171122084555-dede0a5c3448+incompatible/integration/push/deprecated_manifest_trigger_test.go (about)

     1  package push
     2  
     3  import (
     4  	"path/filepath"
     5  
     6  	"github.com/liamawhite/cli-with-i18n/integration/helpers"
     7  
     8  	. "github.com/onsi/ginkgo"
     9  	. "github.com/onsi/gomega"
    10  	. "github.com/onsi/gomega/gbytes"
    11  	. "github.com/onsi/gomega/gexec"
    12  )
    13  
    14  var _ = Describe("triggering legacy push", func() {
    15  	var (
    16  		appName       string
    17  		host          string
    18  		defaultDomain string
    19  	)
    20  
    21  	BeforeEach(func() {
    22  		appName = helpers.NewAppName()
    23  		host = helpers.NewAppName()
    24  		defaultDomain = defaultSharedDomain()
    25  	})
    26  
    27  	Context("when there are global properties in the manifest", func() {
    28  		It("triggering old push with deprecation warning", func() {
    29  			helpers.WithHelloWorldApp(func(dir string) {
    30  				helpers.WriteManifest(filepath.Join(dir, "manifest.yml"), map[string]interface{}{
    31  					"host": host,
    32  					"applications": []map[string]string{
    33  						{
    34  							"name": appName,
    35  						},
    36  					},
    37  				})
    38  
    39  				session := helpers.CustomCF(helpers.CFEnv{WorkingDirectory: dir}, PushCommandName)
    40  				Eventually(session.Err).Should(Say("\\*\\*\\* Global attributes/inheritance in app manifest are not supported in v2-push, delegating to old push \\*\\*\\*"))
    41  				Eventually(session).Should(Say("Creating route %s\\.%s", host, defaultDomain))
    42  			})
    43  		})
    44  	})
    45  
    46  	Context("when there is an 'inherit' property in the manifest", func() {
    47  		It("triggering old push with deprecation warning", func() {
    48  			helpers.WithHelloWorldApp(func(dir string) {
    49  				helpers.WriteManifest(filepath.Join(dir, "parent.yml"), map[string]interface{}{
    50  					"host": host,
    51  				})
    52  
    53  				helpers.WriteManifest(filepath.Join(dir, "manifest.yml"), map[string]interface{}{
    54  					"inherit": "./parent.yml",
    55  					"applications": []map[string]string{
    56  						{
    57  							"name": appName,
    58  						},
    59  					},
    60  				})
    61  
    62  				session := helpers.CustomCF(helpers.CFEnv{WorkingDirectory: dir}, PushCommandName)
    63  				Eventually(session.Err).Should(Say("\\*\\*\\* Global attributes/inheritance in app manifest are not supported in v2-push, delegating to old push \\*\\*\\*"))
    64  				Eventually(session).Should(Say("Creating route %s\\.%s", host, defaultDomain))
    65  				Eventually(session).Should(Say("OK"))
    66  				Eventually(session).Should(Exit(0))
    67  			})
    68  		})
    69  	})
    70  })