Skip to content

Commit

Permalink
Assume the buildpack is built with packit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Moran authored and ForestEckhardt committed May 17, 2021
1 parent 2837bff commit a2654e3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
6 changes: 0 additions & 6 deletions packing_tools.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package freezer

import (
"fmt"
"os"
"path/filepath"

Expand Down Expand Up @@ -29,11 +28,6 @@ func (p PackingTools) WithExecutable(executable Executable) PackingTools {
}

func (p PackingTools) Execute(buildpackDir, output, version string, cached bool) error {
_, err := os.Stat(filepath.Join(buildpackDir, ".packit"))
if err != nil {
return fmt.Errorf("unable to find .packit in buildpack directory: %w", err)
}

args := []string{
"pack",
"--buildpack", filepath.Join(buildpackDir, "buildpack.toml"),
Expand Down
13 changes: 0 additions & 13 deletions packing_tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func testPackingTools(t *testing.T, context spec.G, it spec.S) {
var err error
buildpackDir, err = ioutil.TempDir("", "buildpack-dir")
Expect(err).ToNot(HaveOccurred())
Expect(ioutil.WriteFile(filepath.Join(buildpackDir, ".packit"), nil, 0600)).To(Succeed())

executable = &fakes.Executable{}

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

context("failure cases", func() {
context("when the buildpack is not a packit buildpack", func() {
it.Before(func() {
os.Remove(filepath.Join(buildpackDir, ".packit"))
})

it("returns an error", func() {
err := packingTools.Execute(buildpackDir, "some-output", "some-version", true)
Expect(err).To(MatchError(ContainSubstring("unable to find .packit in buildpack directory:")))
Expect(err).To(MatchError(ContainSubstring("no such file or directory")))
})
})

context("when the execution returns an error", func() {
it.Before(func() {
executable.ExecuteCall.Returns.Error = errors.New("some error")
Expand Down

0 comments on commit a2654e3

Please sign in to comment.