Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class BasicScenarioTests : SdkTests
{
public BasicScenarioTests(ITestOutputHelper outputHelper) : base(outputHelper) { }

// [Theory(Skip="https://github.com/dotnet/sdk/issues/42920")]
[Theory]
[MemberData(nameof(GetScenarioObjects))]
public void VerifyScenario(TestScenario scenario) => scenario.Execute(DotNetHelper);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public DotNetFormatTests(ITestOutputHelper outputHelper) : base(outputHelper) {
/// <Summary>
/// Format an unformatted project and verify that the output matches the pre-computed solution.
/// </Summary>
// [Fact(Skip="https://github.com/dotnet/sdk/issues/42920")]
// Disabled due to https://github.com/dotnet/roslyn/issues/76797
// [Fact]
public void FormatProject()
{
if (DotNetHelper.IsMonoRuntime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class DotNetWatchTests : SdkTests
{
public DotNetWatchTests(ITestOutputHelper outputHelper) : base(outputHelper) { }

// [Fact(Skip="https://github.com/dotnet/sdk/issues/42920")]
[Fact]
public void WatchTests()
{
if (DotNetHelper.IsMonoRuntime)
Expand All @@ -36,7 +36,7 @@ public void WatchTests()

void processConfigCallback(Process process)
{
const string waitingString = "Waiting for changes";
const string waitingString = "Waiting for a file to change";
const string expectedString = "Hello from dotnet watch!";

bool fileChanged = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public SymbolsTests(ITestOutputHelper outputHelper) : base(outputHelper) { }
/// <summary>
/// Verifies that all symbols have valid sourcelinks.
/// </summary>
// [Fact(Skip="https://github.com/dotnet/sdk/issues/42920")]
[Fact]
public void VerifySdkSymbols()
{
try
Expand Down Expand Up @@ -66,6 +66,10 @@ private IList<string> VerifySdkFilesHaveMatchingSymbols(string symbolsRoot, stri
{
Assert.True(Directory.Exists(sdkRoot), $"Path, with SDK files to validate, does not exist: {sdkRoot}");

// Normalize paths, to ensure proper string replacement
symbolsRoot = symbolsRoot.TrimEnd(Path.DirectorySeparatorChar);
sdkRoot = sdkRoot.TrimEnd(Path.DirectorySeparatorChar);

var failedFiles = new ConcurrentBag<string>();

IEnumerable<string> allFiles = Directory.GetFiles(sdkRoot, "*", SearchOption.AllDirectories);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -20,7 +21,7 @@ public class WebScenarioTests : SdkTests
{
public WebScenarioTests(ITestOutputHelper outputHelper) : base(outputHelper) { }

// [Theory(Skip="https://github.com/dotnet/sdk/issues/42920")]
[Theory]
[MemberData(nameof(GetScenarioObjects))]
public void VerifyScenario(TestScenario scenario) => scenario.Execute(DotNetHelper);

Expand All @@ -37,8 +38,7 @@ private static IEnumerable<TestScenario> GetScenarios()

yield return new(nameof(WebScenarioTests), DotNetLanguage.CSharp, DotNetTemplate.Razor, DotNetActions.Build | DotNetActions.Run | DotNetActions.Publish);
yield return new(nameof(WebScenarioTests), DotNetLanguage.CSharp, DotNetTemplate.BlazorWasm, DotNetActions.Build | DotNetActions.Run | DotNetActions.Publish);
// Disabled due to .NET 10.0 transition. See https://github.com/dotnet/sdk/pull/42969
// yield return new(nameof(WebScenarioTests), DotNetLanguage.CSharp, DotNetTemplate.WebApp, DotNetActions.PublishSelfContained, VerifyRuntimePacksForSelfContained);
yield return new(nameof(WebScenarioTests), DotNetLanguage.CSharp, DotNetTemplate.WebApp, DotNetActions.PublishSelfContained, VerifyRuntimePacksForSelfContained);
yield return new(nameof(WebScenarioTests), DotNetLanguage.CSharp, DotNetTemplate.Worker);
}

Expand All @@ -50,9 +50,30 @@ private static void VerifyRuntimePacksForSelfContained(string projectPath)
string projNugetCachePath = Path.Combine(projectPath, "obj", "project.nuget.cache");

JsonNode? projNugetCache = JsonNode.Parse(File.ReadAllText(projNugetCachePath));
string? restoredPackageFiles = projNugetCache?["expectedPackageFiles"]?.ToString();
JsonArray? restoredPackageFiles = (JsonArray?)projNugetCache?["expectedPackageFiles"];

Assert.True(restoredPackageFiles is not null, "Failed to parse project.nuget.cache");
Assert.True("[]" == restoredPackageFiles, "Runtime packs were retrieved from NuGet instead of the SDK");

string[] allowedPackages = [
// Temporarily allowed due to https://github.com/dotnet/sdk/issues/46165
// TODO: Remove this once the issue is resolved
"Microsoft.AspNetCore.App.Internal.Assets"
];

string packagesDirectory = Path.Combine(Environment.CurrentDirectory, "packages");

IEnumerable<string> packages = restoredPackageFiles
.Select(file =>
{
string path = file.ToString();
path = path.Substring(packagesDirectory.Length + 1); // trim the leading path up to the package name directory
return path.Substring(0, path.IndexOf('/')); // trim the rest of the path
})
.Except(allowedPackages, StringComparer.OrdinalIgnoreCase);

if (packages.Any())
{
Assert.Fail($"The following runtime packs were retrieved from NuGet instead of the SDK: {string.Join(",", packages.ToArray())}");
}
}
}
Loading