Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Commit

Permalink
integration test updates for implementation buildpackage releases,
Browse files Browse the repository at this point in the history
- add package.toml file
- update to use freezer
  • Loading branch information
dwillist authored and ryanmoran committed Jul 10, 2020
1 parent 8960580 commit c21b7af
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -305,6 +306,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
3 changes: 3 additions & 0 deletions integration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"nginx": "github.com/paketo-buildpacks/nginx"
}
33 changes: 22 additions & 11 deletions integration/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package integration

import (
"bytes"
"fmt"
"encoding/json"
"os"
"path/filepath"
"strings"
"testing"
"time"

"github.com/cloudfoundry/dagger"
"github.com/paketo-buildpacks/packit/pexec"
"github.com/paketo-buildpacks/occam"
"github.com/sclevine/spec"
"github.com/sclevine/spec/report"

Expand All @@ -23,22 +25,31 @@ var (
func TestIntegration(t *testing.T) {
Expect := NewWithT(t).Expect

root, err := dagger.FindBPRoot()
var config struct {
Nginx string `json:"nginx"`
}

root, err := filepath.Abs("./..")
Expect(err).NotTo(HaveOccurred())

buildpack, err = dagger.PackageBuildpack(root)
file, err := os.Open("../integration.json")
Expect(err).NotTo(HaveOccurred())

nginxBuildpack, err = dagger.GetLatestCommunityBuildpack("paketo-buildpacks", "nginx")
Expect(json.NewDecoder(file).Decode(&config)).To(Succeed())

version, err := GetGitVersion()
Expect(err).NotTo(HaveOccurred())

// HACK: we need to fix dagger and the package.sh scripts so that this isn't required
buildpack = fmt.Sprintf("%s.tgz", buildpack)
buildpackStore := occam.NewBuildpackStore()

defer func() {
Expect(dagger.DeleteBuildpack(buildpack)).To(Succeed())
Expect(dagger.DeleteBuildpack(nginxBuildpack)).To(Succeed())
}()
buildpack, err = buildpackStore.Get.
WithVersion(version).
Execute(root)
Expect(err).NotTo(HaveOccurred())

nginxBuildpack, err = buildpackStore.Get.
Execute(config.Nginx)
Expect(err).NotTo(HaveOccurred())

SetDefaultEventuallyTimeout(5 * time.Second)

Expand Down
2 changes: 2 additions & 0 deletions package.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[buildpack]
uri = "build/buildpack.tgz"

0 comments on commit c21b7af

Please sign in to comment.