Skip to content

Commit 4a2d101

Browse files
committed
Coverage tweaks, fix Sonar error
1 parent 81c48e4 commit 4a2d101

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Common/src/Common/ConfigurationSchemaAttributes.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
// Steeltoe: This file was copied from the .NET Aspire Configuration Schema generator
77
// at https://github.com/dotnet/aspire/tree/cb7cc4d78f8dd2b4df1053a229493cdbf88f50df/src/Tools/ConfigurationSchemaGenerator.
88

9+
using System.Diagnostics.CodeAnalysis;
10+
911
namespace Aspire;
1012

1113
/// <summary>
1214
/// Attribute used to automatically generate a JSON schema for a component's configuration.
1315
/// </summary>
1416
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
17+
[ExcludeFromCodeCoverage(Justification = "Used while compiling Steeltoe, does not ship with Steeltoe.")]
1518
internal sealed class ConfigurationSchemaAttribute : Attribute
1619
{
1720
public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null)

src/Management/src/Endpoint/Actuators/ThreadDump/EventPipeThreadDumper.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ public async Task<IList<ThreadInfo>> DumpThreadsAsync(CancellationToken cancella
7777
}
7878
finally
7979
{
80+
#pragma warning disable S1215 // "GC.Collect" should not be called
8081
long totalMemory = GC.GetTotalMemory(true);
82+
#pragma warning restore S1215 // "GC.Collect" should not be called
8183
_logger.LogDebug("Total memory: {Memory}.", totalMemory);
8284
}
8385
}, cancellationToken);

0 commit comments

Comments
 (0)