Skip to content

Commit a2654e3

Browse files
Ryan MoranForestEckhardt
Ryan Moran
authored andcommitted
Assume the buildpack is built with packit
1 parent 2837bff commit a2654e3

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

packing_tools.go

-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package freezer
22

33
import (
4-
"fmt"
54
"os"
65
"path/filepath"
76

@@ -29,11 +28,6 @@ func (p PackingTools) WithExecutable(executable Executable) PackingTools {
2928
}
3029

3130
func (p PackingTools) Execute(buildpackDir, output, version string, cached bool) error {
32-
_, err := os.Stat(filepath.Join(buildpackDir, ".packit"))
33-
if err != nil {
34-
return fmt.Errorf("unable to find .packit in buildpack directory: %w", err)
35-
}
36-
3731
args := []string{
3832
"pack",
3933
"--buildpack", filepath.Join(buildpackDir, "buildpack.toml"),

packing_tools_test.go

-13
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ func testPackingTools(t *testing.T, context spec.G, it spec.S) {
2828
var err error
2929
buildpackDir, err = ioutil.TempDir("", "buildpack-dir")
3030
Expect(err).ToNot(HaveOccurred())
31-
Expect(ioutil.WriteFile(filepath.Join(buildpackDir, ".packit"), nil, 0600)).To(Succeed())
3231

3332
executable = &fakes.Executable{}
3433

@@ -69,18 +68,6 @@ func testPackingTools(t *testing.T, context spec.G, it spec.S) {
6968
})
7069

7170
context("failure cases", func() {
72-
context("when the buildpack is not a packit buildpack", func() {
73-
it.Before(func() {
74-
os.Remove(filepath.Join(buildpackDir, ".packit"))
75-
})
76-
77-
it("returns an error", func() {
78-
err := packingTools.Execute(buildpackDir, "some-output", "some-version", true)
79-
Expect(err).To(MatchError(ContainSubstring("unable to find .packit in buildpack directory:")))
80-
Expect(err).To(MatchError(ContainSubstring("no such file or directory")))
81-
})
82-
})
83-
8471
context("when the execution returns an error", func() {
8572
it.Before(func() {
8673
executable.ExecuteCall.Returns.Error = errors.New("some error")

0 commit comments

Comments
 (0)