Skip to content

Commit 310daec

Browse files
committed
fix(tests): test custom buildpacks for example Procfile apps
1 parent 7dd6d38 commit 310daec

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

tests/config_test.go

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package tests
44

55
import (
66
"io/ioutil"
7+
"strings"
78
"testing"
89

910
"github.com/deis/deis/tests/utils"
@@ -14,10 +15,24 @@ var (
1415
configSetCmd = "config:set FOO=讲台 --app={{.AppName}}"
1516
configSet2Cmd = "config:set FOO=10 --app={{.AppName}}"
1617
configSet3Cmd = "config:set POWERED_BY=\"the Deis team\" --app={{.AppName}}"
17-
configSetBuildpackCmd = "config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-go#98f37cc --app={{.AppName}}"
18+
configSetBuildpackCmd = "config:set BUILDPACK_URL=$BUILDPACK_URL --app={{.AppName}}"
1819
configUnsetCmd = "config:unset FOO --app={{.AppName}}"
1920
)
2021

22+
var buildpacks = map[string]string{
23+
"example-clojure-ring": "https://github.com/heroku/heroku-buildpack-clojure#v66",
24+
"example-go": "https://github.com/heroku/heroku-buildpack-go#6eeb09f",
25+
"example-java-jetty": "https://github.com/heroku/heroku-buildpack-java#v38",
26+
"example-nodejs-express": "https://github.com/heroku/heroku-buildpack-nodejs#v75",
27+
"example-perl": "https://github.com/miyagawa/heroku-buildpack-perl#2da7480",
28+
"example-php": "https://github.com/heroku/heroku-buildpack-php#v67",
29+
"example-play": "https://github.com/heroku/heroku-buildpack-play#v23",
30+
"example-python-django": "https://github.com/heroku/heroku-buildpack-python#v58",
31+
"example-python-flask": "https://github.com/heroku/heroku-buildpack-python#v58",
32+
"example-ruby-sinatra": "https://github.com/heroku/heroku-buildpack-ruby#v137",
33+
"example-scala": "https://github.com/heroku/heroku-buildpack-scala#v55",
34+
}
35+
2136
func TestConfig(t *testing.T) {
2237
params := configSetup(t)
2338
configSetTest(t, params)
@@ -47,8 +62,14 @@ func configSetup(t *testing.T) *utils.DeisTestConfig {
4762
// ensure envvars with spaces work fine on `git push`
4863
// https://github.com/deis/deis/issues/2477
4964
utils.Execute(t, configSet3Cmd, cfg, false, "the Deis team")
50-
// ensure custom buildpack URLS are in order
51-
utils.Execute(t, configSetBuildpackCmd, cfg, false, "https://github.com/heroku/heroku-buildpack-go#98f37cc")
65+
// ensure custom buildpack URLs are in order
66+
url := buildpacks[cfg.ExampleApp]
67+
if url == "" {
68+
// set url anyway so example-dockerfile apps create a build
69+
url = buildpacks["example-go"]
70+
}
71+
cmd := strings.Replace(configSetBuildpackCmd, "$BUILDPACK_URL", url, 1)
72+
utils.Execute(t, cmd, cfg, false, url)
5273
utils.Execute(t, gitPushCmd, cfg, false, "")
5374
utils.CurlApp(t, *cfg)
5475
utils.CheckList(t, "run env --app={{.AppName}}", cfg, "DEIS_APP", false)

0 commit comments

Comments
 (0)