Skip to content

Commit

Permalink
Updates tests to add .NET 9 and to use .NET 8 as default
Browse files Browse the repository at this point in the history
  • Loading branch information
ForestEckhardt committed Dec 3, 2024
1 parent 3445655 commit a5dc55b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 46 deletions.
28 changes: 14 additions & 14 deletions buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@ api = "0.8"
[metadata.default-versions]
dotnet-sdk = "8.*"

[[metadata.dependencies]]
checksum = "sha512:04395f991ab50e4755ce1ae53e23592a7420b71b82160883bae3194dd1dfd5dcaed78743e4e0b4dd51ea43c49ec84b5643630707b3854f1471265dc98490d2f9"
cpe = "cpe:2.3:a:microsoft:.net:6.0.428:*:*:*:*:*:*:*"
deprecation_date = "2024-11-12T00:00:00Z"
id = "dotnet-sdk"
licenses = ["JSON", "MIT", "MIT-0", "MIT-advertising", "MIT-feh", "X11-distribute-modifications-variant"]
name = ".NET Core SDK"
purl = "pkg:generic/dotnet-core-sdk@6.0.428?checksum=04395f991ab50e4755ce1ae53e23592a7420b71b82160883bae3194dd1dfd5dcaed78743e4e0b4dd51ea43c49ec84b5643630707b3854f1471265dc98490d2f9&download_url=https://download.visualstudio.microsoft.com/download/pr/35b1b4d1-b8f4-4b5c-9ddf-e64a846ee50b/93cc198f1c48fe5c4853bd937226f570/dotnet-sdk-6.0.428-linux-x64.tar.gz"
source = "https://download.visualstudio.microsoft.com/download/pr/35b1b4d1-b8f4-4b5c-9ddf-e64a846ee50b/93cc198f1c48fe5c4853bd937226f570/dotnet-sdk-6.0.428-linux-x64.tar.gz"
source-checksum = "sha512:04395f991ab50e4755ce1ae53e23592a7420b71b82160883bae3194dd1dfd5dcaed78743e4e0b4dd51ea43c49ec84b5643630707b3854f1471265dc98490d2f9"
stacks = ["io.buildpacks.stacks.bionic", "io.buildpacks.stacks.jammy"]
uri = "https://download.visualstudio.microsoft.com/download/pr/35b1b4d1-b8f4-4b5c-9ddf-e64a846ee50b/93cc198f1c48fe5c4853bd937226f570/dotnet-sdk-6.0.428-linux-x64.tar.gz"
version = "6.0.428"

[[metadata.dependencies]]
checksum = "sha512:2f166f7f3bd508154d72d1783ffac6e0e3c92023ccc2c6de49d22b411fc8b9e6dd03e7576acc1bb5870a6951181129ba77f3bf94bb45fe9c70105b1b896b9bb9"
cpe = "cpe:2.3:a:microsoft:.net:8.0.404:*:*:*:*:*:*:*"
Expand All @@ -46,6 +32,20 @@ api = "0.8"
uri = "https://download.visualstudio.microsoft.com/download/pr/4e3b04aa-c015-4e06-a42e-05f9f3c54ed2/74d1bb68e330eea13ecfc47f7cf9aeb7/dotnet-sdk-8.0.404-linux-x64.tar.gz"
version = "8.0.404"

[[metadata.dependencies]]
checksum = "sha512:91b37efd64242e5f1f3c2025d183eb34e17f3a9271c5602f29ddf794845eee103723ef955ed869788ebf5a731e8ddc69328799c92c64cb118e1328d259a6ad01"
cpe = "cpe:2.3:a:microsoft:.net:9.0.101:*:*:*:*:*:*:*"
deprecation_date = "2026-05-12T00:00:00Z"
id = "dotnet-sdk"
licenses = ["JSON", "MIT", "MIT-0", "MIT-advertising", "MIT-feh", "X11-distribute-modifications-variant"]
name = ".NET Core SDK"
purl = "pkg:generic/dotnet-core-sdk@9.0.101?checksum=91b37efd64242e5f1f3c2025d183eb34e17f3a9271c5602f29ddf794845eee103723ef955ed869788ebf5a731e8ddc69328799c92c64cb118e1328d259a6ad01&download_url=https://download.visualstudio.microsoft.com/download/pr/d74fd2dd-3384-4952-924b-f5d492326e35/e91d8295d4cbe82ba3501e411d78c9b8/dotnet-sdk-9.0.101-linux-x64.tar.gz"
source = "https://download.visualstudio.microsoft.com/download/pr/d74fd2dd-3384-4952-924b-f5d492326e35/e91d8295d4cbe82ba3501e411d78c9b8/dotnet-sdk-9.0.101-linux-x64.tar.gz"
source-checksum = "sha512:91b37efd64242e5f1f3c2025d183eb34e17f3a9271c5602f29ddf794845eee103723ef955ed869788ebf5a731e8ddc69328799c92c64cb118e1328d259a6ad01"
stacks = ["io.buildpacks.stacks.bionic", "io.buildpacks.stacks.jammy"]
uri = "https://download.visualstudio.microsoft.com/download/pr/d74fd2dd-3384-4952-924b-f5d492326e35/e91d8295d4cbe82ba3501e411d78c9b8/dotnet-sdk-9.0.101-linux-x64.tar.gz"
version = "9.0.101"

