Skip to content

Commit 33d181e

Browse files
authored
Port a set of test fixes from main to 9.0.2xx (#45549)
2 parents df21997 + 2f08bc0 commit 33d181e

15 files changed

+180
-305
lines changed

test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void CanBuildProjectWithPackageReferencesWithConflictingTypes()
3939
var testAsset = _testAssetsManager.CreateTestProject(testProject);
4040

4141
var packagesPaths = packageReferences.Select(e => Path.GetDirectoryName(e.NupkgPath));
42-
List<string> sources = new() { NuGetConfigWriter.DotnetCoreBlobFeed };
42+
List<string> sources = new();
4343
sources.AddRange(packagesPaths);
4444
NuGetConfigWriter.Write(testAsset.TestRoot, sources);
4545

@@ -85,7 +85,7 @@ public void CanBuildProjectWithMultiplePackageReferencesWithAliases()
8585
testProject.SourceFiles[$"{testProject.Name}.cs"] = ClassLibAandBUsage;
8686
var testAsset = _testAssetsManager.CreateTestProject(testProject);
8787

88-
List<string> sources = new() { NuGetConfigWriter.DotnetCoreBlobFeed, Path.GetDirectoryName(packageReferenceA.NupkgPath), Path.GetDirectoryName(packageReferenceB.NupkgPath) };
88+
List<string> sources = new() { Path.GetDirectoryName(packageReferenceA.NupkgPath), Path.GetDirectoryName(packageReferenceB.NupkgPath) };
8989
NuGetConfigWriter.Write(testAsset.TestRoot, sources);
9090

9191
var buildCommand = new BuildCommand(testAsset)
@@ -122,7 +122,7 @@ public void CanBuildProjectWithAPackageReferenceWithMultipleAliases()
122122
testProject.SourceFiles[$"{testProject.Name}.cs"] = ClassLibAandBUsage;
123123
var testAsset = _testAssetsManager.CreateTestProject(testProject);
124124

125-
List<string> sources = new() { NuGetConfigWriter.DotnetCoreBlobFeed, Path.GetDirectoryName(packageReferenceA.NupkgPath) };
125+
List<string> sources = new() { Path.GetDirectoryName(packageReferenceA.NupkgPath) };
126126
NuGetConfigWriter.Write(testAsset.TestRoot, sources);
127127

128128
var buildCommand = new BuildCommand(testAsset)

test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildANetCoreApp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void It_targets_the_right_shared_framework(string targetFramework, string
4848
}
4949

5050
// Test behavior when implicit version differs for framework-dependent and self-contained apps
51-
[Theory(Skip = "https://github.com/dotnet/sdk/issues/45417")]
51+
[Theory]
5252
[InlineData("netcoreapp1.0", false, true, "1.0.5")]
5353
[InlineData("netcoreapp1.0", true, true, "1.0.16")]
5454
[InlineData("netcoreapp1.0", false, false, "1.0.5")]
@@ -133,7 +133,7 @@ private void It_targets_the_right_framework(
133133

134134
var testAsset = _testAssetsManager.CreateTestProject(testProject, testIdentifier);
135135

136-
NuGetConfigWriter.Write(testAsset.TestRoot, NuGetConfigWriter.DotnetCoreBlobFeed);
136+
NuGetConfigWriter.Write(testAsset.TestRoot);
137137

138138
var buildCommand = new BuildCommand(testAsset);
139139

test/Microsoft.NET.Build.Tests/GivenThatWeWantToGenerateADepsFileForATool.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private CommandResult GenerateDepsAndRunTool(TestProject toolProject, [CallerMem
8686

8787
var toolProjectInstance = _testAssetsManager.CreateTestProject(toolProject, callingMethod, identifier: toolProject.Name);
8888

89-
NuGetConfigWriter.Write(toolProjectInstance.TestRoot, NuGetConfigWriter.DotnetCoreBlobFeed);
89+
NuGetConfigWriter.Write(toolProjectInstance.TestRoot);
9090

9191
// Workaround https://github.com/dotnet/cli/issues/9701
9292
var useBundledNETCoreAppPackage = "/p:UseBundledNETCoreAppPackageVersionAsDefaultNetCorePatchVersion=true";
@@ -118,7 +118,7 @@ private CommandResult GenerateDepsAndRunTool(TestProject toolProject, [CallerMem
118118
new XAttribute("Version", "1.0.0")));
119119
});
120120

121-
List<string> sources = new() { NuGetConfigWriter.DotnetCoreBlobFeed };
121+
List<string> sources = new();
122122
sources.Add(nupkgPath);
123123

124124
NuGetConfigWriter.Write(toolReferencerInstance.TestRoot, sources);

test/Microsoft.NET.Publish.Tests/GivenThatWeWantToStoreAProjectWithDependencies.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -121,37 +121,6 @@ public void compose_dependencies_noopt()
121121
storeDirectory.Should().OnlyHaveFiles(files_on_disk);
122122
}
123123

124-
[Fact(Skip = "https://github.com/dotnet/sdk/issues/45417")]
125-
public void store_nativeonlyassets()
126-
{
127-
TestAsset simpleDependenciesAsset = _testAssetsManager
128-
.CopyTestAsset("UnmanagedStore")
129-
.WithSource();
130-
131-
var storeCommand = new ComposeStoreCommand(Log, simpleDependenciesAsset.TestRoot);
132-
133-
var OutputFolder = Path.Combine(simpleDependenciesAsset.TestRoot, "outdir");
134-
var WorkingDir = Path.Combine(simpleDependenciesAsset.TestRoot, "w");
135-
136-
NuGetConfigWriter.Write(simpleDependenciesAsset.TestRoot, NuGetConfigWriter.DotnetCoreBlobFeed);
137-
138-
storeCommand
139-
.Execute($"/p:RuntimeIdentifier={_runtimeRid}", $"/p:TargetFramework={_tfm}", $"/p:ComposeWorkingDir={WorkingDir}", $"/p:ComposeDir={OutputFolder}", $"/p:DoNotDecorateComposeDir=true")
140-
.Should()
141-
.Pass();
142-
143-
DirectoryInfo storeDirectory = new(OutputFolder);
144-
145-
List<string> files_on_disk = new()
146-
{
147-
"artifact.xml",
148-
$"runtime.{_runtimeRid}.microsoft.netcore.coredistools/1.0.1-prerelease-00001/runtimes/{_runtimeRid}/native/{_libPrefix}coredistools{FileConstants.DynamicLibSuffix}",
149-
$"runtime.{_runtimeRid}.microsoft.netcore.coredistools/1.0.1-prerelease-00001/runtimes/{_runtimeRid}/native/coredistools.h"
150-
};
151-
152-
storeDirectory.Should().OnlyHaveFiles(files_on_disk);
153-
}
154-
155124
[Fact]
156125
public void compose_multifile()
157126
{

test/Microsoft.NET.Restore.Tests/GivenThatWeWantToIgnoreObsoleteDotNetCliToolPackages.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void It_issues_warning_and_skips_restore_for_obsolete_DotNetCliToolRefere
3434
new XAttribute("Include", obsoletePackageId)));
3535
});
3636

37-
NuGetConfigWriter.Write(toolProjectInstance.TestRoot, NuGetConfigWriter.DotnetCoreBlobFeed);
37+
NuGetConfigWriter.Write(toolProjectInstance.TestRoot);
3838

3939
RestoreCommand restoreCommand = toolProjectInstance.GetRestoreCommand(Log, toolProject.Name);
4040
restoreCommand.Execute("/v:n").Should()

test/Microsoft.NET.Restore.Tests/GivenThatWeWantToRestoreDotNetCliToolReference.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void It_can_restore_with_netcoreapp2_2()
5050

5151
DeleteFolder(Path.Combine(TestContext.Current.NuGetCachePath, toolProject.Name.ToLowerInvariant()));
5252
DeleteFolder(Path.Combine(TestContext.Current.NuGetCachePath, ".tools", toolProject.Name.ToLowerInvariant()));
53-
NuGetConfigWriter.Write(toolReferenceProjectInstance.TestRoot, NuGetConfigWriter.DotnetCoreBlobFeed, nupkgPath);
53+
NuGetConfigWriter.Write(toolReferenceProjectInstance.TestRoot, nupkgPath);
5454

5555
RestoreCommand restoreCommand =
5656
toolReferenceProjectInstance.GetRestoreCommand(log: Log, relativePath: toolReferenceProject.Name);

