feat(opentelemetry): add OpenTelemetry unit tests and update dependencies#148
Merged
Conversation
- Moved project description below badges for improved structure and readability.
- Removed redundant IServiceProvider parameter from tracer methods. - Improved null checks using `ArgumentNullException.ThrowIfNull`. - Consolidated and simplified code structure for clarity and maintainability.
- Added `AwsLambda.Host.OpenTelemetry.UnitTests` project to solution. - Included initial test class `LambdaOpenTelemetryServiceProviderExtensionsTests` with a placeholder test. - Configured multiple target frameworks for the test project. - Added necessary dependencies to support testing, mocking, and coverage tools.
- Added comprehensive unit tests for `LambdaOpenTelemetryServiceProviderExtensions` methods. - Verified behavior for various scenarios, including null checks, invalid types, and valid middleware flows. - Introduced helper models (`TestEvent`, `TestResponse`) to support test scenarios. - Updated project file to include necessary dependencies and project references. - Modified target frameworks and enabled `LangVersion=preview` for testing.
…n extensions - Reorganized `OnShutdownOpenTelemetryExtensions` methods for improved readability and maintainability. - Removed redundant XML documentation in favor of concise summaries. - Consolidated method chaining to streamline extension behavior. - Enhanced exception handling with `ArgumentNullException.ThrowIfNull`. - Simplified `RunForceFlush` logic with consistent logging and timeout handling.
…viderExtensionsTests - Removed unused `AutoFixture` dependency. - Reorganized long method declarations to improve readability. - Standardized formatting across `TestEvent` and `TestResponse` helper classes. - Enhanced code consistency in test case definitions and constructor initialization.
- Added `OnShutdownFlushTracer` tests to validate different shutdown scenarios for tracer providers. - Added `OnShutdownFlushMeter` tests to validate meter provider force flush behaviors on shutdown. - Added `OnShutdownFlushOpenTelemetry` tests to cover combined tracer and meter flush scenarios. - Verified logging messages for successful, failed, and timed-out flush operations. - Introduced helper classes and mocks (`MockOptions`, `MockProcessor`, `MockMetricReader`) for test setup.
- Added `NSubstitute.Analyzers.CSharp` to all test projects for improved mocking verification. - Integrated `OpenTelemetry.Exporter.InMemory` into OpenTelemetry test project for in-memory tracing. - Added `Microsoft.Extensions.Diagnostics.Testing` to support diagnostic testing scenarios. - Updated `Directory.Packages.props` to include new package versions for consistent versioning.
…ols support - Changed Dependabot update schedule from weekly to daily for nuget and GitHub Actions ecosystems. - Added configurations for npm and dotnet-tools ecosystems with daily updates. - Defined minor-and-patch groupings for consistent dependency management.
- Changed `dotnet-tools` ecosystem to `dotnet-sdk` in Dependabot config. - Updated directory to `/` for `dotnet-sdk`. - Modified update schedule from daily to weekly for better control.
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #148 +/- ##
==========================================
+ Coverage 64.15% 71.86% +7.70%
==========================================
Files 61 61
Lines 1727 1731 +4
Branches 202 202
==========================================
+ Hits 1108 1244 +136
+ Misses 562 430 -132
Partials 57 57
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🚀 Pull Request
📋 Summary
This PR adds comprehensive unit tests for OpenTelemetry shutdown extensions, refactors OpenTelemetry extensions to use C# 14 extension blocks for cleaner syntax, updates dependabot configuration to check dependencies daily and add npm and dotnet-tools support, and updates project dependencies with new testing packages.
✅ Checklist
🧪 Related Issues or PRs
Closes #N/A
💬 Notes for Reviewers
AwsLambda.Host.OpenTelemetry.UnitTests