Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c758357
[CI Visibility] Bound global coverage memory
tonyredondo Jul 22, 2026
457888e
[CI Visibility] Fix global coverage CI failures
tonyredondo Jul 22, 2026
c5d96b1
[CI Visibility] Seal global coverage during shutdown
tonyredondo Jul 22, 2026
28bb823
[CI Visibility] Simplify global coverage processing
tonyredondo Jul 23, 2026
aecc1c5
[CI Visibility] Simplify coverage metadata validation
tonyredondo Jul 23, 2026
f973b42
[CI Visibility] Simplify global coverage diagnostics
tonyredondo Jul 23, 2026
21e7aa2
[CI Visibility] Harden coverage artifact reconciliation
tonyredondo Jul 23, 2026
35eeea8
[CI Visibility] Strengthen global coverage regression tests
tonyredondo Jul 23, 2026
446b598
[CI Visibility] Harden global coverage lifecycle correctness
tonyredondo Jul 24, 2026
5c9f45e
[CI Visibility] Bound global coverage native memory
tonyredondo Jul 24, 2026
36c3f91
[CI Visibility] Release global coverage buffers per test
tonyredondo Jul 24, 2026
1df0d49
[CI Visibility] Isolate coverage reconciliation by test run
tonyredondo Jul 30, 2026
707c29e
[CI Visibility] Regenerate call target definitions
tonyredondo Jul 30, 2026
fef9de7
[CI Visibility] Run global coverage Windows regression tests
tonyredondo Jul 30, 2026
9645b7c
[CI Visibility] Test global coverage with packaged collector
tonyredondo Jul 30, 2026
cb684fb
[CI Visibility] Fix global coverage Windows smoke tests
tonyredondo Jul 31, 2026
989d5cb
[CI Visibility] Exercise SDK 10 coverage hook in Windows smoke test
tonyredondo Jul 31, 2026
f73fb28
[CI Visibility] Build SDK 10 coverage smoke sample
tonyredondo Jul 31, 2026
1eb89d5
[CI Visibility] Align SDK 10 smoke restore
tonyredondo Jul 31, 2026
d951e39
[CI Visibility] Match rendered coverage diagnostics
tonyredondo Jul 31, 2026
f44a8e0
[CI Visibility] Avoid persistent compiler in coverage smoke test
tonyredondo Jul 31, 2026
41c73e2
[CI Visibility] Simplify global coverage publication
tonyredondo Jul 31, 2026
b7c3bcc
[CI Visibility] Make coverage publication atomic
tonyredondo Jul 31, 2026
dd2523a
[CI Visibility] Report global coverage publication failures
tonyredondo Jul 31, 2026
7f25e16
[CI Visibility] Use run-scoped coverage fixture
tonyredondo Jul 31, 2026
620fd7f
[CI Visibility] Safely release coverage buffers
tonyredondo Aug 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .azure-pipelines/ultimate-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,16 @@ stages:
parameters:
framework: $(framework)
includeMultiVersions: false
# The global coverage regression tests exercise two Coverlet versions. Keep the
# Windows download surgical instead of pulling every multi-version sample.
- template: steps/download-artifact.yml
parameters:
artifact: samples-multi-version-net8.0
path: $(outputDir)/publish
patterns: |
Samples.NUnitGlobalCoverageMemory/release_net8.0_3.2.0/**
Samples.NUnitGlobalCoverageMemory/release_net8.0_6.0.0/**
condition: and(succeeded(), eq(variables['framework'], 'net8.0'), ne(variables['area'], 'ASM'))

# Cosmos is _way_ to flaky at the moment. Try enabling again at a later time
# - powershell: |
Expand Down
7 changes: 7 additions & 0 deletions Datadog.Trace.Samples.g.sln
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.XUnitTests", "trace
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.NUnitTests", "tracer\test\test-applications\integrations\Samples.NUnitTests\Samples.NUnitTests.csproj", "{BC998ACD-353B-4A56-8A56-DF6200E141B6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.NUnitGlobalCoverageMemory", "tracer\test\test-applications\integrations\Samples.NUnitGlobalCoverageMemory\Samples.NUnitGlobalCoverageMemory.csproj", "{EC40C8E7-DC12-4645-8481-E1536726403C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.MSTestTests", "tracer\test\test-applications\integrations\Samples.MSTestTests\Samples.MSTestTests.csproj", "{8EAABFB9-8A47-4B11-AD7F-AC8B373CDE49}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Msmq", "tracer\test\test-applications\integrations\Samples.Msmq\Samples.Msmq.csproj", "{662B587F-97B5-4CEF-ABF9-6C76A6DBD29E}"
Expand Down Expand Up @@ -657,6 +659,10 @@ Global
{BC998ACD-353B-4A56-8A56-DF6200E141B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC998ACD-353B-4A56-8A56-DF6200E141B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC998ACD-353B-4A56-8A56-DF6200E141B6}.Release|Any CPU.Build.0 = Release|Any CPU
{EC40C8E7-DC12-4645-8481-E1536726403C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC40C8E7-DC12-4645-8481-E1536726403C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC40C8E7-DC12-4645-8481-E1536726403C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC40C8E7-DC12-4645-8481-E1536726403C}.Release|Any CPU.Build.0 = Release|Any CPU
{8EAABFB9-8A47-4B11-AD7F-AC8B373CDE49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8EAABFB9-8A47-4B11-AD7F-AC8B373CDE49}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8EAABFB9-8A47-4B11-AD7F-AC8B373CDE49}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -1174,6 +1180,7 @@ Global
{3538EF5E-377E-430A-AFB8-F2DB5FAEDE95} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{4AD438D9-D4E3-4EB5-8851-89DB4D1CFB9C} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{BC998ACD-353B-4A56-8A56-DF6200E141B6} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{EC40C8E7-DC12-4645-8481-E1536726403C} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{8EAABFB9-8A47-4B11-AD7F-AC8B373CDE49} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{662B587F-97B5-4CEF-ABF9-6C76A6DBD29E} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{94B50277-FB50-4B42-BA79-770ADB24CB80} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
Expand Down
7 changes: 7 additions & 0 deletions Datadog.Trace.sln
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.XUnitTests", "trace
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.NUnitTests", "tracer\test\test-applications\integrations\Samples.NUnitTests\Samples.NUnitTests.csproj", "{BC998ACD-353B-4A56-8A56-DF6200E141B6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.NUnitGlobalCoverageMemory", "tracer\test\test-applications\integrations\Samples.NUnitGlobalCoverageMemory\Samples.NUnitGlobalCoverageMemory.csproj", "{EC40C8E7-DC12-4645-8481-E1536726403C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.MSTestTests", "tracer\test\test-applications\integrations\Samples.MSTestTests\Samples.MSTestTests.csproj", "{8EAABFB9-8A47-4B11-AD7F-AC8B373CDE49}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Msmq", "tracer\test\test-applications\integrations\Samples.Msmq\Samples.Msmq.csproj", "{662B587F-97B5-4CEF-ABF9-6C76A6DBD29E}"
Expand Down Expand Up @@ -945,6 +947,10 @@ Global
{BC998ACD-353B-4A56-8A56-DF6200E141B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC998ACD-353B-4A56-8A56-DF6200E141B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC998ACD-353B-4A56-8A56-DF6200E141B6}.Release|Any CPU.Build.0 = Release|Any CPU
{EC40C8E7-DC12-4645-8481-E1536726403C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC40C8E7-DC12-4645-8481-E1536726403C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC40C8E7-DC12-4645-8481-E1536726403C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC40C8E7-DC12-4645-8481-E1536726403C}.Release|Any CPU.Build.0 = Release|Any CPU
{8EAABFB9-8A47-4B11-AD7F-AC8B373CDE49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8EAABFB9-8A47-4B11-AD7F-AC8B373CDE49}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8EAABFB9-8A47-4B11-AD7F-AC8B373CDE49}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -1667,6 +1673,7 @@ Global
{3538EF5E-377E-430A-AFB8-F2DB5FAEDE95} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{4AD438D9-D4E3-4EB5-8851-89DB4D1CFB9C} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{BC998ACD-353B-4A56-8A56-DF6200E141B6} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{EC40C8E7-DC12-4645-8481-E1536726403C} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{8EAABFB9-8A47-4B11-AD7F-AC8B373CDE49} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{662B587F-97B5-4CEF-ABF9-6C76A6DBD29E} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{94B50277-FB50-4B42-BA79-770ADB24CB80} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
Expand Down
18 changes: 18 additions & 0 deletions tracer/build/PackageVersionsGeneratorDefinitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,24 @@
}
]
},
{
"IntegrationName": "NUnitGlobalCoverageMemoryCoverlet",
"SampleProjectName": "Samples.NUnitGlobalCoverageMemory",
"NugetPackageSearchName": "coverlet.collector",
"MinVersion": "3.2.0",
"MaxVersionExclusive": "6.0.1",
"SpecificVersions": [
"3.2.0",
"6.0.0"
],
"VersionConditions": [
{
"IncludeOnlyTargetFrameworks": [
"net8.0"
]
}
]
},
{
"IntegrationName": "NUnitRetries",
"SampleProjectName": "Samples.NUnitTestsRetries",
Expand Down
12 changes: 12 additions & 0 deletions tracer/build/PackageVersionsLatestMajors.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -4602,6 +4602,18 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely
<RequiresDockerDependency>None</RequiresDockerDependency>
<SampleName>Samples.NUnitTests</SampleName>
</PackageVersionSample>
<PackageVersionSample Include="test\test-applications\integrations\Samples.NUnitGlobalCoverageMemory\Samples.NUnitGlobalCoverageMemory.csproj">
<Properties>ApiVersion=3.2.0;RestoreRecursive=false;BuildProjectReferences=false</Properties>
<TargetFramework>net8.0</TargetFramework>
<RequiresDockerDependency>None</RequiresDockerDependency>
<SampleName>Samples.NUnitGlobalCoverageMemory</SampleName>
</PackageVersionSample>
<PackageVersionSample Include="test\test-applications\integrations\Samples.NUnitGlobalCoverageMemory\Samples.NUnitGlobalCoverageMemory.csproj">
<Properties>ApiVersion=6.0.0;RestoreRecursive=false;BuildProjectReferences=false</Properties>
<TargetFramework>net8.0</TargetFramework>
<RequiresDockerDependency>None</RequiresDockerDependency>
<SampleName>Samples.NUnitGlobalCoverageMemory</SampleName>
</PackageVersionSample>
<PackageVersionSample Include="test\test-applications\integrations\Samples.NUnitTestsRetries\Samples.NUnitTestsRetries.csproj">
<Properties>ApiVersion=3.14.0;RestoreRecursive=false;BuildProjectReferences=false</Properties>
<TargetFramework>net48</TargetFramework>
Expand Down
12 changes: 12 additions & 0 deletions tracer/build/PackageVersionsLatestMinors.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -23382,6 +23382,18 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely
<RequiresDockerDependency>None</RequiresDockerDependency>
<SampleName>Samples.NUnitTests</SampleName>
</PackageVersionSample>
<PackageVersionSample Include="test\test-applications\integrations\Samples.NUnitGlobalCoverageMemory\Samples.NUnitGlobalCoverageMemory.csproj">
<Properties>ApiVersion=3.2.0;RestoreRecursive=false;BuildProjectReferences=false</Properties>
<TargetFramework>net8.0</TargetFramework>
<RequiresDockerDependency>None</RequiresDockerDependency>
<SampleName>Samples.NUnitGlobalCoverageMemory</SampleName>
</PackageVersionSample>
<PackageVersionSample Include="test\test-applications\integrations\Samples.NUnitGlobalCoverageMemory\Samples.NUnitGlobalCoverageMemory.csproj">
<Properties>ApiVersion=6.0.0;RestoreRecursive=false;BuildProjectReferences=false</Properties>
<TargetFramework>net8.0</TargetFramework>
<RequiresDockerDependency>None</RequiresDockerDependency>
<SampleName>Samples.NUnitGlobalCoverageMemory</SampleName>
</PackageVersionSample>
<PackageVersionSample Include="test\test-applications\integrations\Samples.NUnitTestsRetries\Samples.NUnitTestsRetries.csproj">
<Properties>ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false</Properties>
<TargetFramework>net48</TargetFramework>
Expand Down
12 changes: 12 additions & 0 deletions tracer/build/PackageVersionsLatestSpecific.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -5844,6 +5844,18 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely
<RequiresDockerDependency>None</RequiresDockerDependency>
<SampleName>Samples.NUnitTests</SampleName>
</PackageVersionSample>
<PackageVersionSample Include="test\test-applications\integrations\Samples.NUnitGlobalCoverageMemory\Samples.NUnitGlobalCoverageMemory.csproj">
<Properties>ApiVersion=3.2.0;RestoreRecursive=false;BuildProjectReferences=false</Properties>
<TargetFramework>net8.0</TargetFramework>
<RequiresDockerDependency>None</RequiresDockerDependency>
<SampleName>Samples.NUnitGlobalCoverageMemory</SampleName>
</PackageVersionSample>
<PackageVersionSample Include="test\test-applications\integrations\Samples.NUnitGlobalCoverageMemory\Samples.NUnitGlobalCoverageMemory.csproj">
<Properties>ApiVersion=6.0.0;RestoreRecursive=false;BuildProjectReferences=false</Properties>
<TargetFramework>net8.0</TargetFramework>
<RequiresDockerDependency>None</RequiresDockerDependency>
<SampleName>Samples.NUnitGlobalCoverageMemory</SampleName>
</PackageVersionSample>
<PackageVersionSample Include="test\test-applications\integrations\Samples.NUnitTestsRetries\Samples.NUnitTestsRetries.csproj">
<Properties>ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false</Properties>
<TargetFramework>net48</TargetFramework>
Expand Down
2 changes: 1 addition & 1 deletion tracer/build/_build/Honeypot/IntegrationGroups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static IntegrationMap()
NugetPackages.Add("vstest.console.arm64", Array.Empty<string>());
NugetPackages.Add("WebDriver", new[] { "Selenium.WebDriver" });
NugetPackages.Add("Microsoft.AspNetCore.StaticFiles", new [] { "Microsoft.AspNetCore.StaticFiles" });
NugetPackages.Add("coverlet.core", Array.Empty<string>());
NugetPackages.Add("coverlet.core", new[] { "coverlet.collector" });
NugetPackages.Add("Microsoft.AspNetCore.Session", new [] { "Microsoft.AspNetCore.Session" });
NugetPackages.Add("Microsoft.TestPlatform.PlatformAbstractions", Array.Empty<string>());
NugetPackages.Add("Microsoft.VisualStudio.TraceDataCollector", Array.Empty<string>());
Expand Down
12 changes: 11 additions & 1 deletion tracer/build/supported_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,17 @@
"assemblyName": "coverlet.core",
"minAssemblyVersionInclusive": "3.0.0",
"maxAssemblyVersionInclusive": "6.65535.65535",
"packages": []
"packages": [
{
"name": "coverlet.collector",
"minVersionAvailableInclusive": "1.0.0",
"minVersionSupportedInclusive": "3.0.0",
"minVersionTestedInclusive": "3.2.0",
"maxVersionSupportedInclusive": "6.0.4",
"maxVersionAvailableInclusive": "10.0.1",
"maxVersionTestedInclusive": "6.0.0"
}
]
},
{
"integrationName": "DotnetTest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

using System;
using System.IO;
using Datadog.Trace.Ci;
using Datadog.Trace.Ci.Coverage;
using Datadog.Trace.Vendors.Newtonsoft.Json;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollector.InProcDataCollector;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.InProcDataCollector;
Expand Down Expand Up @@ -58,6 +58,12 @@ public void TestSessionStart(TestSessionStartArgs testSessionStartArgs)
{
_outputPathValue = outputPath;
}

if (CoverageReporter.Handler is DefaultWithGlobalCoverageEventHandler coverageHandler)
{
var outputDirectory = _outputPathValue ?? Environment.CurrentDirectory;
coverageHandler.RegisterCollectorOutputDirectory(outputDirectory);
}
}

/// <summary>
Expand All @@ -82,20 +88,6 @@ public void TestCaseEnd(TestCaseEndArgs testCaseEndArgs)
/// <param name="testSessionEndArgs">Test session end arguments</param>
public void TestSessionEnd(TestSessionEndArgs testSessionEndArgs)
{
if (CoverageReporter.Handler is DefaultWithGlobalCoverageEventHandler coverageHandler)
{
var globalCoverage = coverageHandler.GetCodeCoveragePercentage();
var outputPath = $"coverage-{DateTime.Now:yyyy-MM-dd_HH_mm_ss}-{Guid.NewGuid():n}.json";
if (!string.IsNullOrEmpty(_outputPathValue))
{
outputPath = Path.Combine(_outputPathValue, outputPath);
}

using var fileStream = File.OpenWrite(outputPath);
using var streamWriter = new StreamWriter(fileStream);
using var jsonWriter = new JsonTextWriter(streamWriter) { CloseOutput = true };
var jsonSerializer = new JsonSerializer();
jsonSerializer.Serialize(jsonWriter, globalCoverage);
}
CoverageReporter.FinalizeGlobalCoverage();
}
}
59 changes: 27 additions & 32 deletions tracer/src/Datadog.Trace.Tools.Runner/CoverageUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
// </copyright>

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Datadog.Trace.Ci.Coverage;
using Datadog.Trace.Ci.Coverage.Models.Global;
using Datadog.Trace.Vendors.Newtonsoft.Json;
using Spectre.Console;

namespace Datadog.Trace.Tools.Runner;
Expand All @@ -33,23 +31,27 @@ public static bool TryCombineAndGetTotalCoverage(string inputFolder, string outp
return false;
}

if (!TryCombineAndGetTotalCoverage(inputFolder, out globalCoverageInfo, useStdOut))
if (!TryLoadAndCombine(inputFolder, outputFile, out globalCoverageInfo, useStdOut))
{
return false;
}

using var fStream = File.OpenWrite(outputFile);
using var sWriter = new StreamWriter(fStream, Encoding.UTF8, 4096, false);
if (useStdOut)
{
Utils.WriteSuccess($"Writing {outputFile}");
}

new JsonSerializer().Serialize(sWriter, globalCoverageInfo);
var writer = new GlobalCoverageArtifactWriter();
using var stagedOutput = writer.StageReplace(outputFile, globalCoverageInfo);
stagedOutput.Commit();
return true;
}

private static bool TryCombineAndGetTotalCoverage(string inputFolder, out GlobalCoverageInfo globalCoverageInfo, bool useStdOut = true)
private static bool TryLoadAndCombine(
string inputFolder,
string outputFile,
out GlobalCoverageInfo globalCoverageInfo,
bool useStdOut)
{
globalCoverageInfo = default;

Expand All @@ -76,7 +78,11 @@ private static bool TryCombineAndGetTotalCoverage(string inputFolder, out Global
var jsonFiles = Array.Empty<string>();
try
{
jsonFiles = Directory.GetFiles(inputFolder, "*.json", SearchOption.TopDirectoryOnly);
if (!GlobalCoverageFileCombiner.TryAcquireInputFiles(inputFolder, expectedRunToken: null, out jsonFiles))
{
return false;
}

if (jsonFiles.Length == 0)
{
if (useStdOut)
Expand All @@ -93,34 +99,23 @@ private static bool TryCombineAndGetTotalCoverage(string inputFolder, out Global
AnsiConsole.WriteException(ex);
}

List<GlobalCoverageInfo> globalCoverages = new();
foreach (var file in jsonFiles)
Action<string> onFileProcessed = useStdOut ? file => Utils.WriteSuccess($"Processing: {file}") : null;
if (!GlobalCoverageFileCombiner.TryCombine(
jsonFiles,
outputFile,
requireAllInputs: false,
onFileProcessed: onFileProcessed,
out globalCoverageInfo,
out var rejectedInput))
{
var fileContent = File.ReadAllText(file);
try
if (useStdOut && rejectedInput is not null)
{
if (JsonConvert.DeserializeObject<GlobalCoverageInfo>(fileContent) is { } gCoverageInfo)
{
if (useStdOut)
{
Utils.WriteSuccess($"Processing: {file}");
}

globalCoverages.Add(gCoverageInfo);
}
else if (useStdOut)
{
Utils.WriteSuccess($"Ignored: {file}");
}
}
catch (Exception ex)
{
Utils.WriteError($"Error processing {file}");
AnsiConsole.WriteException(ex);
Utils.WriteError($"Error processing {rejectedInput}");
}

return false;
}

globalCoverageInfo = GlobalCoverageInfo.Combine(globalCoverages.ToArray());
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@
<type fullname="System.IO.FileInfo" />
<type fullname="System.IO.FileMode" />
<type fullname="System.IO.FileNotFoundException" />
<type fullname="System.IO.FileOptions" />
<type fullname="System.IO.FileShare" />
<type fullname="System.IO.FileStream" />
<type fullname="System.IO.FileSystemInfo" />
Expand Down Expand Up @@ -945,6 +946,7 @@
<type fullname="System.RuntimeMethodHandle" />
<type fullname="System.RuntimeTypeHandle" />
<type fullname="System.SByte" />
<type fullname="System.Security.Cryptography.CryptographicException" />
<type fullname="System.Security.Principal.TokenImpersonationLevel" />
<type fullname="System.Security.SecurityCriticalAttribute" />
<type fullname="System.Security.SecurityException" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// <copyright file="CoverageContextAdmission.cs" company="Datadog">
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

#nullable enable

namespace Datadog.Trace.Ci.Coverage;

internal abstract class CoverageContextAdmission
{
public static readonly CoverageContextAdmission Noop = new NoopCoverageContextAdmission();

public abstract void CommitInstalled();

public abstract void FailStart(GlobalCoverageFailureReason reason);

public abstract void Release();

private sealed class NoopCoverageContextAdmission : CoverageContextAdmission
{
public override void CommitInstalled()
{
}

public override void FailStart(GlobalCoverageFailureReason reason)
{
}

public override void Release()
{
}
}
}
Loading
Loading