Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions .azure-pipelines/ultimate-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3472,8 +3472,9 @@ stages:
-e IncludeTestsRequiringDocker=false \
-e Filter=$(IntegrationTestFilter) \
-e SampleName=$(IntegrationTestSampleName) \
-e Area=$(area) \
IntegrationTests.ARM64
displayName: docker-compose run --no-deps IntegrationTests
displayName: docker-compose run --no-deps IntegrationTests ($(area))
env:
DD_LOGGER_DD_API_KEY: $(ddApiKey)
baseImage: $(baseImage) # for interpolation in the docker-compose file
Expand Down Expand Up @@ -3555,8 +3556,9 @@ stages:
-e IncludeTestsRequiringDocker=true \
-e Filter=$(IntegrationTestFilter) \
-e SampleName=$(IntegrationTestSampleName) \
-e Area=$(area) \
IntegrationTests.ARM64 \
displayName: docker-compose run IntegrationTests
displayName: docker-compose run IntegrationTests ($(area))
env:
DD_LOGGER_DD_API_KEY: $(ddApiKey)
baseImage: $(baseImage) # for interpolation in the docker-compose file
Expand Down
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,26 @@ Datadog.Trace.Debugger.slnf @DataDog/debugger-dotnet
/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/CI/ @DataDog/ci-app-libraries-dotnet @DataDog/apm-dotnet
/tracer/src/Datadog.Trace/PDBs/MethodSymbolResolver.cs @DataDog/ci-app-libraries-dotnet
/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Testing/ @DataDog/ci-app-libraries-dotnet
/tracer/src/Datadog.Trace.BenchmarkDotNet/ @DataDog/ci-app-libraries-dotnet @DataDog/apm-dotnet
/tracer/src/Datadog.Trace.Coverage.collector/ @DataDog/ci-app-libraries-dotnet @DataDog/apm-dotnet
/tracer/src/Datadog.Trace.MSBuild/ @DataDog/ci-app-libraries-dotnet @DataDog/apm-dotnet
/tracer/test/test-applications/integrations/Samples.XUnit*/ @DataDog/ci-app-libraries-dotnet
/tracer/test/test-applications/integrations/Samples.NUnit*/ @DataDog/ci-app-libraries-dotnet
/tracer/test/test-applications/integrations/Samples.MSTest*/ @DataDog/ci-app-libraries-dotnet
/tracer/test/test-applications/integrations/Samples.Selenium/ @DataDog/ci-app-libraries-dotnet
/tracer/test/test-applications/integrations/Samples.CIVisibilityIpc/ @DataDog/ci-app-libraries-dotnet
/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/SourceCodeIntegrationGitMetadataTests.cs @DataDog/ci-app-libraries-dotnet
/tracer/test/snapshots/MsTestV2* @DataDog/ci-app-libraries-dotnet
/tracer/test/snapshots/NUnit* @DataDog/ci-app-libraries-dotnet
/tracer/test/snapshots/XUnit* @DataDog/ci-app-libraries-dotnet
/tracer/test/snapshots/Selenium* @DataDog/ci-app-libraries-dotnet
/tracer/src/Datadog.Trace.Tools.Runner/Ci* @DataDog/ci-app-libraries-dotnet @DataDog/apm-dotnet
/tracer/src/Datadog.Trace.Tools.Runner/CI* @DataDog/ci-app-libraries-dotnet @DataDog/apm-dotnet
/tracer/src/Datadog.Trace.Tools.Runner/ConfigureCiCommand.cs @DataDog/ci-app-libraries-dotnet @DataDog/apm-dotnet
/tracer/src/Datadog.Trace.Tools.Runner/Coverage* @DataDog/ci-app-libraries-dotnet @DataDog/apm-dotnet
/tracer/src/Datadog.Trace.Tools.Runner/RunCiCommand.cs @DataDog/ci-app-libraries-dotnet @DataDog/apm-dotnet
/tracer/test/Datadog.Trace.Tools.Runner.IntegrationTests/CiRunCommandTests.cs @DataDog/ci-app-libraries-dotnet @DataDog/apm-dotnet
/tracer/test/Datadog.Trace.Tools.Runner.IntegrationTests/ConfigureCiCommandTests.cs @DataDog/ci-app-libraries-dotnet @DataDog/apm-dotnet

# Common Files
Datadog.Trace.Trimming.xml @DataDog/apm-dotnet
Expand Down
12 changes: 10 additions & 2 deletions tracer/build/_build/Build.Steps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1950,12 +1950,20 @@ private string AddAreaFilter(string filter)
return filter;
}

