Skip to content

Commit 4d69fcb

Browse files
committed
tests: temporarily install fs4 compatible static/binary BPs
The testing environment currently does not come with cflinuxfs4 based buildpacks. Until that happens, install them ourselves.
1 parent 0e2e8ed commit 4d69fcb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/apt/integration/init_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ package integration_test
22

33
import (
44
"flag"
5+
"fmt"
56
"html/template"
67
"os"
8+
"os/exec"
79
"path/filepath"
810
"testing"
911
"time"
@@ -52,6 +54,19 @@ func TestIntegration(t *testing.T) {
5254
repoName, err := switchblade.RandomName()
5355
Expect(err).NotTo(HaveOccurred())
5456

57+
// tech debt alert!
58+
// remove this block when testing envs come with cflinuxfs4
59+
// enabled staticfile & binary buildpacks.
60+
if os.Getenv("CF_STACK") == "cflinuxfs4" {
61+
command := exec.Command("cf", "create-buildpack", "staticfile_buildpack", "https://github.com/cloudfoundry/staticfile-buildpack/releases/download/v1.6.0/staticfile-buildpack-cflinuxfs4-v1.6.0.zip", "1", "--enable")
62+
data, err := command.CombinedOutput()
63+
Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Failed to create staticfile_buildpack:\n%s\n%v", string(data), err))
64+
65+
command = exec.Command("cf", "create-buildpack", "binary_buildpack", "https://github.com/cloudfoundry/binary-buildpack/releases/download/v1.1.3/binary-buildpack-cflinuxfs4-v1.1.3.zip", "1", "--enable")
66+
data, err = command.CombinedOutput()
67+
Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Failed to create binary_buildpack:\n%s\n%v", string(data), err))
68+
}
69+
5570
repoDeployment, _, err := platform.Deploy.
5671
WithBuildpacks("staticfile_buildpack").
5772
Execute(repoName, filepath.Join(root, "fixtures", "repo"))

0 commit comments

Comments
 (0)