Skip to content

Commit b4843bb

Browse files
authored
Fix fs3 tests (#873)
* Update gomod deps * Add go_buildpack to the list of buildpacks used for tests
1 parent 8fc8477 commit b4843bb

48 files changed

Lines changed: 462 additions & 1650 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/onsi/ginkgo v1.16.5
1111
github.com/onsi/gomega v1.30.0
1212
github.com/sclevine/spec v1.4.0
13-
golang.org/x/crypto v0.16.0
13+
golang.org/x/crypto v0.18.0
1414
gopkg.in/ini.v1 v1.67.0
1515
)
1616

@@ -22,7 +22,7 @@ require (
2222
github.com/distribution/reference v0.5.0 // indirect
2323
github.com/docker/distribution v2.8.3+incompatible // indirect
2424
github.com/docker/docker v24.0.7+incompatible // indirect
25-
github.com/docker/go-connections v0.4.0 // indirect
25+
github.com/docker/go-connections v0.5.0 // indirect
2626
github.com/docker/go-units v0.5.0 // indirect
2727
github.com/elazarl/goproxy v0.0.0-20231117061959-7cc037d33fb5 // indirect
2828
github.com/elazarl/goproxy/ext v0.0.0-20191011121108-aa519ddbe484 // indirect
@@ -42,10 +42,10 @@ require (
4242
github.com/tidwall/pretty v1.2.1 // indirect
4343
github.com/ulikunitz/xz v0.5.11 // indirect
4444
golang.org/x/mod v0.14.0 // indirect
45-
golang.org/x/net v0.19.0 // indirect
46-
golang.org/x/sys v0.15.0 // indirect
45+
golang.org/x/net v0.20.0 // indirect
46+
golang.org/x/sys v0.16.0 // indirect
4747
golang.org/x/text v0.14.0 // indirect
48-
golang.org/x/tools v0.16.0 // indirect
48+
golang.org/x/tools v0.16.1 // indirect
4949
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
5050
gopkg.in/yaml.v2 v2.4.0 // indirect
5151
gopkg.in/yaml.v3 v3.0.1 // indirect

go.sum

Lines changed: 14 additions & 44 deletions
Large diffs are not rendered by default.

src/python/integration/init_test.go

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ package integration_test
22

33
import (
44
"flag"
5+
"fmt"
56
"github.com/onsi/gomega/types"
7+
"io"
8+
"net/http"
69
"os"
710
"path/filepath"
811
"testing"
@@ -53,6 +56,9 @@ func TestIntegration(t *testing.T) {
5356
platform, err := switchblade.NewPlatform(settings.Platform, settings.GitHubToken, settings.Stack)
5457
Expect(err).NotTo(HaveOccurred())
5558

59+
goBuildpackFile, err := downloadBuildpack("go")
60+
Expect(err).NotTo(HaveOccurred())
61+
5662
err = platform.Initialize(
5763
switchblade.Buildpack{
5864
Name: "python_buildpack",
@@ -62,6 +68,11 @@ func TestIntegration(t *testing.T) {
6268
Name: "override_buildpack",
6369
URI: filepath.Join(fixtures, "util", "override_buildpack"),
6470
},
71+
// Go buildpack is needed for the proxy and the dynatrace apps
72+
switchblade.Buildpack{
73+
Name: "go_buildpack",
74+
URI: goBuildpackFile,
75+
},
6576
)
6677
Expect(err).NotTo(HaveOccurred())
6778

@@ -70,12 +81,6 @@ func TestIntegration(t *testing.T) {
7081

7182
proxyDeploymentProcess := platform.Deploy.WithBuildpacks("go_buildpack")
7283

73-
// TODO: remove this once go-buildpack runs on cflinuxfs4
74-
// This is done to have the proxy app written in go up and running
75-
if settings.Stack == "cflinuxfs4" {
76-
proxyDeploymentProcess = proxyDeploymentProcess.WithStack("cflinuxfs3")
77-
}
78-
7984
proxyDeployment, _, err := proxyDeploymentProcess.
8085
Execute(proxyName, filepath.Join(fixtures, "util", "proxy"))
8186
Expect(err).NotTo(HaveOccurred())
@@ -85,12 +90,6 @@ func TestIntegration(t *testing.T) {
8590

8691
dynatraceDeploymentProcess := platform.Deploy.WithBuildpacks("go_buildpack")
8792

88-
// TODO: remove this once go-buildpack runs on cflinuxfs4
89-
// This is done to have the dynatrace broker app app written in go up and running
90-
if settings.Stack == "cflinuxfs4" {
91-
dynatraceDeploymentProcess = dynatraceDeploymentProcess.WithStack("cflinuxfs3")
92-
}
93-
9493
dynatraceDeployment, _, err := dynatraceDeploymentProcess.
9594
Execute(dynatraceName, filepath.Join(fixtures, "util", "dynatrace"))
9695
Expect(err).NotTo(HaveOccurred())
@@ -121,6 +120,26 @@ func TestIntegration(t *testing.T) {
121120
Expect(platform.Delete.Execute(proxyName)).To(Succeed())
122121
Expect(platform.Delete.Execute(dynatraceName)).To(Succeed())
123122
Expect(os.Remove(os.Getenv("BUILDPACK_FILE"))).To(Succeed())
123+
Expect(os.Remove(goBuildpackFile)).To(Succeed())
124+
}
125+
126+
func downloadBuildpack(name string) (string, error) {
127+
uri := fmt.Sprintf("https://github.com/cloudfoundry/%s-buildpack/archive/master.zip", name)
128+
129+
file, err := os.CreateTemp("", fmt.Sprintf("%s-buildpack-*.zip", name))
130+
if err != nil {
131+
return "", err
132+
}
133+
defer file.Close()
134+
135+
resp, err := http.Get(uri)
136+
if err != nil {
137+
return "", err
138+
}
139+
defer resp.Body.Close()
140+
141+
_, err = io.Copy(file, resp.Body)
142+
return file.Name(), err
124143
}
125144

126145
func CreateRequirementsTxtFile(Expect func(actual interface{}, extra ...interface{}) types.Assertion, path string, fileName string, modules ...string) {

vendor/github.com/docker/go-connections/nat/nat.go

Lines changed: 19 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/go-connections/nat/parse.go

Lines changed: 2 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/go-connections/nat/sort.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/go-connections/sockets/proxy.go

Lines changed: 8 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/go-connections/sockets/sockets.go

Lines changed: 11 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/go-connections/sockets/sockets_unix.go

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)