dependabot-nuget 0.322.0 → 0.322.1
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/NuGetUpdater.Cli.Test/EntryPointTests.Analyze.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Discover.cs +10 -23
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Run.cs +9 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Update.cs +15 -232
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs +1 -154
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/ExperimentsManager.cs +3 -12
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/AzurePackageDetailFinder.cs +30 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/DetailedPullRequestBodyGenerator.cs +237 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/GitHubPackageDetailFinder.cs +101 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/GitLabPackageDetailFinder.cs +107 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/HttpFetcher.cs +32 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/IHttpFetcher.cs +30 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/IPackageDetailFinder.cs +47 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/IPullRequestBodyGenerator.cs +11 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/SimplePullRequestBodyGenerator.cs +15 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestTextGenerator.cs +7 -3
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunWorker.cs +3 -525
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/CreateSecurityUpdatePullRequestHandler.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/GroupUpdateAllVersionsHandler.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshGroupUpdatePullRequestHandler.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshSecurityUpdatePullRequestHandler.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshVersionUpdatePullRequestHandler.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/FileWriters/FileWriterWorker.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/FileWriters/XmlFileWriter.cs +10 -3
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackageReferenceUpdater.cs +1 -856
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +16 -200
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +6 -556
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/AnalyzeWorkerTests.cs +9 -73
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Clone/CloneWorkerTests.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/DependencySolver/MSBuildDependencySolverTests.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTestBase.cs +1 -20
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.PackagesConfig.cs +3 -62
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +13 -563
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +20 -267
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/SdkProjectDiscoveryTests.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/EndToEndTests.cs +131 -131
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/MiscellaneousTests.cs +0 -203
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/DetailedPullRequestBodyGeneratorTests.cs +871 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/IPackageDetailFinderTests.cs +28 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/TestHttpFetcher.cs +23 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestTextTests.cs +3 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +6 -12
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/CreateSecurityUpdatePullRequestHandlerTests.cs +6 -6
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/GroupUpdateAllVersionsHandlerTests.cs +18 -18
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/RefreshGroupUpdatePullRequestHandlerTests.cs +15 -15
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/RefreshSecurityUpdatePullRequestHandlerTests.cs +21 -21
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/RefreshVersionUpdatePullRequestHandlerTests.cs +15 -15
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/UpdateHandlersTestsBase.cs +1 -8
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/FileWriters/FileWriterWorkerTests.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/FileWriters/XmlFileWriterTests.cs +85 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/PackageReferenceUpdaterTests.cs +1 -159
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +10 -660
- metadata +16 -10
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunResult.cs +0 -13
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestMessageTests.cs +0 -296
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs +0 -3592
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdatePermittedAndMessageTests.cs +0 -457
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DirsProj.cs +0 -378
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterHelperTests.cs +0 -175
@@ -0,0 +1,28 @@
|
|
1
|
+
using NuGetUpdater.Core.Run.PullRequestBodyGenerator;
|
2
|
+
|
3
|
+
using Xunit;
|
4
|
+
|
5
|
+
namespace NuGetUpdater.Core.Test.Run.PullRequestBodyGenerator;
|
6
|
+
|
7
|
+
public class IPackageDetailFinderTests
|
8
|
+
{
|
9
|
+
[Theory]
|
10
|
+
[InlineData("1.0.0", "1.0.0", "1.0.0")]
|
11
|
+
[InlineData("one.zero.zero", "1.0.0", "1.0.0")]
|
12
|
+
[InlineData("version-one.zero.zero", "v1.0.0", "1.0.0")]
|
13
|
+
[InlineData("v-one.zero.zero", "v-one.zero.zero", null)]
|
14
|
+
[InlineData("Stable", "version-1.0.0", "1.0.0")]
|
15
|
+
public void GetVersionFromNames(string releaseName, string tagName, string? expectedVersion)
|
16
|
+
{
|
17
|
+
var actualVersion = IPackageDetailFinder.GetVersionFromNames(releaseName, tagName);
|
18
|
+
if (expectedVersion is null)
|
19
|
+
{
|
20
|
+
Assert.Null(actualVersion);
|
21
|
+
}
|
22
|
+
else
|
23
|
+
{
|
24
|
+
Assert.NotNull(actualVersion);
|
25
|
+
Assert.Equal(expectedVersion, actualVersion.ToString());
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/TestHttpFetcher.cs
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
using NuGetUpdater.Core.Run.PullRequestBodyGenerator;
|
2
|
+
|
3
|
+
namespace NuGetUpdater.Core.Test.Run.PullRequestBodyGenerator;
|
4
|
+
|
5
|
+
internal class TestHttpFetcher : IHttpFetcher
|
6
|
+
{
|
7
|
+
private readonly Dictionary<string, string> _responses;
|
8
|
+
|
9
|
+
public TestHttpFetcher(Dictionary<string, string> responses)
|
10
|
+
{
|
11
|
+
_responses = responses;
|
12
|
+
}
|
13
|
+
|
14
|
+
public void Dispose()
|
15
|
+
{
|
16
|
+
}
|
17
|
+
|
18
|
+
public Task<string?> GetStringAsync(string url)
|
19
|
+
{
|
20
|
+
_responses.TryGetValue(url, out var response);
|
21
|
+
return Task.FromResult(response);
|
22
|
+
}
|
23
|
+
}
|
@@ -34,7 +34,7 @@ public class PullRequestTextTests
|
|
34
34
|
|
35
35
|
[Theory]
|
36
36
|
[MemberData(nameof(GetPullRequestTextTestData))]
|
37
|
-
public
|
37
|
+
public async Task PullRequestText(
|
38
38
|
Job job,
|
39
39
|
UpdateOperationBase[] updateOperationsPerformed,
|
40
40
|
string? dependencyGroupName,
|
@@ -43,10 +43,11 @@ public class PullRequestTextTests
|
|
43
43
|
string expectedBody
|
44
44
|
)
|
45
45
|
{
|
46
|
+
var experimentsManager = new ExperimentsManager() { GenerateSimplePrBody = true };
|
46
47
|
var updateOperationsPerformedImmutable = updateOperationsPerformed.ToImmutableArray();
|
47
48
|
var actualTitle = PullRequestTextGenerator.GetPullRequestTitle(job, updateOperationsPerformedImmutable, dependencyGroupName);
|
48
49
|
var actualCommitMessage = PullRequestTextGenerator.GetPullRequestCommitMessage(job, updateOperationsPerformedImmutable, dependencyGroupName).Replace("\r", "");
|
49
|
-
var actualBody = PullRequestTextGenerator.
|
50
|
+
var actualBody = (await PullRequestTextGenerator.GetPullRequestBodyAsync(job, updateOperationsPerformedImmutable, [], experimentsManager)).Replace("\r", "");
|
50
51
|
Assert.Equal(expectedTitle, actualTitle);
|
51
52
|
Assert.Equal(expectedCommitMessage.Replace("\r", ""), actualCommitMessage);
|
52
53
|
Assert.Equal(expectedBody.Replace("\r", ""), actualBody);
|
@@ -157,8 +157,7 @@ public class SerializationTests : TestBase
|
|
157
157
|
"directory": "some-dir"
|
158
158
|
},
|
159
159
|
"experiments": {
|
160
|
-
"
|
161
|
-
"nuget_use_direct_discovery": true,
|
160
|
+
"nuget_generate_simple_pr_body": true,
|
162
161
|
"unexpected_bool": true,
|
163
162
|
"unexpected_number": 42,
|
164
163
|
"unexpected_null": null,
|
@@ -173,8 +172,7 @@ public class SerializationTests : TestBase
|
|
173
172
|
}
|
174
173
|
""");
|
175
174
|
var experimentsManager = ExperimentsManager.GetExperimentsManager(jobWrapper.Job.Experiments);
|
176
|
-
Assert.True(experimentsManager.
|
177
|
-
Assert.True(experimentsManager.UseDirectDiscovery);
|
175
|
+
Assert.True(experimentsManager.GenerateSimplePrBody);
|
178
176
|
}
|
179
177
|
|
180
178
|
[Fact]
|
@@ -200,8 +198,7 @@ public class SerializationTests : TestBase
|
|
200
198
|
}
|
201
199
|
""");
|
202
200
|
var experimentsManager = ExperimentsManager.GetExperimentsManager(jobWrapper.Job.Experiments);
|
203
|
-
Assert.False(experimentsManager.
|
204
|
-
Assert.False(experimentsManager.UseDirectDiscovery);
|
201
|
+
Assert.False(experimentsManager.GenerateSimplePrBody);
|
205
202
|
}
|
206
203
|
|
207
204
|
[Fact]
|
@@ -225,8 +222,7 @@ public class SerializationTests : TestBase
|
|
225
222
|
}
|
226
223
|
""");
|
227
224
|
var experimentsManager = ExperimentsManager.GetExperimentsManager(jobWrapper.Job.Experiments);
|
228
|
-
Assert.False(experimentsManager.
|
229
|
-
Assert.False(experimentsManager.UseDirectDiscovery);
|
225
|
+
Assert.False(experimentsManager.GenerateSimplePrBody);
|
230
226
|
}
|
231
227
|
|
232
228
|
[Fact]
|
@@ -248,15 +244,13 @@ public class SerializationTests : TestBase
|
|
248
244
|
"directory": "some-dir"
|
249
245
|
},
|
250
246
|
"experiments": {
|
251
|
-
"nuget-
|
252
|
-
"nuget-use-direct-discovery": true
|
247
|
+
"nuget-generate-simple-pr-body": true
|
253
248
|
}
|
254
249
|
}
|
255
250
|
}
|
256
251
|
""");
|
257
252
|
var experimentsManager = ExperimentsManager.GetExperimentsManager(jobWrapper.Job.Experiments);
|
258
|
-
Assert.True(experimentsManager.
|
259
|
-
Assert.True(experimentsManager.UseDirectDiscovery);
|
253
|
+
Assert.True(experimentsManager.GenerateSimplePrBody);
|
260
254
|
}
|
261
255
|
|
262
256
|
[Theory]
|
@@ -136,9 +136,9 @@ public class CreateSecurityUpdatePullRequestHandlerTests : UpdateHandlersTestsBa
|
|
136
136
|
}
|
137
137
|
],
|
138
138
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
139
|
-
CommitMessage =
|
140
|
-
PrTitle =
|
141
|
-
PrBody =
|
139
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
140
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
141
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
142
142
|
DependencyGroup = null,
|
143
143
|
},
|
144
144
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -283,9 +283,9 @@ public class CreateSecurityUpdatePullRequestHandlerTests : UpdateHandlersTestsBa
|
|
283
283
|
}
|
284
284
|
],
|
285
285
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
286
|
-
CommitMessage =
|
287
|
-
PrTitle =
|
288
|
-
PrBody =
|
286
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
287
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
288
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
289
289
|
DependencyGroup = null,
|
290
290
|
},
|
291
291
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -163,9 +163,9 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
163
163
|
},
|
164
164
|
],
|
165
165
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
166
|
-
CommitMessage =
|
167
|
-
PrTitle =
|
168
|
-
PrBody =
|
166
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
167
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
168
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
169
169
|
DependencyGroup = null,
|
170
170
|
},
|
171
171
|
// for "/test"
|
@@ -228,9 +228,9 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
228
228
|
},
|
229
229
|
],
|
230
230
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
231
|
-
CommitMessage =
|
232
|
-
PrTitle =
|
233
|
-
PrBody =
|
231
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
232
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
233
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
234
234
|
DependencyGroup = null,
|
235
235
|
},
|
236
236
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -472,9 +472,9 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
472
472
|
},
|
473
473
|
],
|
474
474
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
475
|
-
CommitMessage =
|
476
|
-
PrTitle =
|
477
|
-
PrBody =
|
475
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
476
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
477
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
478
478
|
DependencyGroup = "test-group",
|
479
479
|
},
|
480
480
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -624,9 +624,9 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
624
624
|
},
|
625
625
|
],
|
626
626
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
627
|
-
CommitMessage =
|
628
|
-
PrTitle =
|
629
|
-
PrBody =
|
627
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
628
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
629
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
630
630
|
DependencyGroup = "test-group",
|
631
631
|
},
|
632
632
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -786,9 +786,9 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
786
786
|
},
|
787
787
|
],
|
788
788
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
789
|
-
CommitMessage =
|
790
|
-
PrTitle =
|
791
|
-
PrBody =
|
789
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
790
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
791
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
792
792
|
DependencyGroup = "test-group-1",
|
793
793
|
},
|
794
794
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -915,9 +915,9 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
915
915
|
},
|
916
916
|
],
|
917
917
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
918
|
-
CommitMessage =
|
919
|
-
PrTitle =
|
920
|
-
PrBody =
|
918
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
919
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
920
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
921
921
|
DependencyGroup = null,
|
922
922
|
},
|
923
923
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -126,9 +126,9 @@ public class RefreshGroupUpdatePullRequestHandlerTests : UpdateHandlersTestsBase
|
|
126
126
|
}
|
127
127
|
],
|
128
128
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
129
|
-
CommitMessage =
|
130
|
-
PrTitle =
|
131
|
-
PrBody =
|
129
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
130
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
131
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
132
132
|
},
|
133
133
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
134
134
|
]
|
@@ -280,9 +280,9 @@ public class RefreshGroupUpdatePullRequestHandlerTests : UpdateHandlersTestsBase
|
|
280
280
|
}
|
281
281
|
],
|
282
282
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
283
|
-
CommitMessage =
|
284
|
-
PrTitle =
|
285
|
-
PrBody =
|
283
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
284
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
285
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
286
286
|
},
|
287
287
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
288
288
|
]
|
@@ -435,9 +435,9 @@ public class RefreshGroupUpdatePullRequestHandlerTests : UpdateHandlersTestsBase
|
|
435
435
|
}
|
436
436
|
],
|
437
437
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
438
|
-
CommitMessage =
|
439
|
-
PrTitle =
|
440
|
-
PrBody =
|
438
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
439
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
440
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
441
441
|
},
|
442
442
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
443
443
|
]
|
@@ -672,9 +672,9 @@ public class RefreshGroupUpdatePullRequestHandlerTests : UpdateHandlersTestsBase
|
|
672
672
|
}
|
673
673
|
],
|
674
674
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
675
|
-
CommitMessage =
|
676
|
-
PrTitle =
|
677
|
-
PrBody =
|
675
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
676
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
677
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
678
678
|
DependencyGroup = "test_group",
|
679
679
|
},
|
680
680
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -806,9 +806,9 @@ public class RefreshGroupUpdatePullRequestHandlerTests : UpdateHandlersTestsBase
|
|
806
806
|
}
|
807
807
|
],
|
808
808
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
809
|
-
CommitMessage =
|
810
|
-
PrTitle =
|
811
|
-
PrBody =
|
809
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
810
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
811
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
812
812
|
DependencyGroup = "test_group",
|
813
813
|
},
|
814
814
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -126,9 +126,9 @@ public class RefreshSecurityUpdatePullRequestHandlerTests : UpdateHandlersTestsB
|
|
126
126
|
}
|
127
127
|
],
|
128
128
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
129
|
-
CommitMessage =
|
130
|
-
PrTitle =
|
131
|
-
PrBody =
|
129
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
130
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
131
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
132
132
|
},
|
133
133
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
134
134
|
]
|
@@ -262,9 +262,9 @@ public class RefreshSecurityUpdatePullRequestHandlerTests : UpdateHandlersTestsB
|
|
262
262
|
}
|
263
263
|
],
|
264
264
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
265
|
-
CommitMessage =
|
266
|
-
PrTitle =
|
267
|
-
PrBody =
|
265
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
266
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
267
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
268
268
|
},
|
269
269
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
270
270
|
]
|
@@ -398,9 +398,9 @@ public class RefreshSecurityUpdatePullRequestHandlerTests : UpdateHandlersTestsB
|
|
398
398
|
}
|
399
399
|
],
|
400
400
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
401
|
-
CommitMessage =
|
402
|
-
PrTitle =
|
403
|
-
PrBody =
|
401
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
402
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
403
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
404
404
|
},
|
405
405
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
406
406
|
]
|
@@ -535,9 +535,9 @@ public class RefreshSecurityUpdatePullRequestHandlerTests : UpdateHandlersTestsB
|
|
535
535
|
}
|
536
536
|
],
|
537
537
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
538
|
-
CommitMessage =
|
539
|
-
PrTitle =
|
540
|
-
PrBody =
|
538
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
539
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
540
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
541
541
|
},
|
542
542
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
543
543
|
]
|
@@ -670,9 +670,9 @@ public class RefreshSecurityUpdatePullRequestHandlerTests : UpdateHandlersTestsB
|
|
670
670
|
}
|
671
671
|
],
|
672
672
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
673
|
-
CommitMessage =
|
674
|
-
PrTitle =
|
675
|
-
PrBody =
|
673
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
674
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
675
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
676
676
|
},
|
677
677
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
678
678
|
]
|
@@ -1077,9 +1077,9 @@ public class RefreshSecurityUpdatePullRequestHandlerTests : UpdateHandlersTestsB
|
|
1077
1077
|
}
|
1078
1078
|
],
|
1079
1079
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
1080
|
-
CommitMessage =
|
1081
|
-
PrTitle =
|
1082
|
-
PrBody =
|
1080
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
1081
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
1082
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
1083
1083
|
DependencyGroup = null,
|
1084
1084
|
},
|
1085
1085
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -1202,9 +1202,9 @@ public class RefreshSecurityUpdatePullRequestHandlerTests : UpdateHandlersTestsB
|
|
1202
1202
|
}
|
1203
1203
|
],
|
1204
1204
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
1205
|
-
CommitMessage =
|
1206
|
-
PrTitle =
|
1207
|
-
PrBody =
|
1205
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
1206
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
1207
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
1208
1208
|
DependencyGroup = null,
|
1209
1209
|
},
|
1210
1210
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -124,9 +124,9 @@ public class RefreshVersionUpdatePullRequestHandlerTests : UpdateHandlersTestsBa
|
|
124
124
|
}
|
125
125
|
],
|
126
126
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
127
|
-
CommitMessage =
|
128
|
-
PrTitle =
|
129
|
-
PrBody =
|
127
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
128
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
129
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
130
130
|
},
|
131
131
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
132
132
|
]
|
@@ -276,9 +276,9 @@ public class RefreshVersionUpdatePullRequestHandlerTests : UpdateHandlersTestsBa
|
|
276
276
|
}
|
277
277
|
],
|
278
278
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
279
|
-
CommitMessage =
|
280
|
-
PrTitle =
|
281
|
-
PrBody =
|
279
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
280
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
281
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
282
282
|
},
|
283
283
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
284
284
|
]
|
@@ -429,9 +429,9 @@ public class RefreshVersionUpdatePullRequestHandlerTests : UpdateHandlersTestsBa
|
|
429
429
|
}
|
430
430
|
],
|
431
431
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
432
|
-
CommitMessage =
|
433
|
-
PrTitle =
|
434
|
-
PrBody =
|
432
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
433
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
434
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
435
435
|
},
|
436
436
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
437
437
|
]
|
@@ -761,9 +761,9 @@ public class RefreshVersionUpdatePullRequestHandlerTests : UpdateHandlersTestsBa
|
|
761
761
|
}
|
762
762
|
],
|
763
763
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
764
|
-
CommitMessage =
|
765
|
-
PrTitle =
|
766
|
-
PrBody =
|
764
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
765
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
766
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
767
767
|
DependencyGroup = null,
|
768
768
|
},
|
769
769
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
@@ -884,9 +884,9 @@ public class RefreshVersionUpdatePullRequestHandlerTests : UpdateHandlersTestsBa
|
|
884
884
|
}
|
885
885
|
],
|
886
886
|
BaseCommitSha = "TEST-COMMIT-SHA",
|
887
|
-
CommitMessage =
|
888
|
-
PrTitle =
|
889
|
-
PrBody =
|
887
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
888
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
889
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
890
890
|
DependencyGroup = null,
|
891
891
|
},
|
892
892
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/UpdateHandlersTestsBase.cs
CHANGED
@@ -30,14 +30,7 @@ public class UpdateHandlersTestsBase : TestBase
|
|
30
30
|
var actualUpdateHandler = RunWorker.GetUpdateHandler(job);
|
31
31
|
Assert.Equal(actualUpdateHandler.GetType(), expectedUpdateHandler.GetType());
|
32
32
|
|
33
|
-
// the new runner doesn't report this result object so we can expect an empty one
|
34
|
-
var expectedResult = new RunResult()
|
35
|
-
{
|
36
|
-
Base64DependencyFiles = [],
|
37
|
-
BaseCommitSha = "TEST-COMMIT-SHA",
|
38
|
-
};
|
39
33
|
experimentsManager ??= new ExperimentsManager();
|
40
|
-
|
41
|
-
return RunWorkerTests.RunAsync(job, files, discoveryWorker, analyzeWorker, updaterWorker, expectedResult, expectedApiMessages, packages, experimentsManager);
|
34
|
+
return EndToEndTests.RunAsync(job, files, discoveryWorker, analyzeWorker, updaterWorker, expectedApiMessages, packages, experimentsManager);
|
42
35
|
}
|
43
36
|
}
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/FileWriters/FileWriterWorkerTests.cs
CHANGED
@@ -880,7 +880,7 @@ public class FileWriterWorkerTests : TestBase
|
|
880
880
|
|
881
881
|
var jobId = "TEST-JOB-ID";
|
882
882
|
var logger = new TestLogger();
|
883
|
-
experimentsManager ??= new ExperimentsManager()
|
883
|
+
experimentsManager ??= new ExperimentsManager();
|
884
884
|
discoveryWorker ??= new DiscoveryWorker(jobId, experimentsManager, logger);
|
885
885
|
var repoContentsPath = new DirectoryInfo(tempDir.DirectoryPath);
|
886
886
|
var projectPath = new FileInfo(Path.Combine(tempDir.DirectoryPath, projectName));
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/FileWriters/XmlFileWriterTests.cs
CHANGED
@@ -662,6 +662,40 @@ public class XmlFileWriterTests : FileWriterTestsBase
|
|
662
662
|
);
|
663
663
|
}
|
664
664
|
|
665
|
+
[Fact]
|
666
|
+
public async Task MultiDependency_SingleFile_UpdateOnePackage_PinAnotherPackage()
|
667
|
+
{
|
668
|
+
await TestAsync(
|
669
|
+
files: [
|
670
|
+
("project.csproj", """
|
671
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
672
|
+
<ItemGroup>
|
673
|
+
<PackageReference Include="Some.Dependency" Version="1.0.0" />
|
674
|
+
</ItemGroup>
|
675
|
+
</Project>
|
676
|
+
""")
|
677
|
+
],
|
678
|
+
initialProjectDependencyStrings: [
|
679
|
+
"Some.Dependency/1.0.0",
|
680
|
+
"Transitive.Dependency/3.0.0"
|
681
|
+
],
|
682
|
+
requiredDependencyStrings: [
|
683
|
+
"Some.Dependency/2.0.0",
|
684
|
+
"Transitive.Dependency/4.0.0",
|
685
|
+
],
|
686
|
+
expectedFiles: [
|
687
|
+
("project.csproj", """
|
688
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
689
|
+
<ItemGroup>
|
690
|
+
<PackageReference Include="Some.Dependency" Version="2.0.0" />
|
691
|
+
<PackageReference Include="Transitive.Dependency" Version="4.0.0" />
|
692
|
+
</ItemGroup>
|
693
|
+
</Project>
|
694
|
+
""")
|
695
|
+
]
|
696
|
+
);
|
697
|
+
}
|
698
|
+
|
665
699
|
[Fact]
|
666
700
|
public async Task MultiDependency_SingleFile_SomeAlreadyUpToDate_FromXml()
|
667
701
|
{
|
@@ -1617,4 +1651,55 @@ public class XmlFileWriterTests : FileWriterTestsBase
|
|
1617
1651
|
requiredDependencyStrings: ["Some.Package/2.0.0"]
|
1618
1652
|
);
|
1619
1653
|
}
|
1654
|
+
|
1655
|
+
[Fact]
|
1656
|
+
public async Task XmlDeclarationIsRetained()
|
1657
|
+
{
|
1658
|
+
await TestAsync(
|
1659
|
+
files: [
|
1660
|
+
("project.csproj", """
|
1661
|
+
<?xml version="1.0" encoding="utf-8"?>
|
1662
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
1663
|
+
<Import Project="versions.props" />
|
1664
|
+
<ItemGroup>
|
1665
|
+
<PackageReference Include="Ignored.Dependency" Version="7.0.0" />
|
1666
|
+
<PackageReference Include="Some.Dependency" Version="$(SomeDependencyVersion)" />
|
1667
|
+
<PackageReference Include="Some.Other.Dependency" Version="8.0.0" />
|
1668
|
+
</ItemGroup>
|
1669
|
+
</Project>
|
1670
|
+
"""),
|
1671
|
+
("versions.props", """
|
1672
|
+
<?xml version="1.0" encoding="utf-8"?>
|
1673
|
+
<Project>
|
1674
|
+
<PropertyGroup>
|
1675
|
+
<SomeDependencyVersion>1.0.0</SomeDependencyVersion>
|
1676
|
+
</PropertyGroup>
|
1677
|
+
</Project>
|
1678
|
+
""")
|
1679
|
+
],
|
1680
|
+
initialProjectDependencyStrings: ["Some.Dependency/1.0.0"],
|
1681
|
+
requiredDependencyStrings: ["Some.Dependency/2.0.0"],
|
1682
|
+
expectedFiles: [
|
1683
|
+
("project.csproj", """
|
1684
|
+
<?xml version="1.0" encoding="utf-8"?>
|
1685
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
1686
|
+
<Import Project="versions.props" />
|
1687
|
+
<ItemGroup>
|
1688
|
+
<PackageReference Include="Ignored.Dependency" Version="7.0.0" />
|
1689
|
+
<PackageReference Include="Some.Dependency" Version="$(SomeDependencyVersion)" />
|
1690
|
+
<PackageReference Include="Some.Other.Dependency" Version="8.0.0" />
|
1691
|
+
</ItemGroup>
|
1692
|
+
</Project>
|
1693
|
+
"""),
|
1694
|
+
("versions.props", """
|
1695
|
+
<?xml version="1.0" encoding="utf-8"?>
|
1696
|
+
<Project>
|
1697
|
+
<PropertyGroup>
|
1698
|
+
<SomeDependencyVersion>2.0.0</SomeDependencyVersion>
|
1699
|
+
</PropertyGroup>
|
1700
|
+
</Project>
|
1701
|
+
""")
|
1702
|
+
]
|
1703
|
+
);
|
1704
|
+
}
|
1620
1705
|
}
|