Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
janisar007 committed Nov 19, 2024
1 parent c0988d9 commit 015f50d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions integration/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.21")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.22")).OnPort(8080))

Expect(logs).To(ContainLines(
MatchRegexp(fmt.Sprintf(`%s \d+\.\d+\.\d+`, buildpackInfo.Buildpack.Name)),
" Resolving Go version",
" Candidate version sources (in priority order):",
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.21\.\d+`),
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.22\.\d+`),
"",
" Executing build process",
MatchRegexp(` Installing Go 1\.21\.\d+`),
MatchRegexp(` Installing Go 1\.22\.\d+`),
MatchRegexp(` Completed in ([0-9]*(\.[0-9]*)?[a-z]+)+`),
"",
fmt.Sprintf(" Generating SBOM for /layers/%s/go", strings.ReplaceAll(buildpackInfo.Buildpack.ID, "/", "_")),
Expand Down
10 changes: 5 additions & 5 deletions integration/environment_variable_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func testEnvironmentVariableConfiguration(t *testing.T, context spec.G, it spec.
image, logs, err = pack.WithNoColor().Build.
WithPullPolicy("never").
WithBuildpacks(buildpack, buildPlanBuildpack).
WithEnv(map[string]string{"BP_GO_VERSION": "1.21.*"}).
WithEnv(map[string]string{"BP_GO_VERSION": "1.22.*"}).
Execute(name, source)
Expect(err).ToNot(HaveOccurred(), logs.String)

Expand All @@ -77,19 +77,19 @@ func testEnvironmentVariableConfiguration(t *testing.T, context spec.G, it spec.
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.21")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.22")).OnPort(8080))

Expect(logs).To(ContainLines(
MatchRegexp(fmt.Sprintf(`%s \d+\.\d+\.\d+`, buildpackInfo.Buildpack.Name)),
" Resolving Go version",
" Candidate version sources (in priority order):",
" BP_GO_VERSION -> \"1.21.*\"",
" BP_GO_VERSION -> \"1.22.*\"",
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected Go version \(using BP_GO_VERSION\): 1\.21\.\d+`),
MatchRegexp(` Selected Go version \(using BP_GO_VERSION\): 1\.22\.\d+`),
"",
" Executing build process",
MatchRegexp(` Installing Go 1\.21\.\d+`),
MatchRegexp(` Installing Go 1\.22\.\d+`),
MatchRegexp(` Completed in ([0-9]*(\.[0-9]*)?[a-z]+)+`),
))
})
Expand Down
12 changes: 6 additions & 6 deletions integration/layer_reuse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
" Candidate version sources (in priority order):",
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.21\.\d+`),
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.22\.\d+`),
"",
" Executing build process",
MatchRegexp(` Installing Go 1\.21\.\d+`),
MatchRegexp(` Installing Go 1\.22\.\d+`),
MatchRegexp(` Completed in \d+(\.?\d+)*`),
))

Expand Down Expand Up @@ -121,7 +121,7 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
" Candidate version sources (in priority order):",
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.21\.\d+`),
MatchRegexp(` Selected Go version \(using <unknown>\): 1\.22\.\d+`),
"",
fmt.Sprintf(" Reusing cached layer /layers/%s/go", strings.ReplaceAll(buildpackInfo.Buildpack.ID, "/", "_")),
))
Expand All @@ -136,7 +136,7 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {

containerIDs[secondContainer.ID] = struct{}{}

Eventually(secondContainer).Should(Serve(ContainSubstring("go1.21")).OnPort(8080))
Eventually(secondContainer).Should(Serve(ContainSubstring("go1.22")).OnPort(8080))

Expect(secondImage.Buildpacks[0].Layers["go"].SHA).To(Equal(firstImage.Buildpacks[0].Layers["go"].SHA))
})
Expand Down Expand Up @@ -192,7 +192,7 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
secondImage, _, err := pack.WithNoColor().Build.
WithPullPolicy("never").
WithBuildpacks(buildpack, buildPlanBuildpack).
WithEnv(map[string]string{"BP_GO_VERSION": "1.22.*"}).
WithEnv(map[string]string{"BP_GO_VERSION": "1.23.*"}).
Execute(name, source)
Expect(err).NotTo(HaveOccurred())

Expand All @@ -212,7 +212,7 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {

containerIDs[secondContainer.ID] = struct{}{}

Eventually(secondContainer).Should(Serve(ContainSubstring("go1.22")).OnPort(8080))
Eventually(secondContainer).Should(Serve(ContainSubstring("go1.23")).OnPort(8080))

Expect(secondImage.Buildpacks[0].Layers["go"].SHA).NotTo(Equal(firstImage.Buildpacks[0].Layers["go"].SHA))
})
Expand Down
2 changes: 1 addition & 1 deletion integration/offline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func testOffline(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.21")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.22")).OnPort(8080))
})
})
}

0 comments on commit 015f50d

Please sign in to comment.