Skip to content

Commit 86249de

Browse files
authored
fix: update Core public API snapshots for all frameworks (#4957)
* fix: update Core public API snapshots for all frameworks The merged PRs #4929 (hardcoded constants) and #4949 (retry policies) added new public API surface to TUnit.Core but the DotNet8_0, DotNet9_0, and DotNet10_0 verified snapshot files were not updated, causing Core_Library_Has_No_API_Changes test failures in all PR CI pipelines. * fix: update analyzer tests for CancellationToken parameter location PR #4956 changed the CancellationTokenMustBeLastParameter diagnostic to point at the CancellationToken parameter instead of the method name. Update 3 test expectations to match the new diagnostic location.
1 parent c0a521c commit 86249de

4 files changed

Lines changed: 40 additions & 3 deletions

TUnit.Analyzers.Tests/TimeoutCancellationTokenAnalyzerTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public class TestClass
218218
[Test]
219219
[Arguments(1)]
220220
[Timeout(30_000)]
221-
public async Task {|#0:TestMethod|}(CancellationToken cancellationToken, int value)
221+
public async Task TestMethod(CancellationToken {|#0:cancellationToken|}, int value)
222222
{
223223
await Task.Delay(100, cancellationToken);
224224
}
@@ -266,7 +266,7 @@ public class TestClass
266266
[Test]
267267
[Arguments(1, "hello")]
268268
[Timeout(30_000)]
269-
public async Task {|#0:TestMethod|}(CancellationToken cancellationToken, int value, string text)
269+
public async Task TestMethod(CancellationToken {|#0:cancellationToken|}, int value, string text)
270270
{
271271
await Task.Delay(100, cancellationToken);
272272
}
@@ -291,7 +291,7 @@ public class TestClass
291291
[Test]
292292
[Arguments(1, "hello")]
293293
[Timeout(30_000)]
294-
public async Task {|#0:TestMethod|}(int value, CancellationToken cancellationToken, string text)
294+
public async Task TestMethod(int value, CancellationToken {|#0:cancellationToken|}, string text)
295295
{
296296
await Task.Delay(100, cancellationToken);
297297
}

TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet10_0.verified.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,13 @@ namespace
532532
public static readonly .DefaultExecutor Instance;
533533
protected override . ExecuteAsync(<.> action) { }
534534
}
535+
public static class Defaults
536+
{
537+
public static readonly ForcefulExitTimeout;
538+
public static readonly HookTimeout;
539+
public static readonly ProcessExitHookDelay;
540+
public static readonly TestTimeout;
541+
}
535542
public abstract class DependencyInjectionDataSourceAttribute<TScope> : .UntypedDataSourceGeneratorAttribute
536543
{
537544
protected DependencyInjectionDataSourceAttribute() { }
@@ -583,6 +590,7 @@ namespace
583590
public void SetDisplayName(string displayName) { }
584591
public void SetDisplayNameFormatter( formatterType) { }
585592
public void SetPriority(. priority) { }
593+
public void SetRetryBackoff(int backoffMs, double backoffMultiplier) { }
586594
public void SetRetryLimit(int retryLimit) { }
587595
public void SetRetryLimit(int retryCount, <.TestContext, , int, .<bool>> shouldRetry) { }
588596
}
@@ -1179,7 +1187,10 @@ namespace
11791187
public class RetryAttribute : .TUnitAttribute, .IScopedAttribute, ., .
11801188
{
11811189
public RetryAttribute(int times) { }
1190+
public int BackoffMs { get; set; }
1191+
public double BackoffMultiplier { get; set; }
11821192
public int Order { get; }
1193+
public []? RetryOnExceptionTypes { get; set; }
11831194
public ScopeType { get; }
11841195
public int Times { get; }
11851196
public . OnTestDiscovered(.DiscoveredTestContext context) { }
@@ -1454,6 +1465,8 @@ namespace
14541465
public [] MethodGenericArguments { get; set; }
14551466
public required .MethodMetadata MethodMetadata { get; set; }
14561467
public required string MethodName { get; init; }
1468+
public int RetryBackoffMs { get; set; }
1469+
public double RetryBackoffMultiplier { get; set; }
14571470
public int RetryLimit { get; set; }
14581471
public required ReturnType { get; set; }
14591472
public required object?[] TestClassArguments { get; set; }
@@ -2408,6 +2421,8 @@ namespace .Interfaces
24082421
}
24092422
public interface ITestConfiguration
24102423
{
2424+
int RetryBackoffMs { get; }
2425+
double RetryBackoffMultiplier { get; }
24112426
int RetryLimit { get; }
24122427
? Timeout { get; }
24132428
}

TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet8_0.verified.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,13 @@ namespace
532532
public static readonly .DefaultExecutor Instance;
533533
protected override . ExecuteAsync(<.> action) { }
534534
}
535+
public static class Defaults
536+
{
537+
public static readonly ForcefulExitTimeout;
538+
public static readonly HookTimeout;
539+
public static readonly ProcessExitHookDelay;
540+
public static readonly TestTimeout;
541+
}
535542
public abstract class DependencyInjectionDataSourceAttribute<TScope> : .UntypedDataSourceGeneratorAttribute
536543
{
537544
protected DependencyInjectionDataSourceAttribute() { }

TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet9_0.verified.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,13 @@ namespace
532532
public static readonly .DefaultExecutor Instance;
533533
protected override . ExecuteAsync(<.> action) { }
534534
}
535+
public static class Defaults
536+
{
537+
public static readonly ForcefulExitTimeout;
538+
public static readonly HookTimeout;
539+
public static readonly ProcessExitHookDelay;
540+
public static readonly TestTimeout;
541+
}
535542
public abstract class DependencyInjectionDataSourceAttribute<TScope> : .UntypedDataSourceGeneratorAttribute
536543
{
537544
protected DependencyInjectionDataSourceAttribute() { }
@@ -583,6 +590,7 @@ namespace
583590
public void SetDisplayName(string displayName) { }
584591
public void SetDisplayNameFormatter( formatterType) { }
585592
public void SetPriority(. priority) { }
593+
public void SetRetryBackoff(int backoffMs, double backoffMultiplier) { }
586594
public void SetRetryLimit(int retryLimit) { }
587595
public void SetRetryLimit(int retryCount, <.TestContext, , int, .<bool>> shouldRetry) { }
588596
}
@@ -1179,7 +1187,10 @@ namespace
11791187
public class RetryAttribute : .TUnitAttribute, .IScopedAttribute, ., .
11801188
{
11811189
public RetryAttribute(int times) { }
1190+
public int BackoffMs { get; set; }
1191+
public double BackoffMultiplier { get; set; }
11821192
public int Order { get; }
1193+
public []? RetryOnExceptionTypes { get; set; }
11831194
public ScopeType { get; }
11841195
public int Times { get; }
11851196
public . OnTestDiscovered(.DiscoveredTestContext context) { }
@@ -1454,6 +1465,8 @@ namespace
14541465
public [] MethodGenericArguments { get; set; }
14551466
public required .MethodMetadata MethodMetadata { get; set; }
14561467
public required string MethodName { get; init; }
1468+
public int RetryBackoffMs { get; set; }
1469+
public double RetryBackoffMultiplier { get; set; }
14571470
public int RetryLimit { get; set; }
14581471
public required ReturnType { get; set; }
14591472
public required object?[] TestClassArguments { get; set; }
@@ -2408,6 +2421,8 @@ namespace .Interfaces
24082421
}
24092422
public interface ITestConfiguration
24102423
{
2424+
int RetryBackoffMs { get; }
2425+
double RetryBackoffMultiplier { get; }
24112426
int RetryLimit { get; }
24122427
? Timeout { get; }
24132428
}

0 commit comments

Comments
 (0)