[[metadata.dependency-constraints]]
constraint = "8.0.*"
id = "dotnet-sdk"
Expand Down
13 changes: 4 additions & 9 deletions integration/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
" Candidate version sources (in priority order):",
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected .NET Core SDK version \(using <unknown>\): 6\.0\.\d+`),
MatchRegexp(` Selected .NET Core SDK version \(using <unknown>\): \d+\.\d+\.\d+`),
))
Expect(logs).To(ContainLines(
" Executing build process",
Expand All @@ -104,14 +104,9 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
// Note: The assumption here is that the file permissions for the dotnet CLI below (-rwxr-xr-x)
// and its existence in the .dotnet_root directory (which is on the PATH) sufficiently proves
// its ability to be called. This may need refactoring if that assumption is proved insufficient.
MatchRegexp(`-rwxr-xr-x \d+ \w+ cnb \d+ .* dotnet`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* host`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* packs`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* sdk`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* sdk-manifests`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* shared`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* templates`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* 6\.0\.\d+`),
MatchRegexp(`-rwxr-xr-x \d+ \w+ cnb\s+\d+ .* dotnet`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb\s+\d+ .* host`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb\s+\d+ .* sdk`),
),
)

Expand Down
24 changes: 10 additions & 14 deletions integration/layer_reuse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
" Candidate version sources (in priority order):",
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected .NET Core SDK version \(using <unknown>\): 6\.0\.\d+`),
MatchRegexp(` Selected .NET Core SDK version \(using <unknown>\): \d+\.\d+\.\d+`),
))
Expect(logs).To(ContainLines(
MatchRegexp(fmt.Sprintf(" Reusing cached layer /layers/%s/dotnet-core-sdk", strings.ReplaceAll(settings.BuildpackInfo.Buildpack.ID, "/", "_"))),
Expand All @@ -122,8 +122,9 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
return cLogs.String()
}).Should(
And(
MatchRegexp(`-rwxr-xr-x \d+ \w+ cnb \d+ .* dotnet`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* sdk`),
MatchRegexp(`-rwxr-xr-x \d+ \w+ cnb\s+\d+ .* dotnet`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb\s+\d+ .* host`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb\s+\d+ .* sdk`),
),
)

Expand Down Expand Up @@ -192,7 +193,7 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
settings.Buildpacks.BuildPlan.Online,
).
WithEnv(map[string]string{
"BP_DOTNET_FRAMEWORK_VERSION": "6.0.0",
"BP_DOTNET_FRAMEWORK_VERSION": "9.0.0",
}).
Execute(name, source)
Expect(err).NotTo(HaveOccurred(), logs.String())
Expand All @@ -207,10 +208,10 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
MatchRegexp(fmt.Sprintf(`%s \d+\.\d+\.\d+`, settings.BuildpackInfo.Buildpack.Name)),
" Resolving .NET Core SDK version",
" Candidate version sources (in priority order):",
MatchRegexp(` BP_DOTNET_FRAMEWORK_VERSION -> "6\.0\.\*"`),
MatchRegexp(` BP_DOTNET_FRAMEWORK_VERSION -> "\d+\.\d+\.\*"`),
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected .NET Core SDK version \(using BP_DOTNET_FRAMEWORK_VERSION\): 6\.0\.\d+`),
MatchRegexp(` Selected .NET Core SDK version \(using BP_DOTNET_FRAMEWORK_VERSION\): \d+\.\d+\.\d+`),
))
Expect(logs).To(ContainLines(
" Executing build process",
Expand All @@ -233,14 +234,9 @@ func testLayerReuse(t *testing.T, context spec.G, it spec.S) {
return cLogs.String()
}).Should(
And(
MatchRegexp(`-rwxr-xr-x \d+ \w+ cnb \d+ .* dotnet`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* host`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* packs`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* sdk`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* sdk-manifests`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* shared`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* templates`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* 6\.0\.\d+`),
MatchRegexp(`-rwxr-xr-x \d+ \w+ cnb\s+\d+ .* dotnet`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb\s+\d+ .* host`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb\s+\d+ .* sdk`),
),
)

Expand Down
13 changes: 4 additions & 9 deletions integration/offline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func testOffline(t *testing.T, context spec.G, it spec.S) {
" Candidate version sources (in priority order):",
" <unknown> -> \"\"",
"",
MatchRegexp(` Selected .NET Core SDK version \(using <unknown>\): 6\.0\.\d+`),
MatchRegexp(` Selected .NET Core SDK version \(using <unknown>\): \d+\.\d+\.\d+`),
))
Expect(logs).To(ContainLines(
" Executing build process",
Expand All @@ -93,14 +93,9 @@ func testOffline(t *testing.T, context spec.G, it spec.S) {
return cLogs.String()
}).Should(
And(
MatchRegexp(`-rwxr-xr-x \d+ \w+ cnb \d+ .* dotnet`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* host`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* packs`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* sdk`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* sdk-manifests`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* shared`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* templates`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb \d+ .* 6\.0\.\d+`),
MatchRegexp(`-rwxr-xr-x \d+ \w+ cnb\s+\d+ .* dotnet`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb\s+\d+ .* host`),
MatchRegexp(`drwxr-xr-x \d+ \w+ cnb\s+\d+ .* sdk`),
),
)
})
Expand Down

0 comments on commit a5dc55b

Please sign in to comment.