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

Commit

Permalink
Removes hardcoding of the layer path from integration assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Moran authored and ForestEckhardt committed Jan 28, 2021
1 parent 9567de5 commit 6b720c0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
5 changes: 3 additions & 2 deletions integration/default_test.go
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"

"github.com/paketo-buildpacks/occam"
Expand Down Expand Up @@ -91,9 +92,9 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
return cLogs.String()
}).Should(
And(
MatchRegexp(`lrwxrwxrwx \d+ cnb cnb \d+ .* host -> \/layers\/paketo-buildpacks_dotnet-core-runtime\/dotnet-core-runtime\/host`),
MatchRegexp(fmt.Sprintf(`lrwxrwxrwx \d+ cnb cnb \d+ .* host -> \/layers\/%s\/dotnet-core-runtime\/host`, strings.ReplaceAll(settings.BuildpackInfo.Buildpack.ID, "/", "_"))),
MatchRegexp(`drwxr-xr-x \d+ cnb cnb \d+ .* shared`),
MatchRegexp(`lrwxrwxrwx \d+ cnb cnb \d+ .* Microsoft.NETCore.App -> \/layers\/paketo-buildpacks_dotnet-core-runtime\/dotnet-core-runtime\/shared\/Microsoft.NETCore.App`),
MatchRegexp(fmt.Sprintf(`lrwxrwxrwx \d+ cnb cnb \d+ .* Microsoft.NETCore.App -> \/layers\/%s\/dotnet-core-runtime\/shared\/Microsoft.NETCore.App`, strings.ReplaceAll(settings.BuildpackInfo.Buildpack.ID, "/", "_"))),
),
)
})
Expand Down
3 changes: 2 additions & 1 deletion integration/init_test.go
Expand Up @@ -8,11 +8,12 @@ import (
"time"

"github.com/BurntSushi/toml"
. "github.com/onsi/gomega"
"github.com/paketo-buildpacks/occam"
"github.com/paketo-buildpacks/packit/postal"
"github.com/sclevine/spec"
"github.com/sclevine/spec/report"

. "github.com/onsi/gomega"
)

var settings struct {
Expand Down
8 changes: 4 additions & 4 deletions integration/layer_reuse_test.go
Expand Up @@ -121,9 +121,9 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
return cLogs.String()
}).Should(
And(
MatchRegexp(`lrwxrwxrwx \d+ cnb cnb \d+ .* host -> \/layers\/paketo-buildpacks_dotnet-core-runtime\/dotnet-core-runtime\/host`),
MatchRegexp(fmt.Sprintf(`lrwxrwxrwx \d+ cnb cnb \d+ .* host -> \/layers\/%s\/dotnet-core-runtime\/host`, strings.ReplaceAll(settings.BuildpackInfo.Buildpack.ID, "/", "_"))),
MatchRegexp(`drwxr-xr-x \d+ cnb cnb \d+ .* shared`),
MatchRegexp(`lrwxrwxrwx \d+ cnb cnb \d+ .* Microsoft.NETCore.App -> \/layers\/paketo-buildpacks_dotnet-core-runtime\/dotnet-core-runtime\/shared\/Microsoft.NETCore.App`),
MatchRegexp(fmt.Sprintf(`lrwxrwxrwx \d+ cnb cnb \d+ .* Microsoft.NETCore.App -> \/layers\/%s\/dotnet-core-runtime\/shared\/Microsoft.NETCore.App`, strings.ReplaceAll(settings.BuildpackInfo.Buildpack.ID, "/", "_"))),
),
)

Expand Down Expand Up @@ -240,9 +240,9 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
return cLogs.String()
}).Should(
And(
MatchRegexp(`lrwxrwxrwx \d+ cnb cnb \d+ .* host -> \/layers\/paketo-buildpacks_dotnet-core-runtime\/dotnet-core-runtime\/host`),
MatchRegexp(fmt.Sprintf(`lrwxrwxrwx \d+ cnb cnb \d+ .* host -> \/layers\/%s\/dotnet-core-runtime\/host`, strings.ReplaceAll(settings.BuildpackInfo.Buildpack.ID, "/", "_"))),
MatchRegexp(`drwxr-xr-x \d+ cnb cnb \d+ .* shared`),
MatchRegexp(`lrwxrwxrwx \d+ cnb cnb \d+ .* Microsoft.NETCore.App -> \/layers\/paketo-buildpacks_dotnet-core-runtime\/dotnet-core-runtime\/shared\/Microsoft.NETCore.App`),
MatchRegexp(fmt.Sprintf(`lrwxrwxrwx \d+ cnb cnb \d+ .* Microsoft.NETCore.App -> \/layers\/%s\/dotnet-core-runtime\/shared\/Microsoft.NETCore.App`, strings.ReplaceAll(settings.BuildpackInfo.Buildpack.ID, "/", "_"))),
),
)

Expand Down
10 changes: 6 additions & 4 deletions integration/offline_test.go
Expand Up @@ -4,12 +4,14 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"

. "github.com/onsi/gomega"
"github.com/paketo-buildpacks/occam"
. "github.com/paketo-buildpacks/occam/matchers"
"github.com/sclevine/spec"

. "github.com/onsi/gomega"
. "github.com/paketo-buildpacks/occam/matchers"
)

func testOffline(t *testing.T, context spec.G, it spec.S) {
Expand Down Expand Up @@ -92,9 +94,9 @@ func testOffline(t *testing.T, context spec.G, it spec.S) {
return cLogs.String()
}).Should(
And(
MatchRegexp(`lrwxrwxrwx \d+ cnb cnb \d+ .* host -> \/layers\/paketo-buildpacks_dotnet-core-runtime\/dotnet-core-runtime\/host`),
MatchRegexp(fmt.Sprintf(`lrwxrwxrwx \d+ cnb cnb \d+ .* host -> \/layers\/%s\/dotnet-core-runtime\/host`, strings.ReplaceAll(settings.BuildpackInfo.Buildpack.ID, "/", "_"))),
MatchRegexp(`drwxr-xr-x \d+ cnb cnb \d+ .* shared`),
MatchRegexp(`lrwxrwxrwx \d+ cnb cnb \d+ .* Microsoft.NETCore.App -> \/layers\/paketo-buildpacks_dotnet-core-runtime\/dotnet-core-runtime\/shared\/Microsoft.NETCore.App`),
MatchRegexp(fmt.Sprintf(`lrwxrwxrwx \d+ cnb cnb \d+ .* Microsoft.NETCore.App -> \/layers\/%s\/dotnet-core-runtime\/shared\/Microsoft.NETCore.App`, strings.ReplaceAll(settings.BuildpackInfo.Buildpack.ID, "/", "_"))),
),
)
})
Expand Down

0 comments on commit 6b720c0

Please sign in to comment.