dependabot-nuget 0.287.0 → 0.289.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/helpers/lib/NuGetUpdater/.gitignore +1 -0
- data/helpers/lib/NuGetUpdater/Directory.Build.targets +17 -0
- data/helpers/lib/NuGetUpdater/Directory.Packages.props +26 -17
- data/helpers/lib/NuGetUpdater/NuGetProjects/NuGet.Packaging/NuGet.Packaging.csproj +0 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/DiscoverCommand.cs +7 -3
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/RunCommand.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Analyze.cs +3 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Discover.cs +88 -47
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/AnalyzeWorker.cs +31 -16
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/CompatabilityChecker.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/RequirementArrayConverter.cs +39 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/VersionFinder.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Clone/ShellGitCommandHandler.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/DependencyDiscovery.props +7 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/DependencyDiscovery.targets +10 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs +64 -53
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DotNetToolsJsonDiscovery.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/GlobalJsonDiscovery.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/PackagesConfigDiscovery.cs +17 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/PackagesConfigDiscoveryResult.cs +3 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/ProjectDiscoveryResult.cs +3 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs +429 -12
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/WorkspaceDiscoveryResult.cs +0 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/ExperimentsManager.cs +12 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/JsonBuildFile.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/FrameworkChecker/CompatabilityChecker.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/NuGetUpdater.Core.csproj +7 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/Job.cs +23 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunWorker.cs +43 -58
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/TargetFrameworkReporter.targets +13 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/BindingRedirectManager.cs +13 -43
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/DotNetToolsJsonUpdater.cs +4 -4
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/GlobalJsonUpdater.cs +5 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/LockFileUpdater.cs +3 -10
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackageReferenceUpdater.cs +40 -33
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackagesConfigUpdater.cs +12 -11
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +16 -12
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/CollectionExtensions.cs +17 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ConsoleLogger.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/DependencyConflictResolver.cs +19 -19
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ILogger.cs +11 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +74 -20
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/NuGetHelper.cs +1 -17
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/PathComparer.cs +31 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/PathHelper.cs +46 -10
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ProjectHelper.cs +96 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/AnalyzeWorkerTests.cs +135 -3
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTestBase.cs +71 -38
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.PackagesConfig.cs +66 -4
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Proj.cs +11 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +808 -222
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +477 -97
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/ExpectedDiscoveryResults.cs +5 -9
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/SdkProjectDiscoveryTests.cs +494 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/MockNuGetPackage.cs +46 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/NuGetUpdater.Core.Test.csproj +0 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs +401 -77
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +35 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdatedDependencyListTests.cs +60 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/TemporaryDirectory.cs +3 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/TestLogger.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/BindingRedirectsTests.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +8 -4
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackageReference.cs +40 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/AssertEx.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/LinuxOnlyAttribute.cs +12 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +8 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/PathHelperTests.cs +49 -3
- data/lib/dependabot/nuget/analysis/analysis_json_reader.rb +3 -1
- data/lib/dependabot/nuget/file_fetcher.rb +12 -393
- data/lib/dependabot/nuget/file_parser.rb +23 -54
- data/lib/dependabot/nuget/file_updater.rb +21 -16
- data/lib/dependabot/nuget/native_discovery/native_dependency_file_discovery.rb +2 -9
- data/lib/dependabot/nuget/native_discovery/native_discovery_json_reader.rb +183 -80
- data/lib/dependabot/nuget/native_discovery/native_project_discovery.rb +25 -3
- data/lib/dependabot/nuget/native_discovery/native_workspace_discovery.rb +1 -11
- data/lib/dependabot/nuget/native_helpers.rb +13 -4
- data/lib/dependabot/nuget/native_update_checker/native_update_checker.rb +17 -4
- metadata +15 -12
- data/helpers/lib/NuGetUpdater/NuGetProjects/Directory.Packages.props +0 -29
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/RequirementConverter.cs +0 -17
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DirectoryPackagesPropsDiscovery.cs +0 -69
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DirectoryPackagesPropsDiscoveryResult.cs +0 -11
- data/lib/dependabot/nuget/file_fetcher/import_paths_finder.rb +0 -73
- data/lib/dependabot/nuget/file_fetcher/sln_project_paths_finder.rb +0 -60
- data/lib/dependabot/nuget/native_discovery/native_directory_packages_props_discovery.rb +0 -44
@@ -1,3 +1,5 @@
|
|
1
|
+
using System.Collections.Immutable;
|
2
|
+
using System.Runtime.InteropServices;
|
1
3
|
using System.Text.Json;
|
2
4
|
|
3
5
|
using NuGetUpdater.Core.Discover;
|
@@ -9,12 +11,28 @@ namespace NuGetUpdater.Core.Test.Discover;
|
|
9
11
|
public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
10
12
|
{
|
11
13
|
[Theory]
|
12
|
-
[InlineData("src/project.csproj")]
|
13
|
-
[InlineData("src/project.
|
14
|
-
[InlineData("src/project.
|
15
|
-
|
14
|
+
[InlineData("src/project.csproj", true)]
|
15
|
+
[InlineData("src/project.csproj", false)]
|
16
|
+
[InlineData("src/project.vbproj", true)]
|
17
|
+
[InlineData("src/project.vbproj", false)]
|
18
|
+
[InlineData("src/project.fsproj", true)]
|
19
|
+
[InlineData("src/project.fsproj", false)]
|
20
|
+
public async Task TestProjectFiles(string projectPath, bool useDirectDiscovery)
|
16
21
|
{
|
22
|
+
var expectedDependencies = new List<Dependency>()
|
23
|
+
{
|
24
|
+
new Dependency("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true)
|
25
|
+
};
|
26
|
+
if (useDirectDiscovery && Path.GetExtension(projectPath)! == ".fsproj")
|
27
|
+
{
|
28
|
+
// this package ships with the SDK and is automatically added for F# projects but should be manually added here to make the test consistent
|
29
|
+
// only direct package discovery finds this, though
|
30
|
+
expectedDependencies.Add(new Dependency("FSharp.Core", "9.0.100", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true));
|
31
|
+
}
|
32
|
+
|
33
|
+
var experimentsManager = new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery };
|
17
34
|
await TestDiscoveryAsync(
|
35
|
+
experimentsManager: experimentsManager,
|
18
36
|
packages:
|
19
37
|
[
|
20
38
|
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net8.0"),
|
@@ -43,26 +61,77 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
43
61
|
{
|
44
62
|
FilePath = Path.GetFileName(projectPath),
|
45
63
|
TargetFrameworks = ["net8.0"],
|
64
|
+
Dependencies = expectedDependencies.ToImmutableArray(),
|
65
|
+
Properties = [
|
66
|
+
new("SomePackageVersion", "9.0.1", projectPath),
|
67
|
+
new("TargetFramework", "net8.0", projectPath),
|
68
|
+
],
|
46
69
|
ReferencedProjectPaths = [],
|
47
|
-
|
70
|
+
ImportedFiles = [],
|
71
|
+
AdditionalFiles = [],
|
72
|
+
}
|
73
|
+
]
|
74
|
+
}
|
75
|
+
);
|
76
|
+
}
|
77
|
+
|
78
|
+
[Theory]
|
79
|
+
[InlineData(true)]
|
80
|
+
[InlineData(false)]
|
81
|
+
public async Task FindDependenciesFromSDKProjectsWithDesktopTFM(bool useDirectDiscovery)
|
82
|
+
{
|
83
|
+
var experimentsManager = new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery };
|
84
|
+
await TestDiscoveryAsync(
|
85
|
+
experimentsManager: experimentsManager,
|
86
|
+
packages:
|
87
|
+
[
|
88
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "1.2.3", "net472"),
|
89
|
+
],
|
90
|
+
workspacePath: "src",
|
91
|
+
files:
|
92
|
+
[
|
93
|
+
("src/project.csproj", """
|
94
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
95
|
+
<PropertyGroup>
|
96
|
+
<TargetFramework>net472</TargetFramework>
|
97
|
+
</PropertyGroup>
|
98
|
+
<ItemGroup>
|
99
|
+
<PackageReference Include="Some.Package" Version="1.2.3" />
|
100
|
+
</ItemGroup>
|
101
|
+
</Project>
|
102
|
+
""")
|
103
|
+
],
|
104
|
+
expectedResult: new()
|
105
|
+
{
|
106
|
+
Path = "src",
|
107
|
+
Projects = [
|
108
|
+
new()
|
109
|
+
{
|
110
|
+
FilePath = "project.csproj",
|
111
|
+
TargetFrameworks = ["net472"],
|
48
112
|
Dependencies = [
|
49
|
-
new("
|
50
|
-
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true)
|
113
|
+
new("Some.Package", "1.2.3", DependencyType.PackageReference, TargetFrameworks: ["net472"], IsDirect: true)
|
51
114
|
],
|
52
115
|
Properties = [
|
53
|
-
new("
|
54
|
-
|
55
|
-
]
|
116
|
+
new("TargetFramework", "net472", "src/project.csproj"),
|
117
|
+
],
|
118
|
+
ReferencedProjectPaths = [],
|
119
|
+
ImportedFiles = [],
|
120
|
+
AdditionalFiles = [],
|
56
121
|
}
|
57
122
|
]
|
58
123
|
}
|
59
124
|
);
|
60
125
|
}
|
61
126
|
|
62
|
-
[
|
63
|
-
|
127
|
+
[Theory]
|
128
|
+
[InlineData(true)]
|
129
|
+
[InlineData(false)]
|
130
|
+
public async Task TestDependencyWithTrailingSpacesInAttribute(bool useDirectDiscovery)
|
64
131
|
{
|
132
|
+
var experimentsManager = new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery };
|
65
133
|
await TestDiscoveryAsync(
|
134
|
+
experimentsManager: experimentsManager,
|
66
135
|
packages:
|
67
136
|
[
|
68
137
|
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net8.0"),
|
@@ -91,16 +160,16 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
91
160
|
{
|
92
161
|
FilePath = "project.csproj",
|
93
162
|
TargetFrameworks = ["net8.0"],
|
94
|
-
ReferencedProjectPaths = [],
|
95
|
-
ExpectedDependencyCount = 2,
|
96
163
|
Dependencies = [
|
97
|
-
new("Microsoft.NET.Sdk", null, DependencyType.MSBuildSdk),
|
98
164
|
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true)
|
99
165
|
],
|
100
166
|
Properties = [
|
101
167
|
new("SomePackageVersion", "9.0.1", "src/project.csproj"),
|
102
168
|
new("TargetFramework", "net8.0", "src/project.csproj"),
|
103
|
-
]
|
169
|
+
],
|
170
|
+
ReferencedProjectPaths = [],
|
171
|
+
ImportedFiles = [],
|
172
|
+
AdditionalFiles = [],
|
104
173
|
}
|
105
174
|
]
|
106
175
|
}
|
@@ -116,6 +185,7 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
116
185
|
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net8.0"),
|
117
186
|
MockNuGetPackage.CreateSimplePackage("Some.Package2", "9.0.1", "net8.0"),
|
118
187
|
],
|
188
|
+
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = true },
|
119
189
|
workspacePath: "src",
|
120
190
|
files: new[]
|
121
191
|
{
|
@@ -141,16 +211,119 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
141
211
|
FilePath = "project.csproj",
|
142
212
|
TargetFrameworks = ["net8.0"],
|
143
213
|
ReferencedProjectPaths = [],
|
144
|
-
ExpectedDependencyCount = 3,
|
145
214
|
Dependencies = [
|
146
|
-
new("Microsoft.NET.Sdk", null, DependencyType.MSBuildSdk),
|
147
215
|
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true),
|
148
216
|
new("Some.Package2", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true),
|
149
217
|
],
|
150
218
|
Properties = [
|
151
219
|
new("SomePackageVersion", "9.0.1", "src/project.csproj"),
|
152
220
|
new("TargetFramework", "net8.0", "src/project.csproj"),
|
153
|
-
]
|
221
|
+
],
|
222
|
+
ImportedFiles = [],
|
223
|
+
AdditionalFiles = [],
|
224
|
+
}
|
225
|
+
]
|
226
|
+
}
|
227
|
+
);
|
228
|
+
}
|
229
|
+
|
230
|
+
[LinuxOnlyFact]
|
231
|
+
public async Task TestDependenciesCaseSensitiveProjectPaths()
|
232
|
+
{
|
233
|
+
await TestDiscoveryAsync(
|
234
|
+
packages:
|
235
|
+
[
|
236
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net8.0"),
|
237
|
+
],
|
238
|
+
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = true },
|
239
|
+
workspacePath: "src",
|
240
|
+
files: new[]
|
241
|
+
{
|
242
|
+
("src/test/project1/project1.csproj", """
|
243
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
244
|
+
<PropertyGroup>
|
245
|
+
<TargetFramework>net8.0</TargetFramework>
|
246
|
+
</PropertyGroup>
|
247
|
+
|
248
|
+
<ItemGroup>
|
249
|
+
<PackageReference Include="Some.Package" Version="9.0.1" />
|
250
|
+
</ItemGroup>
|
251
|
+
</Project>
|
252
|
+
"""),
|
253
|
+
("src/TEST/project2/project2.csproj", """
|
254
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
255
|
+
<PropertyGroup>
|
256
|
+
<TargetFramework>net8.0</TargetFramework>
|
257
|
+
</PropertyGroup>
|
258
|
+
|
259
|
+
<ItemGroup>
|
260
|
+
<PackageReference Include="Some.Package" Version="9.0.1" />
|
261
|
+
</ItemGroup>
|
262
|
+
</Project>
|
263
|
+
"""),
|
264
|
+
// Add solution files
|
265
|
+
("src/solution.sln", """
|
266
|
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
267
|
+
# Visual Studio 14
|
268
|
+
VisualStudioVersion = 14.0.22705.0
|
269
|
+
MinimumVisualStudioVersion = 10.0.40219.1
|
270
|
+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project1", "test\project1\project1.csproj", "{782E0C0A-10D3-444D-9640-263D03D2B20C}"
|
271
|
+
EndProject
|
272
|
+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project2", "test\project2\project2.csproj", "{782E0C0A-10D3-444D-9640-263D03D2B20D}"
|
273
|
+
EndProject
|
274
|
+
Global
|
275
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
276
|
+
Debug|Any CPU = Debug|Any CPU
|
277
|
+
Release|Any CPU = Release|Any CPU
|
278
|
+
EndGlobalSection
|
279
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
280
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
281
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
282
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
283
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.Build.0 = Release|Any CPU
|
284
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
285
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
286
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
287
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20D}.Release|Any CPU.Build.0 = Release|Any CPU
|
288
|
+
EndGlobalSection
|
289
|
+
GlobalSection(SolutionProperties) = preSolution
|
290
|
+
HideSolutionNode = FALSE
|
291
|
+
EndGlobalSection
|
292
|
+
EndGlobal
|
293
|
+
""")
|
294
|
+
|
295
|
+
},
|
296
|
+
expectedResult: new()
|
297
|
+
{
|
298
|
+
Path = "src",
|
299
|
+
Projects = [
|
300
|
+
new()
|
301
|
+
{
|
302
|
+
FilePath = "test/project1/project1.csproj",
|
303
|
+
TargetFrameworks = ["net8.0"],
|
304
|
+
ReferencedProjectPaths = [],
|
305
|
+
Dependencies = [
|
306
|
+
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true),
|
307
|
+
],
|
308
|
+
Properties = [
|
309
|
+
new("TargetFramework", "net8.0", "src/test/project1/project1.csproj"),
|
310
|
+
],
|
311
|
+
ImportedFiles = [],
|
312
|
+
AdditionalFiles = [],
|
313
|
+
},
|
314
|
+
new()
|
315
|
+
{
|
316
|
+
FilePath = "TEST/project2/project2.csproj",
|
317
|
+
TargetFrameworks = ["net8.0"],
|
318
|
+
ReferencedProjectPaths = [],
|
319
|
+
Dependencies = [
|
320
|
+
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true),
|
321
|
+
],
|
322
|
+
Properties = [
|
323
|
+
new("TargetFramework", "net8.0", "src/TEST/project2/project2.csproj"),
|
324
|
+
],
|
325
|
+
ImportedFiles = [],
|
326
|
+
AdditionalFiles = [],
|
154
327
|
}
|
155
328
|
]
|
156
329
|
}
|
@@ -166,6 +339,7 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
166
339
|
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net8.0"),
|
167
340
|
MockNuGetPackage.CreateSimplePackage("Some.Package2", "9.0.1", "net8.0"),
|
168
341
|
],
|
342
|
+
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = true },
|
169
343
|
workspacePath: "src",
|
170
344
|
files: new[]
|
171
345
|
{
|
@@ -191,26 +365,30 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
191
365
|
FilePath = "project.csproj",
|
192
366
|
TargetFrameworks = ["net8.0"],
|
193
367
|
ReferencedProjectPaths = [],
|
194
|
-
ExpectedDependencyCount = 3,
|
195
368
|
Dependencies = [
|
196
|
-
new("Microsoft.NET.Sdk", null, DependencyType.MSBuildSdk),
|
197
369
|
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true),
|
198
370
|
new("Some.Package2", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true),
|
199
371
|
],
|
200
372
|
Properties = [
|
201
373
|
new("SomePackageVersion", "9.0.1", "src/project.csproj"),
|
202
374
|
new("TargetFramework", "net8.0", "src/project.csproj"),
|
203
|
-
]
|
375
|
+
],
|
376
|
+
ImportedFiles = [],
|
377
|
+
AdditionalFiles = [],
|
204
378
|
}
|
205
379
|
]
|
206
380
|
}
|
207
381
|
);
|
208
382
|
}
|
209
383
|
|
210
|
-
[
|
211
|
-
|
384
|
+
[Theory]
|
385
|
+
[InlineData(true)]
|
386
|
+
[InlineData(false)]
|
387
|
+
public async Task TestPackageConfig(bool useDirectDiscovery)
|
212
388
|
{
|
389
|
+
var experimentsManager = new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery };
|
213
390
|
await TestDiscoveryAsync(
|
391
|
+
experimentsManager: experimentsManager,
|
214
392
|
packages:
|
215
393
|
[
|
216
394
|
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
@@ -250,15 +428,15 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
250
428
|
{
|
251
429
|
FilePath = "project.csproj",
|
252
430
|
TargetFrameworks = ["net45"],
|
253
|
-
ReferencedProjectPaths = [],
|
254
|
-
ExpectedDependencyCount = 2,
|
255
431
|
Dependencies = [
|
256
|
-
new("Microsoft.NETFramework.ReferenceAssemblies", "1.0.3", DependencyType.Unknown, TargetFrameworks: ["net45"], IsTransitive: true),
|
257
432
|
new("Some.Package", "7.0.1", DependencyType.PackagesConfig, TargetFrameworks: ["net45"]),
|
258
433
|
],
|
259
|
-
Properties = [
|
260
|
-
|
261
|
-
]
|
434
|
+
Properties = [],
|
435
|
+
ReferencedProjectPaths = [],
|
436
|
+
ImportedFiles = [],
|
437
|
+
AdditionalFiles = [
|
438
|
+
"packages.config",
|
439
|
+
],
|
262
440
|
}
|
263
441
|
]
|
264
442
|
}
|
@@ -266,9 +444,10 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
266
444
|
}
|
267
445
|
|
268
446
|
[Fact]
|
269
|
-
public async Task
|
447
|
+
public async Task TestProps_DirectDiscovery()
|
270
448
|
{
|
271
449
|
await TestDiscoveryAsync(
|
450
|
+
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = true },
|
272
451
|
packages:
|
273
452
|
[
|
274
453
|
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net8.0"),
|
@@ -304,44 +483,103 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
304
483
|
expectedResult: new()
|
305
484
|
{
|
306
485
|
Path = "src",
|
307
|
-
ExpectedProjectCount = 2,
|
308
486
|
Projects = [
|
309
487
|
new()
|
310
488
|
{
|
311
489
|
FilePath = "project.csproj",
|
312
490
|
TargetFrameworks = ["net8.0"],
|
491
|
+
Dependencies = [
|
492
|
+
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true)
|
493
|
+
],
|
494
|
+
Properties = [
|
495
|
+
new("TargetFramework", "net8.0", "src/project.csproj")
|
496
|
+
],
|
313
497
|
ReferencedProjectPaths = [],
|
314
|
-
|
498
|
+
ImportedFiles = [
|
499
|
+
"../Directory.Build.props",
|
500
|
+
"../Directory.Packages.props",
|
501
|
+
],
|
502
|
+
AdditionalFiles = [],
|
503
|
+
}
|
504
|
+
],
|
505
|
+
}
|
506
|
+
);
|
507
|
+
}
|
508
|
+
|
509
|
+
[Fact]
|
510
|
+
public async Task TestProps_NoDirectDiscovery()
|
511
|
+
{
|
512
|
+
await TestDiscoveryAsync(
|
513
|
+
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = false },
|
514
|
+
packages:
|
515
|
+
[
|
516
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net8.0"),
|
517
|
+
],
|
518
|
+
workspacePath: "src",
|
519
|
+
files: new[]
|
520
|
+
{
|
521
|
+
("src/project.csproj", """
|
522
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
523
|
+
<PropertyGroup>
|
524
|
+
<TargetFramework>net8.0</TargetFramework>
|
525
|
+
</PropertyGroup>
|
526
|
+
|
527
|
+
<ItemGroup>
|
528
|
+
<PackageReference Include="Some.Package" />
|
529
|
+
</ItemGroup>
|
530
|
+
</Project>
|
531
|
+
"""),
|
532
|
+
("Directory.Build.props", "<Project />"),
|
533
|
+
("Directory.Packages.props", """
|
534
|
+
<Project>
|
535
|
+
<PropertyGroup>
|
536
|
+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
537
|
+
<SomePackageVersion>9.0.1</SomePackageVersion>
|
538
|
+
</PropertyGroup>
|
539
|
+
|
540
|
+
<ItemGroup>
|
541
|
+
<PackageVersion Include="Some.Package" Version="$(SomePackageVersion)" />
|
542
|
+
</ItemGroup>
|
543
|
+
</Project>
|
544
|
+
""")
|
545
|
+
},
|
546
|
+
expectedResult: new()
|
547
|
+
{
|
548
|
+
Path = "src",
|
549
|
+
Projects = [
|
550
|
+
new()
|
551
|
+
{
|
552
|
+
FilePath = "project.csproj",
|
553
|
+
TargetFrameworks = ["net8.0"],
|
315
554
|
Dependencies = [
|
316
|
-
new("Microsoft.NET.Sdk", null, DependencyType.MSBuildSdk),
|
317
555
|
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true)
|
318
556
|
],
|
319
557
|
Properties = [
|
320
558
|
new("ManagePackageVersionsCentrally", "true", "Directory.Packages.props"),
|
321
559
|
new("SomePackageVersion", "9.0.1", "Directory.Packages.props"),
|
322
|
-
new("TargetFramework", "net8.0", "src/project.csproj")
|
323
|
-
]
|
560
|
+
new("TargetFramework", "net8.0", "src/project.csproj")
|
561
|
+
],
|
562
|
+
ReferencedProjectPaths = [],
|
563
|
+
ImportedFiles = [
|
564
|
+
"../Directory.Build.props",
|
565
|
+
"../Directory.Packages.props",
|
566
|
+
],
|
567
|
+
AdditionalFiles = [],
|
324
568
|
}
|
325
569
|
],
|
326
|
-
DirectoryPackagesProps = new()
|
327
|
-
{
|
328
|
-
FilePath = "../Directory.Packages.props",
|
329
|
-
Dependencies = [
|
330
|
-
new("Some.Package", "9.0.1", DependencyType.PackageVersion, IsDirect: true)
|
331
|
-
],
|
332
|
-
}
|
333
570
|
}
|
334
571
|
);
|
335
572
|
}
|
336
573
|
|
337
574
|
[Fact]
|
338
|
-
public async Task
|
575
|
+
public async Task TestRepo_DirectDiscovery()
|
339
576
|
{
|
340
577
|
var solutionPath = "solution.sln";
|
341
578
|
await TestDiscoveryAsync(
|
579
|
+
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = true },
|
342
580
|
packages:
|
343
581
|
[
|
344
|
-
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "
|
582
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net7.0"),
|
345
583
|
],
|
346
584
|
workspacePath: "",
|
347
585
|
files: new[]
|
@@ -429,31 +667,26 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
429
667
|
expectedResult: new()
|
430
668
|
{
|
431
669
|
Path = "",
|
432
|
-
ExpectedProjectCount = 2,
|
433
670
|
Projects = [
|
434
671
|
new()
|
435
672
|
{
|
436
673
|
FilePath = "src/project.csproj",
|
437
674
|
TargetFrameworks = ["net7.0", "net8.0"],
|
438
|
-
ExpectedDependencyCount = 2,
|
439
675
|
Dependencies = [
|
440
|
-
new("
|
441
|
-
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["
|
676
|
+
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net7.0"], IsDirect: true),
|
677
|
+
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true),
|
442
678
|
],
|
443
679
|
Properties = [
|
444
|
-
new("
|
445
|
-
|
446
|
-
|
447
|
-
|
680
|
+
new("TargetFrameworks", "net7.0;net8.0", "src/project.csproj")
|
681
|
+
],
|
682
|
+
ReferencedProjectPaths = [],
|
683
|
+
ImportedFiles = [
|
684
|
+
"../Directory.Build.props",
|
685
|
+
"../Directory.Packages.props",
|
686
|
+
],
|
687
|
+
AdditionalFiles = [],
|
448
688
|
}
|
449
689
|
],
|
450
|
-
DirectoryPackagesProps = new()
|
451
|
-
{
|
452
|
-
FilePath = "Directory.Packages.props",
|
453
|
-
Dependencies = [
|
454
|
-
new("Some.Package", "9.0.1", DependencyType.PackageVersion, IsDirect: true)
|
455
|
-
],
|
456
|
-
},
|
457
690
|
GlobalJson = new()
|
458
691
|
{
|
459
692
|
FilePath = "global.json",
|
@@ -538,31 +771,27 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
538
771
|
expectedResult: new()
|
539
772
|
{
|
540
773
|
Path = "",
|
541
|
-
ExpectedProjectCount = 2,
|
542
774
|
Projects = [
|
543
775
|
new()
|
544
776
|
{
|
545
777
|
FilePath = "src/project.csproj",
|
546
778
|
TargetFrameworks = ["net7.0", "net8.0"],
|
547
|
-
ExpectedDependencyCount = 2,
|
548
779
|
Dependencies = [
|
549
|
-
new("Microsoft.NET.Sdk", null, DependencyType.MSBuildSdk),
|
550
780
|
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net7.0", "net8.0"], IsDirect: true)
|
551
781
|
],
|
552
782
|
Properties = [
|
553
783
|
new("ManagePackageVersionsCentrally", "true", "Directory.Packages.props"),
|
554
784
|
new("SomePackageVersion", "9.0.1", "Directory.Packages.props"),
|
555
785
|
new("TargetFrameworks", "net7.0;net8.0", "src/project.csproj"),
|
556
|
-
]
|
786
|
+
],
|
787
|
+
ReferencedProjectPaths = [],
|
788
|
+
ImportedFiles = [
|
789
|
+
"../Directory.Build.props",
|
790
|
+
"../Directory.Packages.props",
|
791
|
+
],
|
792
|
+
AdditionalFiles = [],
|
557
793
|
}
|
558
794
|
],
|
559
|
-
DirectoryPackagesProps = new()
|
560
|
-
{
|
561
|
-
FilePath = "Directory.Packages.props",
|
562
|
-
Dependencies = [
|
563
|
-
new("Some.Package", "9.0.1", DependencyType.PackageVersion, IsDirect: true)
|
564
|
-
],
|
565
|
-
},
|
566
795
|
}
|
567
796
|
);
|
568
797
|
}
|
@@ -615,39 +844,177 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
615
844
|
expectedResult: new()
|
616
845
|
{
|
617
846
|
Path = "",
|
618
|
-
ExpectedProjectCount = 2,
|
619
847
|
Projects = [
|
620
848
|
new()
|
849
|
+
{
|
850
|
+
FilePath = "src/project.csproj",
|
851
|
+
TargetFrameworks = ["net7.0", "net8.0"],
|
852
|
+
Dependencies = [
|
853
|
+
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net7.0", "net8.0"], IsDirect: true)
|
854
|
+
],
|
855
|
+
Properties = [
|
856
|
+
new("ManagePackageVersionsCentrally", "true", "Directory.Packages.props"),
|
857
|
+
new("SomePackageVersion", "9.0.1", "Directory.Packages.props"),
|
858
|
+
new("TargetFrameworks", "net7.0;net8.0", "src/project.csproj"),
|
859
|
+
],
|
860
|
+
ReferencedProjectPaths = [],
|
861
|
+
ImportedFiles = [
|
862
|
+
"../Directory.Build.props",
|
863
|
+
"../Directory.Packages.props",
|
864
|
+
],
|
865
|
+
AdditionalFiles = [],
|
866
|
+
}
|
867
|
+
],
|
868
|
+
}
|
869
|
+
);
|
870
|
+
}
|
871
|
+
|
872
|
+
[Fact]
|
873
|
+
public async Task TestRepo_NoDirectDiscovery()
|
874
|
+
{
|
875
|
+
var solutionPath = "solution.sln";
|
876
|
+
await TestDiscoveryAsync(
|
877
|
+
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = false },
|
878
|
+
packages:
|
879
|
+
[
|
880
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net7.0"),
|
881
|
+
],
|
882
|
+
workspacePath: "",
|
883
|
+
files: new[]
|
884
|
+
{
|
885
|
+
("src/project.csproj", """
|
886
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
887
|
+
<PropertyGroup>
|
888
|
+
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
|
889
|
+
</PropertyGroup>
|
890
|
+
|
891
|
+
<ItemGroup>
|
892
|
+
<PackageReference Include="Some.Package" />
|
893
|
+
</ItemGroup>
|
894
|
+
</Project>
|
895
|
+
"""),
|
896
|
+
("Directory.Build.props", "<Project />"),
|
897
|
+
("Directory.Packages.props", """
|
898
|
+
<Project>
|
899
|
+
<PropertyGroup>
|
900
|
+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
901
|
+
<SomePackageVersion>9.0.1</SomePackageVersion>
|
902
|
+
</PropertyGroup>
|
903
|
+
|
904
|
+
<ItemGroup>
|
905
|
+
<PackageVersion Include="Some.Package" Version="$(SomePackageVersion)" />
|
906
|
+
</ItemGroup>
|
907
|
+
</Project>
|
908
|
+
"""),
|
909
|
+
(solutionPath, """
|
910
|
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
911
|
+
# Visual Studio 14
|
912
|
+
VisualStudioVersion = 14.0.22705.0
|
913
|
+
MinimumVisualStudioVersion = 10.0.40219.1
|
914
|
+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project", ".\src\project.csproj", "{782E0C0A-10D3-444D-9640-263D03D2B20C}"
|
915
|
+
EndProject
|
916
|
+
Global
|
917
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
918
|
+
Debug|Any CPU = Debug|Any CPU
|
919
|
+
Release|Any CPU = Release|Any CPU
|
920
|
+
EndGlobalSection
|
921
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
922
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
923
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
924
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
925
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.Build.0 = Release|Any CPU
|
926
|
+
EndGlobalSection
|
927
|
+
GlobalSection(SolutionProperties) = preSolution
|
928
|
+
HideSolutionNode = FALSE
|
929
|
+
EndGlobalSection
|
930
|
+
EndGlobal
|
931
|
+
"""),
|
932
|
+
("global.json", """
|
933
|
+
{
|
934
|
+
"sdk": {
|
935
|
+
"version": "6.0.405",
|
936
|
+
"rollForward": "latestPatch"
|
937
|
+
},
|
938
|
+
"msbuild-sdks": {
|
939
|
+
"My.Custom.Sdk": "5.0.0",
|
940
|
+
"My.Other.Sdk": "1.0.0-beta"
|
941
|
+
}
|
942
|
+
}
|
943
|
+
"""),
|
944
|
+
(".config/dotnet-tools.json", """
|
945
|
+
{
|
946
|
+
"version": 1,
|
947
|
+
"isRoot": true,
|
948
|
+
"tools": {
|
949
|
+
"microsoft.botsay": {
|
950
|
+
"version": "1.0.0",
|
951
|
+
"commands": [
|
952
|
+
"botsay"
|
953
|
+
]
|
954
|
+
},
|
955
|
+
"dotnetsay": {
|
956
|
+
"version": "2.1.3",
|
957
|
+
"commands": [
|
958
|
+
"dotnetsay"
|
959
|
+
]
|
960
|
+
}
|
961
|
+
}
|
962
|
+
}
|
963
|
+
"""),
|
964
|
+
},
|
965
|
+
expectedResult: new()
|
966
|
+
{
|
967
|
+
Path = "",
|
968
|
+
Projects = [
|
969
|
+
new()
|
970
|
+
{
|
971
|
+
FilePath = "src/project.csproj",
|
972
|
+
TargetFrameworks = ["net7.0", "net8.0"],
|
973
|
+
Dependencies = [
|
974
|
+
new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net7.0", "net8.0"], IsDirect: true),
|
975
|
+
],
|
976
|
+
Properties = [
|
977
|
+
new("ManagePackageVersionsCentrally", "true", "Directory.Packages.props"),
|
978
|
+
new("SomePackageVersion", "9.0.1", "Directory.Packages.props"),
|
979
|
+
new("TargetFrameworks", "net7.0;net8.0", "src/project.csproj")
|
980
|
+
],
|
981
|
+
ReferencedProjectPaths = [],
|
982
|
+
ImportedFiles = [
|
983
|
+
"../Directory.Build.props",
|
984
|
+
"../Directory.Packages.props",
|
985
|
+
],
|
986
|
+
AdditionalFiles = [],
|
987
|
+
}
|
988
|
+
],
|
989
|
+
GlobalJson = new()
|
621
990
|
{
|
622
|
-
FilePath = "
|
623
|
-
TargetFrameworks = ["net7.0", "net8.0"],
|
624
|
-
ExpectedDependencyCount = 2,
|
991
|
+
FilePath = "global.json",
|
625
992
|
Dependencies = [
|
626
|
-
new("Microsoft.NET.Sdk",
|
627
|
-
new("
|
628
|
-
|
629
|
-
Properties = [
|
630
|
-
new("ManagePackageVersionsCentrally", "true", "Directory.Packages.props"),
|
631
|
-
new("SomePackageVersion", "9.0.1", "Directory.Packages.props"),
|
632
|
-
new("TargetFrameworks", "net7.0;net8.0", "src/project.csproj"),
|
993
|
+
new("Microsoft.NET.Sdk", "6.0.405", DependencyType.MSBuildSdk),
|
994
|
+
new("My.Custom.Sdk", "5.0.0", DependencyType.MSBuildSdk),
|
995
|
+
new("My.Other.Sdk", "1.0.0-beta", DependencyType.MSBuildSdk),
|
633
996
|
]
|
634
|
-
}
|
635
|
-
|
636
|
-
DirectoryPackagesProps = new()
|
997
|
+
},
|
998
|
+
DotNetToolsJson = new()
|
637
999
|
{
|
638
|
-
FilePath = "
|
1000
|
+
FilePath = ".config/dotnet-tools.json",
|
639
1001
|
Dependencies = [
|
640
|
-
new("
|
641
|
-
|
642
|
-
|
1002
|
+
new("microsoft.botsay", "1.0.0", DependencyType.DotNetTool),
|
1003
|
+
new("dotnetsay", "2.1.3", DependencyType.DotNetTool),
|
1004
|
+
]
|
1005
|
+
}
|
643
1006
|
}
|
644
1007
|
);
|
645
1008
|
}
|
646
1009
|
|
647
|
-
[
|
648
|
-
|
1010
|
+
[Theory]
|
1011
|
+
[InlineData(true)]
|
1012
|
+
[InlineData(false)]
|
1013
|
+
public async Task NonSupportedProjectExtensionsAreSkipped(bool useDirectDiscovery)
|
649
1014
|
{
|
1015
|
+
var experimentsManager = new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery };
|
650
1016
|
await TestDiscoveryAsync(
|
1017
|
+
experimentsManager: experimentsManager,
|
651
1018
|
packages:
|
652
1019
|
[
|
653
1020
|
MockNuGetPackage.CreateSimplePackage("Some.Package", "1.0.0", "net8.0"),
|
@@ -712,15 +1079,15 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
712
1079
|
{
|
713
1080
|
FilePath = "src/supported.csproj",
|
714
1081
|
TargetFrameworks = ["net8.0"],
|
715
|
-
ReferencedProjectPaths = [],
|
716
|
-
ExpectedDependencyCount = 2,
|
717
1082
|
Dependencies = [
|
718
|
-
new("Microsoft.NET.Sdk", null, DependencyType.MSBuildSdk),
|
719
1083
|
new("Some.Package", "1.0.0", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true)
|
720
1084
|
],
|
721
1085
|
Properties = [
|
722
1086
|
new("TargetFramework", "net8.0", @"src/supported.csproj"),
|
723
|
-
]
|
1087
|
+
],
|
1088
|
+
ReferencedProjectPaths = [],
|
1089
|
+
ImportedFiles = [],
|
1090
|
+
AdditionalFiles = [],
|
724
1091
|
}
|
725
1092
|
]
|
726
1093
|
}
|
@@ -756,8 +1123,10 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
756
1123
|
Assert.Equal("<some package feed>", errorDetails.GetString());
|
757
1124
|
}
|
758
1125
|
|
759
|
-
[
|
760
|
-
|
1126
|
+
[Theory]
|
1127
|
+
[InlineData(true)]
|
1128
|
+
[InlineData(false)]
|
1129
|
+
public async Task ReportsPrivateSourceAuthenticationFailure(bool useDirectDiscovery)
|
761
1130
|
{
|
762
1131
|
static (int, string) TestHttpHandler(string uriString)
|
763
1132
|
{
|
@@ -789,8 +1158,19 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
789
1158
|
_ => (401, "{}"),
|
790
1159
|
};
|
791
1160
|
}
|
1161
|
+
// override various nuget locations
|
1162
|
+
using var tempDir = new TemporaryDirectory();
|
1163
|
+
using var _ = new TemporaryEnvironment(
|
1164
|
+
[
|
1165
|
+
("NUGET_PACKAGES", Path.Combine(tempDir.DirectoryPath, "NUGET_PACKAGES")),
|
1166
|
+
("NUGET_HTTP_CACHE_PATH", Path.Combine(tempDir.DirectoryPath, "NUGET_HTTP_CACHE_PATH")),
|
1167
|
+
("NUGET_SCRATCH", Path.Combine(tempDir.DirectoryPath, "NUGET_SCRATCH")),
|
1168
|
+
("NUGET_PLUGINS_CACHE_PATH", Path.Combine(tempDir.DirectoryPath, "NUGET_PLUGINS_CACHE_PATH")),
|
1169
|
+
]);
|
792
1170
|
using var http = TestHttpServer.CreateTestStringServer(TestHttpHandler);
|
1171
|
+
var experimentsManager = new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery };
|
793
1172
|
await TestDiscoveryAsync(
|
1173
|
+
experimentsManager: experimentsManager,
|
794
1174
|
workspacePath: "",
|
795
1175
|
files:
|
796
1176
|
[
|