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.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/helpers/lib/NuGetUpdater/Directory.Packages.props +19 -17
  3. data/helpers/lib/NuGetUpdater/NuGetProjects/NuGet.Packaging/NuGet.Packaging.csproj +0 -1
  4. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/AnalyzeCommand.cs +7 -3
  5. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/RunCommand.cs +1 -1
  6. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Analyze.cs +29 -2
  7. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Discover.cs +25 -4
  8. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Run.cs +0 -6
  9. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/AnalyzeWorker.cs +33 -16
  10. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/CompatabilityChecker.cs +25 -10
  11. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/NuGetContext.cs +0 -13
  12. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/RequirementArrayConverter.cs +39 -0
  13. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/VersionFinder.cs +1 -1
  14. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Clone/ShellGitCommandHandler.cs +1 -1
  15. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs +60 -66
  16. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DotNetToolsJsonDiscovery.cs +2 -2
  17. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/GlobalJsonDiscovery.cs +2 -2
  18. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/PackagesConfigDiscovery.cs +11 -3
  19. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/PackagesConfigDiscoveryResult.cs +1 -0
  20. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/ProjectDiscoveryResult.cs +2 -4
  21. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs +54 -11
  22. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/WorkspaceDiscoveryResult.cs +0 -1
  23. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/ExperimentsManager.cs +1 -2
  24. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/JsonBuildFile.cs +1 -1
  25. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/FrameworkChecker/CompatabilityChecker.cs +2 -2
  26. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/Advisory.cs +13 -0
  27. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/AllowedUpdate.cs +18 -1
  28. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/CommitOptions.cs +8 -0
  29. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/Condition.cs +19 -0
  30. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/DependencyGroup.cs +8 -0
  31. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/GroupPullRequest.cs +9 -0
  32. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/Job.cs +13 -10
  33. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/PullRequest.cs +11 -0
  34. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/RequirementsUpdateStrategy.cs +15 -0
  35. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunWorker.cs +67 -58
  36. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/VersionConverter.cs +19 -0
  37. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/BindingRedirectManager.cs +15 -44
  38. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/DotNetToolsJsonUpdater.cs +4 -4
  39. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/GlobalJsonUpdater.cs +5 -5
  40. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/LockFileUpdater.cs +2 -10
  41. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackageReferenceUpdater.cs +38 -33
  42. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackagesConfigUpdater.cs +25 -23
  43. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +16 -12
  44. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ConsoleLogger.cs +1 -1
  45. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/DependencyConflictResolver.cs +19 -19
  46. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ILogger.cs +11 -1
  47. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/JsonHelper.cs +2 -0
  48. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +18 -17
  49. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/NuGetHelper.cs +1 -17
  50. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/PathHelper.cs +17 -9
  51. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ProjectHelper.cs +96 -0
  52. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/AnalyzeWorkerTestBase.cs +5 -2
  53. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/AnalyzeWorkerTests.cs +87 -5
  54. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTestBase.cs +2 -5
  55. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.DotNetToolsJson.cs +45 -1
  56. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.GlobalJson.cs +35 -1
  57. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.PackagesConfig.cs +16 -0
  58. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Proj.cs +6 -0
  59. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +143 -36
  60. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +184 -48
  61. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/ExpectedDiscoveryResults.cs +5 -5
  62. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/SdkProjectDiscoveryTests.cs +32 -10
  63. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/MiscellaneousTests.cs +85 -0
  64. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs +402 -102
  65. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +342 -2
  66. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdatedDependencyListTests.cs +60 -2
  67. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/TemporaryDirectory.cs +18 -7
  68. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/TestLogger.cs +1 -1
  69. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/BindingRedirectsTests.cs +1 -1
  70. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/PackagesConfigUpdaterTests.cs +24 -0
  71. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +4 -14
  72. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DotNetTools.cs +84 -0
  73. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.GlobalJson.cs +66 -0
  74. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackageReference.cs +95 -0
  75. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +1 -7
  76. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/AssertEx.cs +1 -1
  77. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/LinuxOnlyAttribute.cs +12 -0
  78. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +558 -711
  79. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/PathHelperTests.cs +47 -2
  80. data/lib/dependabot/nuget/analysis/analysis_json_reader.rb +4 -2
  81. data/lib/dependabot/nuget/analysis/dependency_analysis.rb +3 -3
  82. data/lib/dependabot/nuget/discovery/dependency_details.rb +10 -3
  83. data/lib/dependabot/nuget/discovery/dependency_file_discovery.rb +8 -12
  84. data/lib/dependabot/nuget/discovery/discovery_json_reader.rb +214 -29
  85. data/lib/dependabot/nuget/discovery/project_discovery.rb +41 -8
  86. data/lib/dependabot/nuget/discovery/workspace_discovery.rb +14 -19
  87. data/lib/dependabot/nuget/file_fetcher.rb +11 -393
  88. data/lib/dependabot/nuget/file_parser.rb +23 -61
  89. data/lib/dependabot/nuget/file_updater.rb +28 -23
  90. data/lib/dependabot/nuget/native_helpers.rb +14 -5
  91. data/lib/dependabot/nuget/update_checker/requirements_updater.rb +23 -27
  92. data/lib/dependabot/nuget/update_checker.rb +116 -190
  93. metadata +20 -32
  94. data/helpers/lib/NuGetUpdater/NuGetProjects/Directory.Packages.props +0 -29
  95. data/lib/dependabot/nuget/discovery/directory_packages_props_discovery.rb +0 -43
  96. data/lib/dependabot/nuget/file_fetcher/import_paths_finder.rb +0 -73
  97. data/lib/dependabot/nuget/file_fetcher/sln_project_paths_finder.rb +0 -60
  98. data/lib/dependabot/nuget/http_response_helpers.rb +0 -19
  99. data/lib/dependabot/nuget/native_discovery/native_dependency_details.rb +0 -102
  100. data/lib/dependabot/nuget/native_discovery/native_dependency_file_discovery.rb +0 -129
  101. data/lib/dependabot/nuget/native_discovery/native_discovery_json_reader.rb +0 -171
  102. data/lib/dependabot/nuget/native_discovery/native_evaluation_details.rb +0 -63
  103. data/lib/dependabot/nuget/native_discovery/native_project_discovery.rb +0 -82
  104. data/lib/dependabot/nuget/native_discovery/native_property_details.rb +0 -43
  105. data/lib/dependabot/nuget/native_discovery/native_workspace_discovery.rb +0 -68
  106. data/lib/dependabot/nuget/native_update_checker/native_requirements_updater.rb +0 -105
  107. data/lib/dependabot/nuget/native_update_checker/native_update_checker.rb +0 -201
  108. data/lib/dependabot/nuget/nuget_client.rb +0 -223
  109. data/lib/dependabot/nuget/update_checker/compatibility_checker.rb +0 -116
  110. data/lib/dependabot/nuget/update_checker/dependency_finder.rb +0 -297
  111. data/lib/dependabot/nuget/update_checker/nupkg_fetcher.rb +0 -221
  112. data/lib/dependabot/nuget/update_checker/nuspec_fetcher.rb +0 -110
  113. data/lib/dependabot/nuget/update_checker/property_updater.rb +0 -196
  114. data/lib/dependabot/nuget/update_checker/repository_finder.rb +0 -466
  115. data/lib/dependabot/nuget/update_checker/tfm_comparer.rb +0 -34
  116. data/lib/dependabot/nuget/update_checker/tfm_finder.rb +0 -30
  117. data/lib/dependabot/nuget/update_checker/version_finder.rb +0 -449
@@ -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
  }
@@ -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
  {
@@ -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.ToString());
2291
+ Assert.Equal(Path.Combine(temporaryDirectory.DirectoryPath, "this.file.does.not.exist.targets"), result.ErrorDetails!.ToString());
2298
2292
  }
2299
2293
 
2300
2294
  [Fact]
@@ -97,7 +97,7 @@ public static class AssertEx
97
97
  return;
98
98
  }
99
99
 
100
- Assert.True(false, GetAssertMessage(expected, actual, comparer, message));
100
+ Assert.Fail(GetAssertMessage(expected, actual, comparer, message));
101
101
  }
102
102
 
103
103
  private static bool SequenceEqual<T>(
@@ -0,0 +1,12 @@
1
+ using Xunit;
2
+
3
+ public class LinuxOnlyFactAttribute : FactAttribute
4
+ {
5
+ public LinuxOnlyFactAttribute()
6
+ {
7
+ if (!OperatingSystem.IsLinux())
8
+ {
9
+ Skip = "This test runs only on Linux.";
10
+ }
11
+ }
12
+ }