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

Commit

Permalink
don't iterate over builders within test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankie Gallina-Jones authored and ForestEckhardt committed Jul 27, 2022
1 parent 4d49adc commit 4090922
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 44 deletions.
78 changes: 36 additions & 42 deletions integration/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,51 +48,45 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
Expect(os.RemoveAll(source)).To(Succeed())
})

for _, b := range settings.Config.Builders {
builder := b
context(fmt.Sprintf("with %s", builder), func() {
it("builds successfully", func() {
var err error
source, err = occam.Source(filepath.Join("testdata", "default"))
Expect(err).NotTo(HaveOccurred())
it("builds successfully", func() {
var err error
source, err = occam.Source(filepath.Join("testdata", "default"))
Expect(err).NotTo(HaveOccurred())

var logs fmt.Stringer
image, logs, err = pack.Build.
WithPullPolicy("never").
WithBuildpacks(
settings.Buildpacks.Dep.Online,
settings.Buildpacks.DepEnsure.Online,
).
WithBuilder(builder).
Execute(name, source)
Expect(err).ToNot(HaveOccurred(), logs.String)
var logs fmt.Stringer
image, logs, err = pack.Build.
WithPullPolicy("never").
WithBuildpacks(
settings.Buildpacks.Dep.Online,
settings.Buildpacks.DepEnsure.Online,
).
Execute(name, source)
Expect(err).ToNot(HaveOccurred(), logs.String)

Expect(logs).To(ContainLines(
MatchRegexp(fmt.Sprintf(`%s \d+\.\d+\.\d+`, settings.Buildpack.Name)),
" WARNING: This buildpack is deprecated. It will be removed within 30 days. See https://github.com/paketo-buildpacks/go/issues/622.",
"",
" Executing build process",
" Running 'dep ensure'",
MatchRegexp(` Completed in ([0-9]*(\.[0-9]*)?[a-z]+)+`),
))
Expect(logs).To(ContainLines(
MatchRegexp(fmt.Sprintf(`%s \d+\.\d+\.\d+`, settings.Buildpack.Name)),
" WARNING: This buildpack is deprecated. It will be removed within 30 days. See https://github.com/paketo-buildpacks/go/issues/622.",
"",
" Executing build process",
" Running 'dep ensure'",
MatchRegexp(` Completed in ([0-9]*(\.[0-9]*)?[a-z]+)+`),
))

container, err = docker.Container.Run.
WithCommand("ls -alR /workspace").
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())
container, err = docker.Container.Run.
WithCommand("ls -alR /workspace").
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(func() string {
cLogs, err := docker.Container.Logs.Execute(container.ID)
Expect(err).NotTo(HaveOccurred())
return cLogs.String()
}).Should(
And(
ContainSubstring("Gopkg.lock"),
ContainSubstring("vendor/github.com/ZiCog/shiny-thing"),
),
)
})
})
}
Eventually(func() string {
cLogs, err := docker.Container.Logs.Execute(container.ID)
Expect(err).NotTo(HaveOccurred())
return cLogs.String()
}).Should(
And(
ContainSubstring("Gopkg.lock"),
ContainSubstring("vendor/github.com/ZiCog/shiny-thing"),
),
)
})
})
}
3 changes: 1 addition & 2 deletions integration/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ var settings struct {
Name string
}
Config struct {
Dep string `json:"dep"`
Builders []string `json:"builders"`
Dep string `json:"dep"`
}
}

Expand Down

0 comments on commit 4090922

Please sign in to comment.