github.com/deis/workflow-e2e@v2.12.2-0.20180227201524-4105be7001fe+incompatible/tests/buildpacks_test.go (about) 1 package tests 2 3 import ( 4 "fmt" 5 "os" 6 "strings" 7 8 "github.com/deis/workflow-e2e/tests/cmd" 9 "github.com/deis/workflow-e2e/tests/cmd/apps" 10 "github.com/deis/workflow-e2e/tests/cmd/auth" 11 "github.com/deis/workflow-e2e/tests/cmd/git" 12 "github.com/deis/workflow-e2e/tests/cmd/keys" 13 "github.com/deis/workflow-e2e/tests/model" 14 15 . "github.com/onsi/ginkgo" 16 . "github.com/onsi/ginkgo/extensions/table" 17 . "github.com/onsi/gomega" 18 ) 19 20 var _ = Describe("all buildpack apps", func() { 21 22 Context("with an existing user", func() { 23 24 var user model.User 25 var keyPath string 26 27 BeforeEach(func() { 28 user = auth.RegisterAndLogin() 29 }) 30 31 AfterEach(func() { 32 auth.Cancel(user) 33 }) 34 35 Context("who has added their public key", func() { 36 37 BeforeEach(func() { 38 _, keyPath = keys.Add(user) 39 }) 40 41 DescribeTable("can deploy an example buildpack app", 42 func(url, buildpack, banner string) { 43 44 var app model.App 45 46 output, err := cmd.Execute(`git clone %s`, url) 47 Expect(err).NotTo(HaveOccurred(), output) 48 // infer app directory from URL 49 splits := strings.Split(url, "/") 50 dir := strings.TrimSuffix(splits[len(splits)-1], ".git") 51 os.Chdir(dir) 52 // create with custom buildpack if needed 53 var args []string 54 if buildpack != "" { 55 args = append(args, fmt.Sprintf("--buildpack %s", buildpack)) 56 } 57 app = apps.Create(user, args...) 58 defer apps.Destroy(user, app) 59 git.Push(user, keyPath, app, banner) 60 61 }, 62 63 // NOTE: Keep this list up-to-date with any example apps that are added 64 // under the github/deis org, or any third-party apps that increase coverage 65 // or prevent regressions. 66 Entry("Clojure", "https://github.com/deis/example-clojure-ring.git", "", 67 "Powered by Deis"), 68 Entry("Go", "https://github.com/deis/example-go.git", "", 69 "Powered by Deis"), 70 Entry("Java", "https://github.com/deis/example-java-jetty.git", "", 71 "Powered by Deis"), 72 Entry("Multi", "https://github.com/deis/example-multi", "", 73 "Heroku Multipack Test"), 74 Entry("NodeJS", "https://github.com/deis/example-nodejs-express.git", "", 75 "Powered by Deis"), 76 Entry("Perl", "https://github.com/deis/example-perl.git", 77 "https://github.com/miyagawa/heroku-buildpack-perl.git", 78 "Powered by Deis"), 79 Entry("PHP", "https://github.com/deis/example-php.git", "", 80 "Powered by Deis"), 81 Entry("Java (Play)", "https://github.com/deis/example-play.git", "", 82 "Powered by Deis"), 83 Entry("Python (Django)", "https://github.com/deis/example-python-django.git", "", 84 "Powered by Deis"), 85 Entry("Python (Flask)", "https://github.com/deis/example-python-flask.git", "", 86 "Powered by Deis"), 87 Entry("Ruby", "https://github.com/deis/example-ruby-sinatra.git", "", 88 "Powered by Deis"), 89 Entry("Scala", "https://github.com/deis/example-scala.git", "", 90 "Powered by Deis"), 91 ) 92 93 }) 94 95 }) 96 97 })