Update libbuildpack and fix tests · ivanmir/python-buildpack@82e0934 · GitHub
Skip to content

Commit 82e0934

Browse files
Update libbuildpack and fix tests
1 parent b329672 commit 82e0934

92 files changed

Lines changed: 8662 additions & 1776 deletions

File tree

Some content is hidden

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

scripts/brats.sh

Lines changed: 1 addition & 0 deletions

src/python/Gopkg.lock

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

src/python/brats/brats_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func init() {
2525

2626
var _ = SynchronizedBeforeSuite(func() []byte {
2727
// Run once
28-
return bratshelper.InitBpData("").Marshal()
28+
return bratshelper.InitBpData(os.Getenv("CF_STACK")).Marshal()
2929
}, func(data []byte) {
3030
// Run on all nodes
3131
bratshelper.Data.Unmarshal(data)

src/python/conda/conda.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Stager interface {
2323
WriteProfileD(string, string) error
2424
}
2525

26-
type Manifest interface {
26+
type Installer interface {
2727
InstallOnlyVersion(string, string) error
2828
}
2929

@@ -33,18 +33,18 @@ type Command interface {
3333
}
3434

3535
type Conda struct {
36-
Manifest Manifest
37-
Stager Stager
38-
Command Command
39-
Log *libbuildpack.Logger
36+
Installer Installer
37+
Stager Stager
38+
Command Command
39+
Log *libbuildpack.Logger
4040
}
4141

42-
func New(m Manifest, s Stager, c Command, l *libbuildpack.Logger) *Conda {
42+
func New(i Installer, s Stager, c Command, l *libbuildpack.Logger) *Conda {
4343
return &Conda{
44-
Manifest: m,
45-
Stager: s,
46-
Command: c,
47-
Log: l,
44+
Installer: i,
45+
Stager: s,
46+
Command: c,
47+
Log: l,
4848
}
4949
}
5050

@@ -100,7 +100,7 @@ func (c *Conda) Install(version string) error {
100100
defer os.RemoveAll(installerDir)
101101
}
102102

103-
if err := c.Manifest.InstallOnlyVersion(version, installer); err != nil {
103+
if err := c.Installer.InstallOnlyVersion(version, installer); err != nil {
104104
return fmt.Errorf("Error downloading miniconda: %v", err)
105105
}
106106
if err := os.Chmod(installer, 0755); err != nil {

src/python/conda/conda_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ import (
2020

2121
var _ = Describe("Conda", func() {
2222
var (
23-
err error
24-
buildDir string
25-
cacheDir string
26-
depsDir string
27-
depsIdx string
28-
depDir string
29-
subject *conda.Conda
30-
logger *libbuildpack.Logger
31-
buffer *bytes.Buffer
32-
mockCtrl *gomock.Controller
33-
mockManifest *MockManifest
34-
mockStager *MockStager
35-
mockCommand *MockCommand
23+
err error
24+
buildDir string
25+
cacheDir string
26+
depsDir string
27+
depsIdx string
28+
depDir string
29+
subject *conda.Conda
30+
logger *libbuildpack.Logger
31+
buffer *bytes.Buffer
32+
mockCtrl *gomock.Controller
33+
mockInstaller *MockInstaller
34+
mockStager *MockStager
35+
mockCommand *MockCommand
3636
)
3737

3838
BeforeEach(func() {
@@ -46,7 +46,7 @@ var _ = Describe("Conda", func() {
4646
depDir = filepath.Join(depsDir, depsIdx)
4747

4848
mockCtrl = gomock.NewController(GinkgoT())
49-
mockManifest = NewMockManifest(mockCtrl)
49+
mockInstaller = NewMockInstaller(mockCtrl)
5050
mockStager = NewMockStager(mockCtrl)
5151
mockStager.EXPECT().BuildDir().AnyTimes().Return(buildDir)
5252
mockStager.EXPECT().CacheDir().AnyTimes().Return(cacheDir)
@@ -57,7 +57,7 @@ var _ = Describe("Conda", func() {
5757
buffer = new(bytes.Buffer)
5858
logger = libbuildpack.NewLogger(ansicleaner.New(buffer))
5959

60-
subject = conda.New(mockManifest, mockStager, mockCommand, logger)
60+
subject = conda.New(mockInstaller, mockStager, mockCommand, logger)
6161
})
6262

6363
AfterEach(func() {
@@ -93,7 +93,7 @@ var _ = Describe("Conda", func() {
9393

9494
Describe("Install", func() {
9595
It("downloads and installs miniconda version", func() {
96-
mockManifest.EXPECT().InstallOnlyVersion("Miniconda7", gomock.Any()).Do(func(_, path string) {
96+
mockInstaller.EXPECT().InstallOnlyVersion("Miniconda7", gomock.Any()).Do(func(_, path string) {
9797
Expect(ioutil.WriteFile(path, []byte{}, 0644)).To(Succeed())
9898
})
9999
mockCommand.EXPECT().Execute("/", gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any())
@@ -102,7 +102,7 @@ var _ = Describe("Conda", func() {
102102
})
103103

104104
It("make downloaded file executable", func() {
105-
mockManifest.EXPECT().InstallOnlyVersion("Miniconda7", gomock.Any()).Do(func(_, path string) {
105+
mockInstaller.EXPECT().InstallOnlyVersion("Miniconda7", gomock.Any()).Do(func(_, path string) {
106106
Expect(ioutil.WriteFile(path, []byte{}, 0644)).To(Succeed())
107107
})
108108
mockCommand.EXPECT().Execute("/", gomock.Any(), gomock.Any(), gomock.Any(), "-b", "-p", filepath.Join(depDir, "conda")).Do(func(_ string, _, _ io.Writer, path, _, _, _ string) {
@@ -116,7 +116,7 @@ var _ = Describe("Conda", func() {
116116

117117
It("deletes installer", func() {
118118
var installerPath string
119-
mockManifest.EXPECT().InstallOnlyVersion("Miniconda7", gomock.Any()).Do(func(_, path string) {
119+
mockInstaller.EXPECT().InstallOnlyVersion("Miniconda7", gomock.Any()).Do(func(_, path string) {
120120
Expect(ioutil.WriteFile(path, []byte{}, 0644)).To(Succeed())
121121
installerPath = path
122122
})

src/python/conda/mocks_test.go

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

src/python/integration/deploy_a_python_app_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ var _ = Describe("CF Python Buildpack", func() {
3131
Expect(app.Push()).ToNot(Succeed())
3232
Expect(app.ConfirmBuildpack(buildpackVersion)).To(Succeed())
3333

34-
Expect(app.Stdout.String()).To(ContainSubstring("Could not install python: no match found for 99.99.99"))
35-
Expect(app.Stdout.String()).ToNot(ContainSubstring("-----> Installing"))
34+
Eventually(app.Stdout.String()).Should(ContainSubstring("Could not install python: no match found for 99.99.99"))
35+
Eventually(app.Stdout.String()).ShouldNot(ContainSubstring("-----> Installing"))
3636
})
3737
})
3838

src/python/integration/integration_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func init() {
3434
var _ = SynchronizedBeforeSuite(func() []byte {
3535
// Run once
3636
if buildpackVersion == "" {
37-
packagedBuildpack, err := cutlass.PackageUniquelyVersionedBuildpack("")
37+
packagedBuildpack, err := cutlass.PackageUniquelyVersionedBuildpack("cflinuxfs2")
3838
Expect(err).NotTo(HaveOccurred())
3939

4040
data, err := json.Marshal(packagedBuildpack)

src/python/supply/cli/main.go

Lines changed: 10 additions & 8 deletions

0 commit comments

Comments
 (0)