Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify TFM 9.0 SDK resolution #148

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions buildpacks/dotnet/tests/fixtures/basic_web_9.0/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/", () => "Hello World!");

app.Run();
10 changes: 10 additions & 0 deletions buildpacks/dotnet/tests/fixtures/basic_web_9.0/foo.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

</Project>

22 changes: 21 additions & 1 deletion buildpacks/dotnet/tests/sdk_installation_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use libcnb_test::{assert_contains, assert_empty, TestRunner};

#[test]
#[ignore = "integration test"]
fn test_sdk_resolution_with_target_framework() {
fn test_sdk_resolution_with_target_framework_8_0() {
TestRunner::default().build(
default_build_config("tests/fixtures/basic_web_8.0"),
|context| {
Expand All @@ -22,6 +22,26 @@ fn test_sdk_resolution_with_target_framework() {
);
}

#[test]
#[ignore = "integration test"]
fn test_sdk_resolution_with_target_framework_9_0() {
TestRunner::default().build(
default_build_config("tests/fixtures/basic_web_9.0"),
|context| {
assert_empty!(context.pack_stderr);
assert_contains!(
context.pack_stdout,
&indoc! {r"
- SDK version detection
- Detected .NET file to publish: `/workspace/foo.csproj`
- Inferring version requirement from `/workspace/foo.csproj`
- Detected version requirement: `^9.0`
- Resolved .NET SDK version `9.0"}
);
},
);
}

#[test]
#[ignore = "integration test"]
fn test_sdk_resolution_with_solution_file() {
Expand Down