Skip to content

[EFCore] Fix integration test#3626

Merged
martincostello merged 3 commits intoopen-telemetry:mainfrom
martincostello:gh-3592-ef-fixes
Dec 19, 2025
Merged

[EFCore] Fix integration test#3626
martincostello merged 3 commits intoopen-telemetry:mainfrom
martincostello:gh-3592-ef-fixes

Conversation

@martincostello
Copy link
Copy Markdown
Member

@martincostello martincostello commented Dec 17, 2025

Changes

Remove integration test for SQL Server using the old conventions after changes in #3592.

The test only runs on Linux, so is easy to overlook if not changing the EFCore files and working on Windows locally.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

Update expected span name after changes in open-telemetry#3592.
@github-actions github-actions Bot added the comp:instrumentation.entityframeworkcore Things related to OpenTelemetry.Instrumentation.EntityFrameworkCore label Dec 17, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.29%. Comparing base (9f71a33) to head (72df931).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3626      +/-   ##
==========================================
- Coverage   71.41%   71.29%   -0.12%     
==========================================
  Files         443      453      +10     
  Lines       17519    17570      +51     
==========================================
+ Hits        12511    12527      +16     
- Misses       5008     5043      +35     
Flag Coverage Δ
unittests-Contrib.Shared.Tests 86.54% <ø> (ø)
unittests-Exporter.Geneva 53.78% <ø> (+0.13%) ⬆️
unittests-Exporter.InfluxDB 95.14% <ø> (ø)
unittests-Exporter.Instana 74.86% <ø> (ø)
unittests-Exporter.OneCollector 94.62% <ø> (ø)
unittests-Extensions 90.65% <ø> (ø)
unittests-Extensions.Enrichment 100.00% <ø> (ø)
unittests-Extensions.Enrichment.AspNetCore 86.27% <ø> (ø)
unittests-Extensions.Enrichment.Http 94.33% <ø> (ø)
unittests-Instrumentation.AWS 83.59% <ø> (-0.22%) ⬇️
unittests-Instrumentation.AspNet 77.92% <ø> (-0.23%) ⬇️
unittests-Instrumentation.AspNetCore 71.69% <ø> (ø)
unittests-Instrumentation.Cassandra 23.52% <ø> (?)
unittests-Instrumentation.ConfluentKafka 14.10% <ø> (ø)
unittests-Instrumentation.ElasticsearchClient 80.12% <ø> (ø)
unittests-Instrumentation.EntityFrameworkCore 80.80% <ø> (ø)
unittests-Instrumentation.EventCounters 77.27% <ø> (ø)
unittests-Instrumentation.GrpcCore 91.42% <ø> (ø)
unittests-Instrumentation.GrpcNetClient 79.61% <ø> (ø)
unittests-Instrumentation.Hangfire 86.05% <ø> (ø)
unittests-Instrumentation.Http 74.22% <ø> (ø)
unittests-Instrumentation.Owin 88.62% <ø> (ø)
unittests-Instrumentation.Process 100.00% <ø> (ø)
unittests-Instrumentation.Quartz 78.76% <ø> (ø)
unittests-Instrumentation.Runtime 100.00% <ø> (ø)
unittests-Instrumentation.ServiceFabricRemoting 34.54% <ø> (ø)
unittests-Instrumentation.SqlClient 87.19% <ø> (ø)
unittests-Instrumentation.StackExchangeRedis 71.80% <ø> (ø)
unittests-Instrumentation.Wcf 79.57% <ø> (ø)
unittests-OpAmp.Client 79.02% <ø> (ø)
unittests-PersistentStorage 74.91% <ø> (ø)
unittests-Resources.AWS 74.42% <ø> (ø)
unittests-Resources.Azure 85.31% <ø> (ø)
unittests-Resources.Container 67.34% <ø> (ø)
unittests-Resources.Gcp 71.42% <ø> (ø)
unittests-Resources.Host 71.85% <ø> (ø)
unittests-Resources.OperatingSystem 76.98% <ø> (ø)
unittests-Resources.Process 100.00% <ø> (ø)
unittests-Resources.ProcessRuntime 79.59% <ø> (ø)
unittests-Sampler.AWS 93.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Skip the old conventions test for SQL Server.
@martincostello martincostello marked this pull request as ready for review December 17, 2025 10:29
@martincostello martincostello requested a review from a team as a code owner December 17, 2025 10:29
Copilot AI review requested due to automatic review settings December 17, 2025 10:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an Entity Framework Core integration test that was failing on Linux after changes in PR #3592. The update aligns the test expectations with new semantic convention naming for SQL Server database systems.

Key Changes

  • Removed the SQL Server test case using the old naming convention (useNewConventions=false with "mssql")
  • Retained only the SQL Server test case using the new naming convention (useNewConventions=true with "microsoft.sql_server")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Kielek
Copy link
Copy Markdown
Member

Kielek commented Dec 17, 2025

Any chance to check why the EFCore tests was not triggered while code shared with SqlClient instrumentation was changed?
I think that is the main issue here.

@martincostello
Copy link
Copy Markdown
Member Author

There's no shared code, but the EFCore tests depend on the SqlClient instrumentation project for the test which validates they work together:

<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.SqlClient\OpenTelemetry.Instrumentation.SqlClient.csproj" />

@Kielek
Copy link
Copy Markdown
Member

Kielek commented Dec 17, 2025

Maybe it is worth to add this:

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5f94c12c..f2894fb9 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']

And fix existing test case?

@martincostello
Copy link
Copy Markdown
Member Author

And fix existing test case?

I started doing that at first, but it got complicated very fast with "use old conventions, but only for these bits, not for those bits" so I figured it wasn't worth the extra complexity so just removed the test case. Otherwise it's no longer binary (old vs new) but ((old vs new) * always new)

Also run the EFCore tests if SqlClient is changed.
@github-actions github-actions Bot added the infra Infra work - CI/CD, code coverage, linters label Dec 17, 2025
@martincostello
Copy link
Copy Markdown
Member Author

@Kielek Are you happy to approve this so we can get main fixed and unblock other PRs?

Copy link
Copy Markdown
Member

@Kielek Kielek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martincostello, it should be fine. Sorry for delay - last couple days I need to take care of some internal tasks.

@martincostello martincostello added this pull request to the merge queue Dec 19, 2025
Merged via the queue into open-telemetry:main with commit 0064f01 Dec 19, 2025
320 checks passed
@martincostello martincostello deleted the gh-3592-ef-fixes branch December 19, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:instrumentation.entityframeworkcore Things related to OpenTelemetry.Instrumentation.EntityFrameworkCore infra Infra work - CI/CD, code coverage, linters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants