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

     1  // +build windows
     2  
     3  package push
     4  
     5  import (
     6  	"path/filepath"
     7  	"regexp"
     8  	"strings"
     9  
    10  	"code.cloudfoundry.org/cli/integration/helpers"
    11  	. "github.com/onsi/ginkgo"
    12  	. "github.com/onsi/gomega"
    13  	. "github.com/onsi/gomega/gbytes"
    14  	. "github.com/onsi/gomega/gexec"
    15  )
    16  
    17  var _ = Describe("pushing a path with the -p flag", func() {
    18  	var (
    19  		appName string
    20  	)
    21  
    22  	BeforeEach(func() {
    23  		appName = helpers.NewAppName()
    24  	})
    25  
    26  	Context(`pushing a relative root path (\)`, func() {
    27  		It("pushes the app from the directory", func() {
    28  			helpers.WithHelloWorldApp(func(appDir string) {
    29  				volumeName := filepath.VolumeName(appDir)
    30  				relativeRoot := strings.TrimPrefix(appDir, volumeName)
    31  				Expect(strings.HasPrefix(relativeRoot, `\`))
    32  
    33  				session := helpers.CF(PushCommandName, appName, "-p", relativeRoot)
    34  				Eventually(session).Should(Say(`Getting app info\.\.\.`))
    35  				Eventually(session).Should(Say(`Creating app with these attributes\.\.\.`))
    36  				Eventually(session).Should(helpers.SayPath(`path:\s+%s`, appDir))
    37  				Eventually(session).Should(Say("routes:"))
    38  				Eventually(session).Should(Say(`Mapping routes\.\.\.`))
    39  				Eventually(session).Should(Say(`Comparing local files to remote cache\.\.\.`))
    40  				Eventually(session).Should(Say(`Packaging files to upload\.\.\.`))
    41  				Eventually(session).Should(Say(`Uploading files\.\.\.`))
    42  				Eventually(session).Should(Say(`Waiting for API to complete processing files\.\.\.`))
    43  				Eventually(session).Should(Say(`Staging app and tracing logs\.\.\.`))
    44  				Eventually(session).Should(Say(`name:\s+%s`, appName))
    45  
    46  				Eventually(session).Should(Exit(0))
    47  			})
    48  		})
    49  	})
    50  })
    51  
    52  var _ = XDescribe("pushing a path from a manifest", func() {
    53  	var (
    54  		appName string
    55  	)
    56  
    57  	BeforeEach(func() {
    58  		appName = helpers.NewAppName()
    59  	})
    60  
    61  	Context("pushing a relative root path (\\)", func() {
    62  		It("pushes the app from the directory", func() {
    63  			helpers.WithHelloWorldApp(func(appDir string) {
    64  				volumeName := filepath.VolumeName(appDir)
    65  				relativeRoot := strings.TrimPrefix(appDir, volumeName)
    66  				Expect(strings.HasPrefix(relativeRoot, `\`))
    67  				helpers.WriteManifest(filepath.Join(appDir, "manifest.yml"), map[string]interface{}{
    68  					"applications": []map[string]interface{}{
    69  						{
    70  							"name": appName,
    71  							"path": relativeRoot,
    72  						},
    73  					},
    74  				})
    75  
    76  				session := helpers.CustomCF(helpers.CFEnv{WorkingDirectory: appDir}, PushCommandName)
    77  				Eventually(session).Should(Say(`Getting app info\.\.\.`))
    78  				Eventually(session).Should(Say(`Creating app with these attributes\.\.\.`))
    79  				Eventually(session).Should(Say(`path:\s+%s`, regexp.QuoteMeta(appDir)))
    80  				Eventually(session).Should(Say("routes:"))
    81  				Eventually(session).Should(Say(`Mapping routes\.\.\.`))
    82  				Eventually(session).Should(Say(`Comparing local files to remote cache\.\.\.`))
    83  				Eventually(session).Should(Say(`Packaging files to upload\.\.\.`))
    84  				Eventually(session).Should(Say(`Uploading files\.\.\.`))
    85  				Eventually(session).Should(Say(`Waiting for API to complete processing files\.\.\.`))
    86  				Eventually(session).Should(Say(`Staging app and tracing logs\.\.\.`))
    87  				Eventually(session).Should(Say(`name:\s+%s`, appName))
    88  
    89  				Eventually(session).Should(Exit(0))
    90  			})
    91  		})
    92  	})
    93  })