Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ToOtlpLog unit tests for scopes #4523

Conversation

mfogliatto
Copy link
Contributor

@mfogliatto mfogliatto commented May 27, 2023

Towards #2873

Changes

Add ToOtlpLog unit tests for scopes

Merge requirement checklist

  • CONTRIBUTING guidelines followed (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)

@mfogliatto mfogliatto requested a review from a team May 27, 2023 09:22
@mfogliatto mfogliatto force-pushed the mfogliatto/add-otlplogexporter-scope-tests branch from 6002093 to 231ebb2 Compare May 27, 2023 09:23
@codecov
Copy link

codecov bot commented May 27, 2023

Codecov Report

Merging #4523 (c4158e0) into main (64df5e3) will increase coverage by 0.06%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4523      +/-   ##
==========================================
+ Coverage   85.14%   85.20%   +0.06%     
==========================================
  Files         318      318              
  Lines       12620    12620              
==========================================
+ Hits        10745    10753       +8     
+ Misses       1875     1867       -8     

see 7 files with indirect coverage changes

const string expectedScopeValue = "Some scope value";

// Act.
using (logger.BeginScope(new List<KeyValuePair<string, object>>
Copy link
Member

Choose a reason for hiding this comment

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

could you add the case where scope is something other than List ? like a simple string, for example, or some other ds like dictionary, etc.

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

LGTM.
Not a blocker, but we need to add tests when scope is something other than List as well.
Also worth adding is the case where the keys are duplicated in multiple scope levels and in the logger.log itself.

@cijothomas cijothomas merged commit e85bd93 into open-telemetry:main May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants