Skip to content

[Infra] Use TestContainers for integration tests #4094

Draft
martincostello wants to merge 12 commits intoopen-telemetry:mainfrom
martincostello:use-testcontainers
Draft

[Infra] Use TestContainers for integration tests #4094
martincostello wants to merge 12 commits intoopen-telemetry:mainfrom
martincostello:use-testcontainers

Conversation

@martincostello
Copy link
Copy Markdown
Member

Changes

  • Use TestContainers for Cassandra and Kafka integration tests.
  • Add missing using.
  • Fix broken assertion on .NET Framework.

Builds on top of #4093.

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)

Add benchmarks for the Redis instrumentation.
Add a benchmark for end-to-end usage of StackExchange.Redis.
- Use new conventions.
- Pass connection to instrumentation.
- Update component owners.
Use the same SHA that was in the compose file.
Use interface instead of concrete type to avoid InvalidCastException.
Revert the previous fix as it breaks things - use the old conventions instead for now.
- Use test containers for integration tests.
- Remove dedicated integration test workflow.
- Fix workflow name.

Build on top of open-telemetry#4092.
Add missing usings.
Avoid exception on platforms with Linux Docker not available caused by the class fixture.
- Use TestContainers for Cassandra and Kafka integration tests.
- Add missing `using`.
- Fix broken assertion on .NET Framework.

Builds on top of open-telemetry#4093.
@github-actions github-actions bot added infra Infra work - CI/CD, code coverage, linters dependencies Pull requests that update a dependency file comp:instrumentation.stackexchangeredis Things related to OpenTelemetry.Instrumentation.StackExchangeRedis comp:instrumentation.cassandra Things related to OpenTelemetry.Instrumentation.Cassandra comp:instrumentation.confluentkafka Things related to OpenTelemetry.Instrumentation.ConfluentKafka comp:instrumentation.entityframeworkcore Things related to OpenTelemetry.Instrumentation.EntityFrameworkCore perf Performance related labels Apr 12, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.62%. Comparing base (df6d38d) to head (b5b093c).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4094      +/-   ##
==========================================
+ Coverage   72.93%   74.62%   +1.69%     
==========================================
  Files         452      460       +8     
  Lines       17844    17886      +42     
==========================================
+ Hits        13014    13347     +333     
+ Misses       4830     4539     -291     
Flag Coverage Δ
unittests-Contrib.Shared.Tests 89.74% <ø> (ø)
unittests-Exporter.Geneva 55.14% <ø> (ø)
unittests-Exporter.InfluxDB 95.81% <ø> (ø)
unittests-Exporter.Instana 74.86% <ø> (ø)
unittests-Exporter.OneCollector 94.61% <ø> (ø)
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.54% <ø> (ø)
unittests-Instrumentation.AspNet 76.61% <ø> (ø)
unittests-Instrumentation.AspNetCore 70.44% <ø> (ø)
unittests-Instrumentation.Cassandra 92.85% <ø> (?)
unittests-Instrumentation.ConfluentKafka 77.37% <ø> (+37.54%) ⬆️
unittests-Instrumentation.ElasticsearchClient 80.60% <ø> (ø)
unittests-Instrumentation.EntityFrameworkCore 80.80% <ø> (ø)
unittests-Instrumentation.EventCounters 77.27% <ø> (ø)
unittests-Instrumentation.GrpcCore 91.42% <ø> (ø)
unittests-Instrumentation.GrpcNetClient 73.78% <ø> (ø)
unittests-Instrumentation.Hangfire 86.05% <ø> (ø)
unittests-Instrumentation.Http 74.62% <ø> (ø)
unittests-Instrumentation.Owin 88.62% <ø> (ø)
unittests-Instrumentation.Process 100.00% <ø> (ø)
unittests-Instrumentation.Quartz 78.76% <ø> (ø)
unittests-Instrumentation.Runtime 100.00% <ø> (ø)
unittests-Instrumentation.ServiceFabricRemoting 34.68% <ø> (ø)
unittests-Instrumentation.SqlClient 85.21% <ø> (ø)
unittests-Instrumentation.StackExchangeRedis 93.81% <ø> (+21.82%) ⬆️
unittests-Instrumentation.Wcf 79.68% <ø> (ø)
unittests-OpAmp.Client 78.78% <ø> (+0.49%) ⬆️
unittests-PersistentStorage 68.19% <ø> (-1.97%) ⬇️
unittests-Resources.AWS 74.34% <ø> (ø)
unittests-Resources.Azure 85.31% <ø> (ø)
unittests-Resources.Container 67.34% <ø> (ø)
unittests-Resources.Gcp 71.42% <ø> (ø)
unittests-Resources.Host 72.26% <ø> (ø)
unittests-Resources.OperatingSystem 76.98% <ø> (ø)
unittests-Resources.Process 100.00% <ø> (ø)
unittests-Resources.ProcessRuntime 79.59% <ø> (ø)
unittests-Sampler.AWS 94.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 26 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.

Use a collection fixture for the database fixtures instead of a class collection.
Enable collection of code coverage for the Cassandra instrumentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:instrumentation.cassandra Things related to OpenTelemetry.Instrumentation.Cassandra comp:instrumentation.confluentkafka Things related to OpenTelemetry.Instrumentation.ConfluentKafka comp:instrumentation.entityframeworkcore Things related to OpenTelemetry.Instrumentation.EntityFrameworkCore comp:instrumentation.stackexchangeredis Things related to OpenTelemetry.Instrumentation.StackExchangeRedis dependencies Pull requests that update a dependency file infra Infra work - CI/CD, code coverage, linters perf Performance related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant