From b5bd17a60bfcbae3434a8427d63dab412fafeaf3 Mon Sep 17 00:00:00 2001 From: martincostello Date: Wed, 17 Dec 2025 10:16:47 +0000 Subject: [PATCH 1/3] [EFCore] Fix integration test Update expected span name after changes in #3592. --- .../EntityFrameworkIntegrationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs b/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs index 4e6d1df0b8..0cdd27a096 100644 --- a/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs +++ b/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs @@ -65,7 +65,7 @@ public EntityFrameworkIntegrationTests( foreach ((var provider, var commandType, var useNewConventions, var system, var database) in providers) { - var expectedSpanName = useNewConventions + var expectedSpanName = useNewConventions || provider is SqlServerProvider ? "select" : database; From ba7509b2e86893aaf5b5036df2e1f019f17cc6c0 Mon Sep 17 00:00:00 2001 From: martincostello Date: Wed, 17 Dec 2025 10:25:26 +0000 Subject: [PATCH 2/3] [EFCore] Fix integration test Skip the old conventions test for SQL Server. --- .../EntityFrameworkIntegrationTests.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs b/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs index 0cdd27a096..10e630e30d 100644 --- a/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs +++ b/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs @@ -57,7 +57,6 @@ public EntityFrameworkIntegrationTests( (PostgresProvider, typeof(NpgsqlCommand), true, "postgresql", "postgres"), (SqliteProvider, typeof(SqliteCommand), false, "sqlite", "main"), (SqliteProvider, typeof(SqliteCommand), true, "sqlite", "main"), - (SqlServerProvider, typeof(SqlCommand), false, "mssql", "master"), (SqlServerProvider, typeof(SqlCommand), true, "microsoft.sql_server", "master"), ]; @@ -65,7 +64,7 @@ public EntityFrameworkIntegrationTests( foreach ((var provider, var commandType, var useNewConventions, var system, var database) in providers) { - var expectedSpanName = useNewConventions || provider is SqlServerProvider + var expectedSpanName = useNewConventions ? "select" : database; From 72df9316dc1d14ba996db8e760d0c9fac362e827 Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Wed, 17 Dec 2025 15:30:02 +0000 Subject: [PATCH 3/3] [SqlClient] RunEFCore tests too Also run the EFCore tests if SqlClient is changed. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f94c12c0c..f2894fb90e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: instrumentation-cassandra: ['*/OpenTelemetry.Instrumentation.Cassandra*/**', '!**/*.md'] instrumentation-confluentkafka: ['*/OpenTelemetry.Instrumentation.ConfluentKafka*/**', 'examples/kafka/**', '!**/*.md'] instrumentation-elasticsearchclient: ['*/OpenTelemetry.Instrumentation.ElasticsearchClient*/**', '!**/*.md'] - instrumentation-entityframeworkcore: ['*/OpenTelemetry.Instrumentation.EntityFrameworkCore*/**', '!**/*.md'] + instrumentation-entityframeworkcore: ['*/OpenTelemetry.Instrumentation.EntityFrameworkCore*/**', '*/OpenTelemetry.Instrumentation.SqlClient/**', '!**/*.md'] instrumentation-eventcounters: ['*/OpenTelemetry.Instrumentation.EventCounters*/**', 'examples/event-counters/**', '!**/*.md'] instrumentation-grpccore: ['*/OpenTelemetry.Instrumentation.GrpcCore*/**', '!**/*.md'] instrumentation-grpcnetclient: ['*/OpenTelemetry.Instrumentation.GrpcNetClient*/**', '!**/*.md']