Skip to content

Commit

Permalink
tests: temporarily install fs4 compatible static/binary BPs
Browse files Browse the repository at this point in the history
The testing environment currently does not come with cflinuxfs4
based buildpacks. Until that happens, install them ourselves.
  • Loading branch information
arjun024 committed Mar 17, 2023
1 parent 0e2e8ed commit 4d69fcb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/apt/integration/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package integration_test

import (
"flag"
"fmt"
"html/template"
"os"
"os/exec"
"path/filepath"
"testing"
"time"
Expand Down Expand Up @@ -52,6 +54,19 @@ func TestIntegration(t *testing.T) {
repoName, err := switchblade.RandomName()
Expect(err).NotTo(HaveOccurred())

// tech debt alert!
// remove this block when testing envs come with cflinuxfs4
// enabled staticfile & binary buildpacks.
if os.Getenv("CF_STACK") == "cflinuxfs4" {
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")
data, err := command.CombinedOutput()
Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Failed to create staticfile_buildpack:\n%s\n%v", string(data), err))

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")
data, err = command.CombinedOutput()
Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Failed to create binary_buildpack:\n%s\n%v", string(data), err))
}

repoDeployment, _, err := platform.Deploy.
WithBuildpacks("staticfile_buildpack").
Execute(repoName, filepath.Join(root, "fixtures", "repo"))
Expand Down

0 comments on commit 4d69fcb

Please sign in to comment.