test/Microsoft.NET.TestFramework/NuGetConfigWriter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ namespace Microsoft.NET.TestFramework
55
{
66
public static class NuGetConfigWriter
77
{
8-
public static readonly string DotnetCoreBlobFeed = "https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json";
98
public static readonly string AspNetCoreDevFeed = "https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json";
109

1110
public static void Write(string folder, params string[] nugetSources)

test/TestAssets/TestProjects/UnmanagedStore/UnmanagedStore.csproj

Lines changed: 0 additions & 7 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,25 @@
11
Warning: use of 'dotnet new --list' is deprecated. Use 'dotnet new list' instead.
22
For more information, run:
33
dotnet new list -h
4-
54
These templates matched your input:
6-
75
Template Name Short Name Language Tags
8-
-------------------------------------------- -------------------------- ---------- ----------------------------------
9-
API Controller apicontroller [C#] Web/ASP.NET
10-
ASP.NET Core Empty web [C#],F# Web/Empty
11-
ASP.NET Core gRPC Service grpc [C#] Web/gRPC/API/Service
12-
ASP.NET Core Web API webapi [C#],F# Web/Web API/API/Service/WebAPI
13-
ASP.NET Core Web API (native AOT) webapiaot [C#] Web/Web API/API/Service
14-
ASP.NET Core Web App (Model-View-Controller) mvc [C#],F# Web/MVC
15-
ASP.NET Core Web App (Razor Pages) webapp,razor [C#] Web/MVC/Razor Pages
16-
Blazor Server App blazorserver [C#] Web/Blazor
17-
Blazor Web App blazor [C#] Web/Blazor/WebAssembly
18-
Blazor WebAssembly Standalone App blazorwasm [C#] Web/Blazor/WebAssembly/PWA
19-
Class Library classlib [C#],F#,VB Common/Library
20-
Console App console [C#],F#,VB Common/Console
21-
dotnet gitignore file gitignore,.gitignore Config
22-
Dotnet local tool manifest file tool-manifest Config
23-
EditorConfig file editorconfig,.editorconfig Config
24-
global.json file globaljson,global.json Config
25-
MSBuild Directory.Build.props file buildprops MSBuild/props
26-
MSBuild Directory.Build.targets file buildtargets MSBuild/props
27-
MSBuild Directory.Packages.props file packagesprops MSBuild/packages/props/CPM
28-
MSTest Playwright Test Project mstest-playwright [C#] Test/MSTest/Playwright/Desktop/Web
29-
MSTest Test Class mstest-class [C#],F#,VB Test/MSTest
30-
MSTest Test Project mstest [C#],F#,VB Test/MSTest/Desktop/Web
31-
MVC Controller mvccontroller [C#] Web/ASP.NET
32-
MVC ViewImports viewimports [C#] Web/ASP.NET
33-
MVC ViewStart viewstart [C#] Web/ASP.NET
34-
NuGet Config nugetconfig,nuget.config Config
35-
NUnit 3 Test Item nunit-test [C#],F#,VB Test/NUnit
36-
NUnit 3 Test Project nunit [C#],F#,VB Test/NUnit/Desktop/Web
37-
NUnit Playwright Test Project nunit-playwright [C#] Test/NUnit/Playwright/Desktop/Web
38-
Protocol Buffer File proto Web/gRPC
39-
Razor Class Library razorclasslib [C#] Web/Razor/Library
40-
Razor Component razorcomponent [C#] Web/ASP.NET
41-
Razor Page page [C#] Web/ASP.NET
42-
Razor View view [C#] Web/ASP.NET
43-
Solution File sln,solution Solution
44-
Web Config webconfig Config
45-
Worker Service worker [C#],F# Common/Worker/Web
46-
xUnit Test Project xunit [C#],F#,VB Test/xUnit/Desktop/Web
6+
API
7+
ASP.NET
8+
Blazor
9+
Class
10+
Console
11+
dotnet
12+
Dotnet
13+
EditorConfig
14+
global.json
15+
MSBuild
16+
MSTest
17+
MVC
18+
NuGet
19+
NUnit
20+
Protocol
21+
Razor
22+
Solution
23+
Web
24+
Worker
25+
xUnit
Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,25 @@
11
Warning: use of 'dotnet new --list' is deprecated. Use 'dotnet new list' instead.
22
For more information, run:
33
dotnet new list -h
4-
54
These templates matched your input:
6-
75
Template Name Short Name Language Tags
8-
-------------------------------------------- -------------------------- ---------- ------------------------------
9-
API Controller apicontroller [C#] Web/ASP.NET
10-
ASP.NET Core Empty web [C#],F# Web/Empty
11-
ASP.NET Core gRPC Service grpc [C#] Web/gRPC/API/Service
12-
ASP.NET Core Web API webapi [C#],F# Web/Web API/API/Service/WebAPI
13-
ASP.NET Core Web API (native AOT) webapiaot [C#] Web/Web API/API/Service
14-
ASP.NET Core Web App (Model-View-Controller) mvc [C#],F# Web/MVC
15-
ASP.NET Core Web App (Razor Pages) webapp,razor [C#] Web/MVC/Razor Pages
16-
Blazor Server App blazorserver [C#] Web/Blazor
17-
Blazor Web App blazor [C#] Web/Blazor/WebAssembly
18-
Blazor WebAssembly Standalone App blazorwasm [C#] Web/Blazor/WebAssembly/PWA
19-
Class Library classlib [C#],F#,VB Common/Library
20-
Console App console [C#],F#,VB Common/Console
21-
dotnet gitignore file gitignore,.gitignore Config
22-
Dotnet local tool manifest file tool-manifest Config
23-
EditorConfig file editorconfig,.editorconfig Config
24-
global.json file globaljson,global.json Config
25-
MSBuild Directory.Build.props file buildprops MSBuild/props
26-
MSBuild Directory.Build.targets file buildtargets MSBuild/props
27-
MSBuild Directory.Packages.props file packagesprops MSBuild/packages/props/CPM
28-
MSTest Playwright Test Project mstest-playwright [C#] Test/MSTest/Playwright
29-
MSTest Test Class mstest-class [C#],F#,VB Test/MSTest
30-
MSTest Test Project mstest [C#],F#,VB Test/MSTest
31-
MVC Controller mvccontroller [C#] Web/ASP.NET
32-
MVC ViewImports viewimports [C#] Web/ASP.NET
33-
MVC ViewStart viewstart [C#] Web/ASP.NET
34-
NuGet Config nugetconfig,nuget.config Config
35-
NUnit 3 Test Item nunit-test [C#],F#,VB Test/NUnit
36-
NUnit 3 Test Project nunit [C#],F#,VB Test/NUnit
37-
NUnit Playwright Test Project nunit-playwright [C#] Test/NUnit/Playwright
38-
Protocol Buffer File proto Web/gRPC
39-
Razor Class Library razorclasslib [C#] Web/Razor/Library
40-
Razor Component razorcomponent [C#] Web/ASP.NET
41-
Razor Page page [C#] Web/ASP.NET
42-
Razor View view [C#] Web/ASP.NET
43-
Solution File sln,solution Solution
44-
Web Config webconfig Config
45-
Worker Service worker [C#],F# Common/Worker/Web
46-
xUnit Test Project xunit [C#],F#,VB Test/xUnit
6+
API
7+
ASP.NET
8+
Blazor
9+
Class
10+
Console
11+
dotnet
12+
Dotnet
13+
EditorConfig
14+
global.json
15+
MSBuild
16+
MSTest
17+
MVC
18+
NuGet
19+
NUnit
20+
Protocol
21+
Razor
22+
Solution
23+
Web
24+
Worker
25+
xUnit

0 commit comments

Comments
 (0)