Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e6f863b
Dispose Testcontainers and update to V4
bouwkast Mar 20, 2026
36b956d
Remove DockerTestFramework container pre-warming
bouwkast Apr 23, 2026
b7e0741
Migrate ServiceStack.Redis to Testcontainers
bouwkast Jul 29, 2026
9064500
Migrate StackExchange.Redis to Testcontainers
bouwkast Jul 29, 2026
dbaa181
Migrate SQL Server to Testcontainers
bouwkast Jul 29, 2026
7bbeeae
Migrate PostgreSQL to Testcontainers
bouwkast Jul 29, 2026
3a983f6
Migrate MySQL 8 to Testcontainers
bouwkast Jul 29, 2026
9caacdb
Migrate MySQL 5.7 to Testcontainers
bouwkast Jul 29, 2026
f2d1d39
Migrate RabbitMQ to Testcontainers
bouwkast Jul 29, 2026
18c1342
Migrate Kafka to Testcontainers
bouwkast Jul 29, 2026
df95097
Migrate Couchbase to Testcontainers
bouwkast Jul 29, 2026
78e434c
Remove obsolete Group 1 Compose endpoints
bouwkast Jul 29, 2026
dc1c003
Avoid Redis Testcontainers on Windows
bouwkast Jul 30, 2026
8c92584
Avoid RabbitMQ readiness cookie race
bouwkast Jul 30, 2026
caef5b0
Support net48 in Couchbase fixture
bouwkast Jul 30, 2026
8634923
Preserve Windows integration test endpoints
bouwkast Jul 30, 2026
eefed40
Fix container fixture startup in Docker CI
bouwkast Jul 30, 2026
43bbce1
Fix Couchbase and SQL Server test containers
bouwkast Jul 30, 2026
faf36c5
Migrate IAST database tests to Testcontainers
bouwkast Jul 30, 2026
4927bde
Pin Redis Testcontainer images
bouwkast Jul 30, 2026
26bb32d
Support SQL Server readiness on ARM64
bouwkast Jul 30, 2026
82024bf
Harden migrated Testcontainers fixtures
bouwkast Jul 30, 2026
39295d4
Split Couchbase snapshots for SDK 3.8
bouwkast Jul 31, 2026
6928403
Remove trailing newlines
bouwkast Jul 31, 2026
318c11a
Fix ARM64 SQL Server readiness wait
bouwkast Jul 31, 2026
b012a71
Wait for RabbitMQ mapped port readiness
bouwkast Jul 31, 2026
6e8c464
Use RabbitMQ Testcontainers readiness
bouwkast Jul 31, 2026
4acaa81
Retry transient Testcontainers cgroup failures
bouwkast Jul 31, 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
270 changes: 33 additions & 237 deletions docker-compose.yml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions tracer/build/_build/Build.Steps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,7 @@ void CompileSamplesThatDependOnDatadogTrace()
// Don't apply a custom filter to these tests, they should all be able to be run
.When(!string.IsNullOrWhiteSpace(AddAreaFilter(Filter)), c => c.SetFilter(AddAreaFilter(Filter)))
.When(TestAllPackageVersions, o => o.SetProcessEnvironmentVariable("TestAllPackageVersions", "true"))
.When(IsWin && string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SQLSERVER_CONNECTION_STRING")), o => o.SetProcessEnvironmentVariable("SQLSERVER_CONNECTION_STRING", @"Server=(localdb)\MSSQLLocalDB;Integrated Security=true;Connection Timeout=60"))
.When(CodeCoverageEnabled, ConfigureCodeCoverage)
.CombineWith(parallelJobs, (s, project) => s
.EnableTrxLogOutput(GetResultsDirectory(project))
Expand All @@ -1889,6 +1890,7 @@ void CompileSamplesThatDependOnDatadogTrace()
.SetLogsDirectory(TestLogsDirectory)
.When(!string.IsNullOrWhiteSpace(filter), c => c.SetFilter(filter))
.When(TestAllPackageVersions, o => o.SetProcessEnvironmentVariable("TestAllPackageVersions", "true"))
.When(IsWin && string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SQLSERVER_CONNECTION_STRING")), o => o.SetProcessEnvironmentVariable("SQLSERVER_CONNECTION_STRING", @"Server=(localdb)\MSSQLLocalDB;Integrated Security=true;Connection Timeout=60"))
.When(CodeCoverageEnabled, ConfigureCodeCoverage)
.CombineWith(ClrProfilerIntegrationTests, (s, project) => s
.EnableTrxLogOutput(GetResultsDirectory(project))
Expand Down Expand Up @@ -2037,6 +2039,7 @@ private string AddAreaFilter(string filter)
.SetIsDebugRun(isDebugRun)
.SetProcessEnvironmentVariable("MonitoringHomeDirectory", MonitoringHomeDirectory)
.SetLogsDirectory(TestLogsDirectory)
.When(IsWin && string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SQLSERVER_CONNECTION_STRING")), o => o.SetProcessEnvironmentVariable("SQLSERVER_CONNECTION_STRING", @"Server=(localdb)\MSSQLLocalDB;Integrated Security=true;Connection Timeout=60"))
.When(CodeCoverageEnabled, ConfigureCodeCoverage)
.CombineWith(ClrProfilerIntegrationTests, (s, project) => s
.EnableTrxLogOutput(GetResultsDirectory(project))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,17 +269,9 @@ public static T SetLocalOsxEnvironmentVariables<T>(this T toolSettings)
{
return toolSettings
.SetProcessEnvironmentVariable("MONGO_HOST", "localhost")
.SetProcessEnvironmentVariable("SERVICESTACK_REDIS_HOST", "localhost:6379")
.SetProcessEnvironmentVariable("STACKEXCHANGE_REDIS_HOST", "localhost:6392,127.0.0.1:6390")
.SetProcessEnvironmentVariable("STACKEXCHANGE_REDIS_SINGLE_HOST", "localhost:6391")
.SetProcessEnvironmentVariable("ELASTICSEARCH7_HOST", "localhost:9200")
.SetProcessEnvironmentVariable("ELASTICSEARCH6_HOST", "localhost:9200")
.SetProcessEnvironmentVariable("ELASTICSEARCH5_HOST", "localhost:9200")
.SetProcessEnvironmentVariable("SQLSERVER_CONNECTION_STRING", "Server=localhost;User=sa;Password=Strong!Passw0rd")
.SetProcessEnvironmentVariable("POSTGRES_HOST", "localhost")
.SetProcessEnvironmentVariable("MYSQL_HOST", "localhost")
.SetProcessEnvironmentVariable("MYSQL_PORT", "3306")
.SetProcessEnvironmentVariable("RABBITMQ_HOST", "localhost")
.SetProcessEnvironmentVariable("AWS_SDK_HOST", "localhost:4566");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@
// </copyright>

using System.Threading.Tasks;
using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers;
using Datadog.Trace.TestHelpers;
using Datadog.Trace.TestHelpers.AutoInstrumentation.Containers;
using Xunit;
using Xunit.Abstractions;

namespace Datadog.Trace.ClrProfiler.IntegrationTests.AdoNet
{
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
[Collection(PostgresCollection.Name)]
public class DapperTests : TracingIntegrationTest
{
public DapperTests(ITestOutputHelper output)
public DapperTests(ITestOutputHelper output, PostgresFixture postgresFixture)
: base("Dapper", output)
{
SetServiceVersion("1.0.0");
ConfigureContainers(postgresFixture);
}

// Assert Npgsql because the Dapper application uses Postgres for the actual client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers;
using Datadog.Trace.Configuration;
using Datadog.Trace.TestHelpers;
using Datadog.Trace.TestHelpers.AutoInstrumentation.Containers;
using FluentAssertions;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -18,12 +19,14 @@ namespace Datadog.Trace.ClrProfiler.IntegrationTests.AdoNet
{
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
[Collection(SqlServerCollection.Name)]
public class MicrosoftDataSqlClientTests : TracingIntegrationTest
{
public MicrosoftDataSqlClientTests(ITestOutputHelper output)
public MicrosoftDataSqlClientTests(ITestOutputHelper output, SqlServerFixture sqlServerFixture)
: base("Microsoft.Data.SqlClient", output)
{
SetServiceVersion("1.0.0");
ConfigureContainers(sqlServerFixture);
}

public override Result ValidateIntegrationSpan(MockSpan span, string metadataSchemaVersion) => span.IsSqlClient(metadataSchemaVersion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers;
using Datadog.Trace.Configuration;
using Datadog.Trace.TestHelpers;
using Datadog.Trace.TestHelpers.AutoInstrumentation.Containers;
using FluentAssertions;
using VerifyXunit;
using Xunit;
Expand All @@ -22,12 +23,19 @@ namespace Datadog.Trace.ClrProfiler.IntegrationTests.AdoNet
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
[UsesVerify]
[Collection(MySqlCollection.Name)]
public class MySqlCommandTests : TracingIntegrationTest
{
public MySqlCommandTests(ITestOutputHelper output)
private readonly MySql8Fixture _mySql8Fixture;
private readonly MySql57Fixture _mySql57Fixture;

public MySqlCommandTests(ITestOutputHelper output, MySql8Fixture mySql8Fixture, MySql57Fixture mySql57Fixture)
: base("MySql", output)
{
_mySql8Fixture = mySql8Fixture;
_mySql57Fixture = mySql57Fixture;
SetServiceVersion("1.0.0");
ConfigureContainers(mySql8Fixture, mySql57Fixture);
}

public override Result ValidateIntegrationSpan(MockSpan span, string metadataSchemaVersion) => span.IsMySql(metadataSchemaVersion);
Expand Down Expand Up @@ -121,6 +129,12 @@ private async Task SubmitsTraces(string packageVersion, string metadataSchemaVer

var settings = VerifyHelper.GetSpanVerifierSettings();
settings.AddRegexScrubber(new Regex("MySql-Test-[a-zA-Z0-9]{32}"), "MySql-Test-GUID");
settings.AddSimpleScrubber($"out.host: {_mySql8Fixture.Host}", "out.host: mysql");
if (_mySql57Fixture.Host is { } mySql57Host)
{
settings.AddSimpleScrubber($"out.host: {mySql57Host}", "out.host: mysql");
}

settings.AddSimpleScrubber("out.host: localhost", "out.host: mysql");
settings.AddSimpleScrubber("out.host: mysql57", "out.host: mysql");
settings.AddSimpleScrubber("out.host: mysql_arm64", "out.host: mysql");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers;
using Datadog.Trace.Configuration;
using Datadog.Trace.TestHelpers;
using Datadog.Trace.TestHelpers.AutoInstrumentation.Containers;
using FluentAssertions;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -18,12 +19,14 @@ namespace Datadog.Trace.ClrProfiler.IntegrationTests.AdoNet
{
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
[Collection(MySqlConnectorCollection.Name)]
public class MySqlConnectorTests : TracingIntegrationTest
{
public MySqlConnectorTests(ITestOutputHelper output)
public MySqlConnectorTests(ITestOutputHelper output, MySql8Fixture mySqlFixture)
: base("MySqlConnector", output)
{
SetServiceVersion("1.0.0");
ConfigureContainers(mySqlFixture);
}

public override Result ValidateIntegrationSpan(MockSpan span, string metadataSchemaVersion) => span.IsMySql(metadataSchemaVersion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers;
using Datadog.Trace.Configuration;
using Datadog.Trace.TestHelpers;
using Datadog.Trace.TestHelpers.AutoInstrumentation.Containers;
using FluentAssertions;
using VerifyXunit;
using Xunit;
Expand All @@ -21,12 +22,17 @@ namespace Datadog.Trace.ClrProfiler.IntegrationTests.AdoNet
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
[UsesVerify]
[Collection(PostgresCollection.Name)]
public class NpgsqlCommandTests : TracingIntegrationTest
{
public NpgsqlCommandTests(ITestOutputHelper output)
private readonly PostgresFixture _postgresFixture;

public NpgsqlCommandTests(ITestOutputHelper output, PostgresFixture postgresFixture)
: base("Npgsql", output)
{
_postgresFixture = postgresFixture;
SetServiceVersion("1.0.0");
ConfigureContainers(postgresFixture);
}

public override Result ValidateIntegrationSpan(MockSpan span, string metadataSchemaVersion) => span.IsNpgsql(metadataSchemaVersion);
Expand Down Expand Up @@ -77,6 +83,7 @@ public async Task SubmitsTraces(

var settings = VerifyHelper.GetSpanVerifierSettings();
settings.AddRegexScrubber(new Regex("Npgsql-Test-[a-zA-Z0-9]{32}"), "Npgsql-Test-GUID");
settings.AddSimpleScrubber($"out.host: {_postgresFixture.Host}", "out.host: postgres");
settings.AddSimpleScrubber("out.host: localhost", "out.host: postgres");
settings.AddSimpleScrubber("out.host: postgres_arm64", "out.host: postgres");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Datadog.Trace.Configuration;
using Datadog.Trace.ExtensionMethods;
using Datadog.Trace.TestHelpers;
using Datadog.Trace.TestHelpers.AutoInstrumentation.Containers;
using FluentAssertions;
using VerifyXunit;
using Xunit;
Expand All @@ -22,12 +23,17 @@ namespace Datadog.Trace.ClrProfiler.IntegrationTests.AdoNet
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
[UsesVerify]
[Collection(SqlServerCollection.Name)]
public class SystemDataSqlClientTests : TracingIntegrationTest
{
public SystemDataSqlClientTests(ITestOutputHelper output)
private readonly SqlServerFixture _sqlServerFixture;

public SystemDataSqlClientTests(ITestOutputHelper output, SqlServerFixture sqlServerFixture)
: base("SqlServer", output)
{
_sqlServerFixture = sqlServerFixture;
SetServiceVersion("1.0.0");
ConfigureContainers(sqlServerFixture);
}

public override Result ValidateIntegrationSpan(MockSpan span, string metadataSchemaVersion) => span.IsSqlClient(metadataSchemaVersion);
Expand Down Expand Up @@ -97,6 +103,12 @@ public async Task SubmitsTraces(
builder.Append(filtered);
});

if (_sqlServerFixture.HostAndPort is { } hostAndPort)
{
settings.AddSimpleScrubber($"out.host: {hostAndPort}", "out.host: sqlserver");
settings.AddSimpleScrubber($"peer.service: {hostAndPort}", "peer.service: sqlserver");
}

settings.AddSimpleScrubber("out.host: localhost", "out.host: sqlserver");
settings.AddSimpleScrubber("out.host: (localdb)\\MSSQLLocalDB", "out.host: sqlserver");
settings.AddSimpleScrubber("out.host: sqledge_arm64", "out.host: sqlserver");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers;
using Datadog.Trace.Configuration;
using Datadog.Trace.TestHelpers;
using Datadog.Trace.TestHelpers.AutoInstrumentation.Containers;
Expand All @@ -21,7 +22,8 @@ namespace Datadog.Trace.ClrProfiler.IntegrationTests
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "2")]
[UsesVerify]
public class AerospikeTests : TracingIntegrationTest, IClassFixture<AerospikeFixture>
[Collection(AerospikeCollection.Name)]
public class AerospikeTests : TracingIntegrationTest
{
public AerospikeTests(ITestOutputHelper output, AerospikeFixture aerospikeFixture)
: base("Aerospike", output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers;
using Datadog.Trace.Configuration;
using Datadog.Trace.TestHelpers;
using Datadog.Trace.TestHelpers.AutoInstrumentation.Containers;
using FluentAssertions.Execution;
using VerifyXunit;
using Xunit;
Expand All @@ -20,12 +22,17 @@ namespace Datadog.Trace.ClrProfiler.IntegrationTests
[UsesVerify]
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
[Collection(CouchbaseCollection.Name)]
public class Couchbase3Tests : TracingIntegrationTest
{
public Couchbase3Tests(ITestOutputHelper output)
private readonly CouchbaseFixture _couchbaseFixture;

public Couchbase3Tests(ITestOutputHelper output, CouchbaseFixture couchbaseFixture)
: base("Couchbase3", output)
{
_couchbaseFixture = couchbaseFixture;
SetServiceVersion("1.0.0");
ConfigureContainers(couchbaseFixture);
}

public static IEnumerable<object[]> GetEnabledConfig()
Expand Down Expand Up @@ -74,6 +81,10 @@ public async Task SubmitTraces(string packageVersion, string metadataSchemaVersi
settings.AddSimpleScrubber("db.couchbase.seed.nodes: localhost", "db.couchbase.seed.nodes: couchbase");
settings.AddSimpleScrubber("out.host: localhost", "out.host: couchbase");
settings.AddSimpleScrubber("peer.service: localhost", "peer.service: couchbase");
settings.AddRegexScrubber(new Regex($@"db.couchbase.seed.nodes: {Regex.Escape(_couchbaseFixture.Host)}(?::[0-9]+)?"), "db.couchbase.seed.nodes: couchbase");
settings.AddSimpleScrubber($"out.host: {_couchbaseFixture.Host}", "out.host: couchbase");
settings.AddRegexScrubber(new Regex($@"peer.service: {Regex.Escape(_couchbaseFixture.Host)}(?::[0-9]+)?"), "peer.service: couchbase");
settings.AddSimpleScrubber($"couchbase.operation.bucket: {_couchbaseFixture.BucketName}", "couchbase.operation.bucket: default");

// theres' a fair amount less in 3.0.7 - fewer spans, different terminology etc

Expand Down Expand Up @@ -126,7 +137,7 @@ private static string GetVersionSuffix(string packageVersion)
return "_3_4";
}

return string.Empty;
return version < new Version("3.8.0") ? string.Empty : "_3_8";
}

private static Version GetPackageVersion(string packageVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers;
using Datadog.Trace.Configuration;
using Datadog.Trace.ExtensionMethods;
using Datadog.Trace.TestHelpers;
using Datadog.Trace.TestHelpers.AutoInstrumentation.Containers;
using Xunit;
using Xunit.Abstractions;

namespace Datadog.Trace.ClrProfiler.IntegrationTests
{
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
[Collection(CouchbaseCollection.Name)]
public class CouchbaseTests : TracingIntegrationTest
{
public CouchbaseTests(ITestOutputHelper output)
public CouchbaseTests(ITestOutputHelper output, CouchbaseFixture couchbaseFixture)
: base("Couchbase", output)
{
SetServiceVersion("1.0.0");
ConfigureContainers(couchbaseFixture);
}

public static IEnumerable<object[]> GetEnabledConfig()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Datadog.Trace.ClrProfiler.IntegrationTests
{
public class CustomTestFramework : TestHelpers.AutoInstrumentation.DockerTestFramework
public class CustomTestFramework : TestHelpers.CustomTestFramework
{
public CustomTestFramework(IMessageSink messageSink)
: base(messageSink, typeof(Instrumentation))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers;
using Datadog.Trace.Configuration;
using Datadog.Trace.TestHelpers;
using Datadog.Trace.TestHelpers.AutoInstrumentation.Containers;
using Datadog.Trace.TestHelpers.DataStreamsMonitoring;
using FluentAssertions;
using FluentAssertions.Execution;
Expand All @@ -19,15 +21,16 @@
namespace Datadog.Trace.ClrProfiler.IntegrationTests;

[UsesVerify]
[Collection(nameof(KafkaTests.KafkaTestsCollection))]
[Collection(KafkaCollection.Name)]
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
public class DataStreamsMonitoringKafkaTests : TestHelper
{
public DataStreamsMonitoringKafkaTests(ITestOutputHelper output)
public DataStreamsMonitoringKafkaTests(ITestOutputHelper output, KafkaFixture kafkaFixture)
: base("DataStreams.Kafka", output)
{
SetServiceVersion("1.0.0");
ConfigureContainers(kafkaFixture);
}

public static IEnumerable<object[]> GetKafkaTestData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers;
using Datadog.Trace.Configuration;
using Datadog.Trace.TestHelpers;
using Datadog.Trace.TestHelpers.AutoInstrumentation.Containers;
using Datadog.Trace.TestHelpers.DataStreamsMonitoring;
using FluentAssertions;
using FluentAssertions.Execution;
Expand All @@ -22,12 +24,14 @@ namespace Datadog.Trace.ClrProfiler.IntegrationTests;
[UsesVerify]
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
[Collection(RabbitMqCollection.Name)]
public class DataStreamsMonitoringRabbitMQTests : TestHelper
{
public DataStreamsMonitoringRabbitMQTests(ITestOutputHelper output)
public DataStreamsMonitoringRabbitMQTests(ITestOutputHelper output, RabbitMqFixture rabbitMqFixture)
: base("DataStreams.RabbitMQ", output)
{
SetServiceVersion("1.0.0");
ConfigureContainers(rabbitMqFixture);
}

[SkippableTheory]
Expand Down
Loading
Loading