// CI Visibility tests live in the same test assemblies as the Tracer area (so they carry
// both Area=Tracer at the assembly level and Area=CIVisibility at the class level), but
// they run in their own job. Exclude them explicitly from the Tracer area to avoid running
// them twice.
var areaFilter = Area == TracerArea
? $"(Area={Area})&(Area!={CiVisibilityArea})"
: $"(Area={Area})";

if (string.IsNullOrWhiteSpace(filter))
{
return $"(Area={Area})";
return areaFilter;
}

return filter + $"&(Area={Area})";
return filter + $"&{areaFilter}";
}

Target CompileAzureFunctionsSamplesWindows => _ => _
Expand Down
31 changes: 20 additions & 11 deletions tracer/build/_build/Build.VariableGenerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ partial class Build : NukeBuild
{
private const string TracerArea = "Tracer";
private const string AsmArea = "ASM";
private const string CiVisibilityArea = "CIVisibility";
private const string TracingDotnet = "@DataDog/tracing-dotnet";
private const string ASMDotnet = "@DataDog/asm-dotnet";
private const string DebuggerDotnet = "@DataDog/debugger-dotnet";
private const string ProfilerDotnet = "@DataDog/profiling-dotnet";
private const string CiAppLibrariesDotnet = "@DataDog/ci-app-libraries-dotnet";

class ChangedTeamValue
{
Expand All @@ -36,6 +38,7 @@ class ChangedTeamValue
new ChangedTeamValue { VariableName = "isTracerChanged", TeamName = TracingDotnet},
new ChangedTeamValue { VariableName = "isDebuggerChanged", TeamName = DebuggerDotnet},
new ChangedTeamValue { VariableName = "isProfilerChanged", TeamName = ProfilerDotnet},
new ChangedTeamValue { VariableName = "isCiVisibilityChanged", TeamName = CiAppLibrariesDotnet},
};

Target GenerateVariables
Expand Down Expand Up @@ -131,10 +134,11 @@ void GenerateConditionVariableBasedOnGitChange(ChangedTeamValue changedTeamValue
var changedFiles = GetGitChangedFiles(baseBranch);
// Choose changedFiles that meet any of the filters => Choose changedFiles that DON'T meet any of the exclusion filters

if (changedTeamValue.TeamName == ASMDotnet && CommonTracerChanges(changedFiles, codeOwners))
if ((changedTeamValue.TeamName == ASMDotnet || changedTeamValue.TeamName == CiAppLibrariesDotnet)
&& CommonTracerChanges(changedFiles, codeOwners))
{
isChanged = true;
Logger.Information($"ASM tests will be launched based on common changes.");
Logger.Information($"{changedTeamValue.VariableName} tests will be launched based on common changes.");
}
else
{
Expand Down Expand Up @@ -189,14 +193,19 @@ void GenerateLinuxMatrix(string platform, IEnumerable<TargetFramework> framework
}
}

// We only call this method for the tracer and ASM areas
// We only call this method for the tracer, ASM, and CI Visibility areas
bool ShouldBeIncluded(string area)
{
if (area == AsmArea)
{
return _changedTeamValue.First(x => x.TeamName == ASMDotnet).IsChanged;
}

if (area == CiVisibilityArea)
{
return _changedTeamValue.First(x => x.TeamName == CiAppLibrariesDotnet).IsChanged;
}

return true;
}

Expand All @@ -213,7 +222,7 @@ void GenerateIntegrationTestsWindowsMatrix()
{
var targetFrameworks = GetTestingFrameworks(PlatformFamily.Windows);
var targetPlatforms = new[] { "x86", "x64" };
var areas = new[] { TracerArea, AsmArea };
var areas = new[] { TracerArea, AsmArea, CiVisibilityArea };
var matrix = new Dictionary<string, object>();

foreach (var framework in targetFrameworks)
Expand Down Expand Up @@ -374,7 +383,7 @@ void GenerateIntegrationTestsLinuxMatrix(bool dockerTest)
}
else
{
var areas = new[] { TracerArea, AsmArea };
var areas = new[] { TracerArea, AsmArea, CiVisibilityArea };
foreach (var area in areas)
{
if (ShouldBeIncluded(area))
Expand Down Expand Up @@ -407,13 +416,13 @@ void GenerateIntegrationTestsLinuxArm64Matrix()
{
foreach (var (baseImage, artifactSuffix) in baseImages)
{
if (ShouldBeIncluded(AsmArea))
{
matrix.Add($"{baseImage}_{framework}", new { publishTargetFramework = framework, baseImage = baseImage, artifactSuffix = artifactSuffix });
}
else
var areas = new[] { TracerArea, AsmArea, CiVisibilityArea };
foreach (var area in areas)
{
matrix.Add($"{baseImage}_{framework}", new { publishTargetFramework = framework, baseImage = baseImage, artifactSuffix = artifactSuffix, area = TracerArea });
if (ShouldBeIncluded(area))
{
matrix.Add($"{baseImage}_{framework}_{area}", new { publishTargetFramework = framework, baseImage = baseImage, artifactSuffix = artifactSuffix, area = area });
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI.Agent
{
[Trait("Area", "CIVisibility")]
public class ApmAgentWriterTests : IAsyncLifetime
{
private readonly ApmAgentWriter _ciAgentWriter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI.Agent
{
[Trait("Area", "CIVisibility")]
public class CIAgentlessEventBufferTests
{
[Theory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI.Agent
{
[Trait("Area", "CIVisibility")]
public class CiVisibilityProtocolWriterTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI
{
[CollectionDefinition(nameof(CIEnvironmentVariableTests), DisableParallelization = true)]
[Collection(nameof(CIEnvironmentVariableTests))]
[Trait("Area", "CIVisibility")]
public class CIEnvironmentVariableTests
{
private IDictionary _originalEnvVars;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI
{
[Trait("Area", "CIVisibility")]
public class CIVisibilityTests
{
private static readonly ITestOptimizationTracerManagement TracerManagement = new TestOptimizationTracerManagement(TestOptimizationSettings.FromDefaultSources());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI.Coverage;

[Trait("Area", "CIVisibility")]
public class FileBitmapTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI
{
[Trait("Area", "CIVisibility")]
public class GitParserTests
{
public static IEnumerable<object[]> GetData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
public sealed class GlobalCoverageMemoryTests : TestingFrameworkEvpTest
{
private const long MaximumProcessMemoryGrowth = 512L * 1024 * 1024;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI.Ipc;

[Trait("Area", "CIVisibility")]
public class IpcTests : TestingFrameworkEvpTest
{
public IpcTests(ITestOutputHelper output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI
{
[Trait("Area", "CIVisibility")]
[UsesVerify]
public class MsTestV2EvpTests : TestingFrameworkEvpTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[Collection(nameof(TransportTestsCollection))]
public class MsTestV2RetriesTests : TestingFrameworkRetriesTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class MsTestV2Tests(ITestOutputHelper output) : MsTestV2TestsBase("MSTest

public class MsTestV2Tests2(ITestOutputHelper output) : MsTestV2TestsBase("MSTestTests2", output, pre224TestCount: 19, post224TestCount: 21);

[Trait("Area", "CIVisibility")]
[Collection("MsTestV2Tests")]
[UsesVerify]
public abstract class MsTestV2TestsBase : TestingFrameworkTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI
{
[Trait("Area", "CIVisibility")]
[UsesVerify]
public class NUnitEvpTests : TestingFrameworkEvpTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[Collection(nameof(TransportTestsCollection))]
public class NUnitRetriesTests : TestingFrameworkRetriesTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI
{
[Trait("Area", "CIVisibility")]
[UsesVerify]
public class NUnitTests : TestingFrameworkTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[Collection(nameof(TransportTestsCollection))]
public class PipesXUnitEvpTests(ITestOutputHelper output) : XUnitEvpTests(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[Collection(nameof(TransportTestsCollection))]
public class PipesXUnitTests(ITestOutputHelper output) : XUnitTests(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[UsesVerify]
public class SeleniumTests : TestingFrameworkEvpTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[Collection(nameof(TransportTestsCollection))]
public class TcpXUnitEvpTests(ITestOutputHelper output) : XUnitEvpTests(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[Collection(nameof(TransportTestsCollection))]
public class TcpXUnitTests(ITestOutputHelper output) : XUnitTests(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
public abstract class TestingFrameworkEvpTest : TestHelper
{
private readonly GacFixture _gacFixture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[UsesVerify]
public abstract class TestingFrameworkImpactedTests : TestingFrameworkTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
public abstract class TestingFrameworkRetriesTests : TestingFrameworkEvpTest
{
public TestingFrameworkRetriesTests(string sampleAppName, ITestOutputHelper output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
public abstract class TestingFrameworkTest : TestHelper
{
private readonly GacFixture _gacFixture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[CollectionDefinition(nameof(TransportTestsCollection), DisableParallelization = true)]
public class TransportTestsCollection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[Collection(nameof(TransportTestsCollection))]
public class UdsXUnitEvpTests(ITestOutputHelper output) : XUnitEvpTests(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[Collection(nameof(TransportTestsCollection))]
public class UdsXUnitTests(ITestOutputHelper output) : XUnitTests(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

[Trait("Area", "CIVisibility")]
[UsesVerify]
public abstract class XUnitEvpTests : TestingFrameworkEvpTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

#if NET8_0_OR_GREATER
[Trait("Area", "CIVisibility")]
[UsesVerify]
public class XUnitEvpTestsV3 : TestingFrameworkEvpTest
{
Expand Down
Loading
Loading