dependabot-nuget 0.288.0 → 0.290.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/helpers/lib/NuGetUpdater/Directory.Packages.props +19 -17
- data/helpers/lib/NuGetUpdater/NuGetProjects/NuGet.Packaging/NuGet.Packaging.csproj +0 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/AnalyzeCommand.cs +7 -3
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/RunCommand.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Analyze.cs +29 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Discover.cs +25 -4
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Run.cs +0 -6
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/AnalyzeWorker.cs +33 -16
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/CompatabilityChecker.cs +25 -10
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/NuGetContext.cs +0 -13
- 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/Discover/DiscoveryWorker.cs +60 -66
- 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 +11 -3
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/PackagesConfigDiscoveryResult.cs +1 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/ProjectDiscoveryResult.cs +2 -4
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs +54 -11
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/WorkspaceDiscoveryResult.cs +0 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/ExperimentsManager.cs +1 -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/Run/ApiModel/Advisory.cs +13 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/AllowedUpdate.cs +18 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/CommitOptions.cs +8 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/Condition.cs +19 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/DependencyGroup.cs +8 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/GroupPullRequest.cs +9 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/Job.cs +13 -10
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/PullRequest.cs +11 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/RequirementsUpdateStrategy.cs +15 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunWorker.cs +67 -58
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/VersionConverter.cs +19 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/BindingRedirectManager.cs +15 -44
- 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 +2 -10
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackageReferenceUpdater.cs +38 -33
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackagesConfigUpdater.cs +25 -23
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +16 -12
- 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/JsonHelper.cs +2 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +18 -17
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/NuGetHelper.cs +1 -17
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/PathHelper.cs +17 -9
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ProjectHelper.cs +96 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/AnalyzeWorkerTestBase.cs +5 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/AnalyzeWorkerTests.cs +87 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTestBase.cs +2 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.DotNetToolsJson.cs +45 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.GlobalJson.cs +35 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.PackagesConfig.cs +16 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Proj.cs +6 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +143 -36
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +184 -48
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/ExpectedDiscoveryResults.cs +5 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/SdkProjectDiscoveryTests.cs +32 -10
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/MiscellaneousTests.cs +85 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs +402 -102
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +342 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdatedDependencyListTests.cs +60 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/TemporaryDirectory.cs +18 -7
- 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/PackagesConfigUpdaterTests.cs +24 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +4 -14
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DotNetTools.cs +84 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.GlobalJson.cs +66 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackageReference.cs +95 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +1 -7
- 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 +558 -711
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/PathHelperTests.cs +47 -2
- data/lib/dependabot/nuget/analysis/analysis_json_reader.rb +4 -2
- data/lib/dependabot/nuget/analysis/dependency_analysis.rb +3 -3
- data/lib/dependabot/nuget/discovery/dependency_details.rb +10 -3
- data/lib/dependabot/nuget/discovery/dependency_file_discovery.rb +8 -12
- data/lib/dependabot/nuget/discovery/discovery_json_reader.rb +214 -29
- data/lib/dependabot/nuget/discovery/project_discovery.rb +41 -8
- data/lib/dependabot/nuget/discovery/workspace_discovery.rb +14 -19
- data/lib/dependabot/nuget/file_fetcher.rb +11 -393
- data/lib/dependabot/nuget/file_parser.rb +23 -61
- data/lib/dependabot/nuget/file_updater.rb +28 -23
- data/lib/dependabot/nuget/native_helpers.rb +14 -5
- data/lib/dependabot/nuget/update_checker/requirements_updater.rb +23 -27
- data/lib/dependabot/nuget/update_checker.rb +116 -190
- metadata +20 -32
- data/helpers/lib/NuGetUpdater/NuGetProjects/Directory.Packages.props +0 -29
- data/lib/dependabot/nuget/discovery/directory_packages_props_discovery.rb +0 -43
- 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/http_response_helpers.rb +0 -19
- data/lib/dependabot/nuget/native_discovery/native_dependency_details.rb +0 -102
- data/lib/dependabot/nuget/native_discovery/native_dependency_file_discovery.rb +0 -129
- data/lib/dependabot/nuget/native_discovery/native_discovery_json_reader.rb +0 -171
- data/lib/dependabot/nuget/native_discovery/native_evaluation_details.rb +0 -63
- data/lib/dependabot/nuget/native_discovery/native_project_discovery.rb +0 -82
- data/lib/dependabot/nuget/native_discovery/native_property_details.rb +0 -43
- data/lib/dependabot/nuget/native_discovery/native_workspace_discovery.rb +0 -68
- data/lib/dependabot/nuget/native_update_checker/native_requirements_updater.rb +0 -105
- data/lib/dependabot/nuget/native_update_checker/native_update_checker.rb +0 -201
- data/lib/dependabot/nuget/nuget_client.rb +0 -223
- data/lib/dependabot/nuget/update_checker/compatibility_checker.rb +0 -116
- data/lib/dependabot/nuget/update_checker/dependency_finder.rb +0 -297
- data/lib/dependabot/nuget/update_checker/nupkg_fetcher.rb +0 -221
- data/lib/dependabot/nuget/update_checker/nuspec_fetcher.rb +0 -110
- data/lib/dependabot/nuget/update_checker/property_updater.rb +0 -196
- data/lib/dependabot/nuget/update_checker/repository_finder.rb +0 -466
- data/lib/dependabot/nuget/update_checker/tfm_comparer.rb +0 -34
- data/lib/dependabot/nuget/update_checker/tfm_finder.rb +0 -30
- data/lib/dependabot/nuget/update_checker/version_finder.rb +0 -449
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DotNetTools.cs
CHANGED
@@ -287,5 +287,89 @@ public partial class UpdateWorkerTests
|
|
287
287
|
]
|
288
288
|
);
|
289
289
|
}
|
290
|
+
|
291
|
+
[Fact]
|
292
|
+
public async Task UpdateSingleDependencyWithTrailingComma()
|
293
|
+
{
|
294
|
+
await TestUpdateForProject("Some.DotNet.Tool", "1.0.0", "1.1.0",
|
295
|
+
packages:
|
296
|
+
[
|
297
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "13.0.3", "net8.0"),
|
298
|
+
MockNuGetPackage.CreateDotNetToolPackage("Some.DotNet.Tool", "1.0.0", "net8.0"),
|
299
|
+
MockNuGetPackage.CreateDotNetToolPackage("Some.DotNet.Tool", "1.1.0", "net8.0"),
|
300
|
+
],
|
301
|
+
// initial
|
302
|
+
projectContents: """
|
303
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
304
|
+
<PropertyGroup>
|
305
|
+
<TargetFramework>net8.0</TargetFramework>
|
306
|
+
</PropertyGroup>
|
307
|
+
|
308
|
+
<ItemGroup>
|
309
|
+
<PackageReference Include="Some.Package" Version="13.0.3" />
|
310
|
+
</ItemGroup>
|
311
|
+
</Project>
|
312
|
+
""",
|
313
|
+
additionalFiles:
|
314
|
+
[
|
315
|
+
(".config/dotnet-tools.json", """
|
316
|
+
{
|
317
|
+
"version": 1,
|
318
|
+
"isRoot": true,
|
319
|
+
"tools": {
|
320
|
+
"some.dotnet.tool": {
|
321
|
+
"version": "1.0.0",
|
322
|
+
"commands": [
|
323
|
+
"some.dotnet.tool"
|
324
|
+
],
|
325
|
+
},
|
326
|
+
"some-other-tool": {
|
327
|
+
"version": "2.1.3",
|
328
|
+
"commands": [
|
329
|
+
"some-other-tool"
|
330
|
+
],
|
331
|
+
}
|
332
|
+
}
|
333
|
+
}
|
334
|
+
""")
|
335
|
+
],
|
336
|
+
// expected
|
337
|
+
expectedProjectContents: """
|
338
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
339
|
+
<PropertyGroup>
|
340
|
+
<TargetFramework>net8.0</TargetFramework>
|
341
|
+
</PropertyGroup>
|
342
|
+
|
343
|
+
<ItemGroup>
|
344
|
+
<PackageReference Include="Some.Package" Version="13.0.3" />
|
345
|
+
</ItemGroup>
|
346
|
+
</Project>
|
347
|
+
""",
|
348
|
+
// expected files no longer have trailing commas in the json
|
349
|
+
additionalFilesExpected:
|
350
|
+
[
|
351
|
+
(".config/dotnet-tools.json", """
|
352
|
+
{
|
353
|
+
"version": 1,
|
354
|
+
"isRoot": true,
|
355
|
+
"tools": {
|
356
|
+
"some.dotnet.tool": {
|
357
|
+
"version": "1.1.0",
|
358
|
+
"commands": [
|
359
|
+
"some.dotnet.tool"
|
360
|
+
]
|
361
|
+
},
|
362
|
+
"some-other-tool": {
|
363
|
+
"version": "2.1.3",
|
364
|
+
"commands": [
|
365
|
+
"some-other-tool"
|
366
|
+
]
|
367
|
+
}
|
368
|
+
}
|
369
|
+
}
|
370
|
+
""")
|
371
|
+
]
|
372
|
+
);
|
373
|
+
}
|
290
374
|
}
|
291
375
|
}
|
@@ -226,5 +226,71 @@ public partial class UpdateWorkerTests
|
|
226
226
|
]
|
227
227
|
);
|
228
228
|
}
|
229
|
+
|
230
|
+
[Fact]
|
231
|
+
public async Task UpdateDependencyWithTrailingComma()
|
232
|
+
{
|
233
|
+
await TestUpdateForProject("Some.MSBuild.Sdk", "3.2.0", "4.1.0",
|
234
|
+
packages:
|
235
|
+
[
|
236
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "13.0.3", "net8.0"),
|
237
|
+
MockNuGetPackage.CreateMSBuildSdkPackage("Some.MSBuild.Sdk", "3.2.0"),
|
238
|
+
MockNuGetPackage.CreateMSBuildSdkPackage("Some.MSBuild.Sdk", "4.1.0"),
|
239
|
+
],
|
240
|
+
// initial
|
241
|
+
projectContents: """
|
242
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
243
|
+
<PropertyGroup>
|
244
|
+
<TargetFramework>net8.0</TargetFramework>
|
245
|
+
</PropertyGroup>
|
246
|
+
|
247
|
+
<ItemGroup>
|
248
|
+
<PackageReference Include="Some.Package" Version="13.0.3" />
|
249
|
+
</ItemGroup>
|
250
|
+
</Project>
|
251
|
+
""",
|
252
|
+
additionalFiles:
|
253
|
+
[
|
254
|
+
("global.json", """
|
255
|
+
{
|
256
|
+
"sdk": {
|
257
|
+
"version": "6.0.405",
|
258
|
+
"rollForward": "latestPatch"
|
259
|
+
},
|
260
|
+
"msbuild-sdks": {
|
261
|
+
"Some.MSBuild.Sdk": "3.2.0"
|
262
|
+
},
|
263
|
+
}
|
264
|
+
""")
|
265
|
+
],
|
266
|
+
// expected
|
267
|
+
expectedProjectContents: """
|
268
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
269
|
+
<PropertyGroup>
|
270
|
+
<TargetFramework>net8.0</TargetFramework>
|
271
|
+
</PropertyGroup>
|
272
|
+
|
273
|
+
<ItemGroup>
|
274
|
+
<PackageReference Include="Some.Package" Version="13.0.3" />
|
275
|
+
</ItemGroup>
|
276
|
+
</Project>
|
277
|
+
""",
|
278
|
+
// expected file no longer has the trailing comma because the parser removes it.
|
279
|
+
additionalFilesExpected:
|
280
|
+
[
|
281
|
+
("global.json", """
|
282
|
+
{
|
283
|
+
"sdk": {
|
284
|
+
"version": "6.0.405",
|
285
|
+
"rollForward": "latestPatch"
|
286
|
+
},
|
287
|
+
"msbuild-sdks": {
|
288
|
+
"Some.MSBuild.Sdk": "4.1.0"
|
289
|
+
}
|
290
|
+
}
|
291
|
+
""")
|
292
|
+
]
|
293
|
+
);
|
294
|
+
}
|
229
295
|
}
|
230
296
|
}
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackageReference.cs
CHANGED
@@ -158,6 +158,61 @@ public partial class UpdateWorkerTests
|
|
158
158
|
);
|
159
159
|
}
|
160
160
|
|
161
|
+
[Theory]
|
162
|
+
[InlineData(true)]
|
163
|
+
[InlineData(false)]
|
164
|
+
public async Task PackageIsUpdatedFromCommonTargetsFile(bool useDirectDiscovery)
|
165
|
+
{
|
166
|
+
await TestUpdateForProject("Some.Package", "1.0.0", "2.0.0",
|
167
|
+
packages:
|
168
|
+
[
|
169
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "1.0.0", "net8.0"),
|
170
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "2.0.0", "net8.0"),
|
171
|
+
],
|
172
|
+
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery },
|
173
|
+
projectContents: """
|
174
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
175
|
+
<PropertyGroup>
|
176
|
+
<TargetFramework>net8.0</TargetFramework>
|
177
|
+
</PropertyGroup>
|
178
|
+
<Import Project="CommonPackages.targets" />
|
179
|
+
</Project>
|
180
|
+
""",
|
181
|
+
additionalFiles:
|
182
|
+
[
|
183
|
+
("CommonPackages.targets", """
|
184
|
+
<Project>
|
185
|
+
<ItemGroup>
|
186
|
+
<PackageReference Include="Some.Package">
|
187
|
+
<Version>1.0.0</Version>
|
188
|
+
</PackageReference>
|
189
|
+
</ItemGroup>
|
190
|
+
</Project>
|
191
|
+
""")
|
192
|
+
],
|
193
|
+
expectedProjectContents: """
|
194
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
195
|
+
<PropertyGroup>
|
196
|
+
<TargetFramework>net8.0</TargetFramework>
|
197
|
+
</PropertyGroup>
|
198
|
+
<Import Project="CommonPackages.targets" />
|
199
|
+
</Project>
|
200
|
+
""",
|
201
|
+
additionalFilesExpected:
|
202
|
+
[
|
203
|
+
("CommonPackages.targets", """
|
204
|
+
<Project>
|
205
|
+
<ItemGroup>
|
206
|
+
<PackageReference Include="Some.Package">
|
207
|
+
<Version>2.0.0</Version>
|
208
|
+
</PackageReference>
|
209
|
+
</ItemGroup>
|
210
|
+
</Project>
|
211
|
+
""")
|
212
|
+
]
|
213
|
+
);
|
214
|
+
}
|
215
|
+
|
161
216
|
[Fact]
|
162
217
|
public async Task CallingResolveDependencyConflictsNew()
|
163
218
|
{
|
@@ -3109,6 +3164,46 @@ public partial class UpdateWorkerTests
|
|
3109
3164
|
);
|
3110
3165
|
}
|
3111
3166
|
|
3167
|
+
[Fact]
|
3168
|
+
public async Task NoChange_IfPeerDependenciesCannotBeEvaluated()
|
3169
|
+
{
|
3170
|
+
// make sure we don't throw if we find conflicting peer dependencies; this can happen in multi-tfm projects if the dependencies are too complicated to resolve
|
3171
|
+
// eventually this should be able to be resolved, but currently we can't branch on the different packages for different TFMs
|
3172
|
+
await TestNoChangeforProject("Some.Package", "1.0.0", "1.1.0",
|
3173
|
+
packages:
|
3174
|
+
[
|
3175
|
+
// initial packages
|
3176
|
+
new MockNuGetPackage("Some.Package", "1.0.0",
|
3177
|
+
DependencyGroups: [
|
3178
|
+
("net8.0", [("Transitive.Dependency", "8.0.0")]),
|
3179
|
+
("net9.0", [("Transitive.Dependency", "9.0.0")])
|
3180
|
+
]),
|
3181
|
+
MockNuGetPackage.CreateSimplePackage("Transitive.Dependency", "8.0.0", "net8.0"),
|
3182
|
+
MockNuGetPackage.CreateSimplePackage("Transitive.Dependency", "9.0.0", "net9.0"),
|
3183
|
+
|
3184
|
+
// what we're trying to update to, but will fail
|
3185
|
+
new MockNuGetPackage("Some.Package", "1.1.0",
|
3186
|
+
DependencyGroups: [
|
3187
|
+
("net8.0", [("Transitive.Dependency", "8.1.0")]),
|
3188
|
+
("net9.0", [("Transitive.Dependency", "9.1.0")])
|
3189
|
+
]),
|
3190
|
+
MockNuGetPackage.CreateSimplePackage("Transitive.Dependency", "8.1.0", "net8.0"),
|
3191
|
+
MockNuGetPackage.CreateSimplePackage("Transitive.Dependency", "9.1.0", "net9.0"),
|
3192
|
+
],
|
3193
|
+
projectContents: """
|
3194
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
3195
|
+
<PropertyGroup>
|
3196
|
+
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
|
3197
|
+
</PropertyGroup>
|
3198
|
+
<ItemGroup>
|
3199
|
+
<PackageReference Include="Some.Package" Version="1.0.0" />
|
3200
|
+
</ItemGroup>
|
3201
|
+
</Project>
|
3202
|
+
""",
|
3203
|
+
expectedResult: new() // success
|
3204
|
+
);
|
3205
|
+
}
|
3206
|
+
|
3112
3207
|
[Fact]
|
3113
3208
|
public async Task ProcessingProjectWithWorkloadReferencesDoesNotFail()
|
3114
3209
|
{
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs
CHANGED
@@ -2160,12 +2160,6 @@ public partial class UpdateWorkerTests
|
|
2160
2160
|
};
|
2161
2161
|
}
|
2162
2162
|
using var cache = new TemporaryDirectory();
|
2163
|
-
using var env = new TemporaryEnvironment([
|
2164
|
-
("NUGET_PACKAGES", Path.Join(cache.DirectoryPath, "NUGET_PACKAGES")),
|
2165
|
-
("NUGET_HTTP_CACHE_PATH", Path.Join(cache.DirectoryPath, "NUGET_HTTP_CACHE_PATH")),
|
2166
|
-
("NUGET_SCRATCH", Path.Join(cache.DirectoryPath, "NUGET_SCRATCH")),
|
2167
|
-
("NUGET_PLUGINS_CACHE_PATH", Path.Join(cache.DirectoryPath, "NUGET_PLUGINS_CACHE_PATH")),
|
2168
|
-
]);
|
2169
2163
|
using var http = TestHttpServer.CreateTestServer(TestHttpHandler);
|
2170
2164
|
await TestUpdateForProject("Some.Package", "1.0.0", "2.0.0",
|
2171
2165
|
// existing
|
@@ -2294,7 +2288,7 @@ public partial class UpdateWorkerTests
|
|
2294
2288
|
var resultContents = await File.ReadAllTextAsync(resultOutputPath);
|
2295
2289
|
var result = JsonSerializer.Deserialize<UpdateOperationResult>(resultContents, UpdaterWorker.SerializerOptions)!;
|
2296
2290
|
Assert.Equal(ErrorType.MissingFile, result.ErrorType);
|
2297
|
-
Assert.Equal(Path.Combine(temporaryDirectory.DirectoryPath, "this.file.does.not.exist.targets"), result.ErrorDetails
|
2291
|
+
Assert.Equal(Path.Combine(temporaryDirectory.DirectoryPath, "this.file.does.not.exist.targets"), result.ErrorDetails!.ToString());
|
2298
2292
|
}
|
2299
2293
|
|
2300
2294
|
[Fact]
|