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

improve test coverage: OpenTelemetry.Api CallerArgumentExpressionAttribute #3362

Merged
merged 20 commits into from
Jul 29, 2022
Merged

improve test coverage: OpenTelemetry.Api CallerArgumentExpressionAttribute #3362

merged 20 commits into from
Jul 29, 2022

Conversation

TimothyMothra
Copy link
Contributor

@TimothyMothra TimothyMothra commented Jun 13, 2022

Contributes to #3353
As of today;

  • Overall: 85.80%
  • Project: OpenTelemetry.Api: 86.85%
  • File: Guard.cs: 0%

This value for Guard isn't correct. Seems that CodeCov is only counting the first class in this file.

Screenshot

image

Changes

  • Update CallerArgumentExpressionAttribute with a link to the original implementation. link.
  • Add new tests for CallerArgumentExpressionAttributeTests, borrowed from link
  • Cleanup GuardTest.cs
    • move all extra classes inside public class GuardTest.
    • remove #pragma warning disable SA1402 // File may only contain a single type
    • remove #pragma warning disable SA1649 // File name should match first type name

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • Appropriate CHANGELOG.md updated for non-trivial changes
  • Design discussion issue #
  • Changes in public API reviewed

@TimothyMothra TimothyMothra requested a review from a team June 13, 2022 23:45
@codecov
Copy link

codecov bot commented Jun 13, 2022

Codecov Report

Merging #3362 (662bbf7) into main (0a4a625) will decrease coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3362      +/-   ##
==========================================
- Coverage   86.58%   86.50%   -0.09%     
==========================================
  Files         275      275              
  Lines        9978     9978              
==========================================
- Hits         8639     8631       -8     
- Misses       1339     1347       +8     
Impacted Files Coverage Δ
src/OpenTelemetry.Api/Internal/Guard.cs 0.00% <ø> (ø)
src/OpenTelemetry/Logs/Pool/LogRecordSharedPool.cs 78.94% <0.00%> (-21.06%) ⬇️

Copy link
Member

@alanwest alanwest left a comment

Choose a reason for hiding this comment

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

LGTM.

I am curious about

This value for Guard isn't correct. Seems that CodeCov is only counting the first class in this file.

If CallerArgumentExpressionAttribute was moved to its own file does CodeCov account for things correctly? Might be worth experimenting, but I don't feel strongly it has to block this PR.

@TimothyMothra
Copy link
Contributor Author

If CallerArgumentExpressionAttribute was moved to its own file does CodeCov account for things correctly? Might be worth experimenting, but I don't feel strongly it has to block this PR.

We could experiment with moving CallerArgumentExpressionAttribute inside of Guard. I can look for other nested classes and see if CodeCov reports correctly.

@TimothyMothra

This comment was marked as outdated.

@TimothyMothra TimothyMothra changed the title improve test coverage: OpenTelemetry.Api CallerArgumentExpressionAttribute improve test coverage: OpenTelemetry.Api Guard and CallerArgumentExpressionAttribute Jul 22, 2022
@TimothyMothra
Copy link
Contributor Author

I can look for other nested classes and see if CodeCov reports correctly.

I reverted the change to Guard.cs.
All the related tests failed.
We should investigate this in a separate PR.

@TimothyMothra TimothyMothra changed the title improve test coverage: OpenTelemetry.Api Guard and CallerArgumentExpressionAttribute improve test coverage: OpenTelemetry.Api CallerArgumentExpressionAttribute Jul 22, 2022
@utpilla utpilla merged commit cb6b7a8 into open-telemetry:main Jul 29, 2022
@TimothyMothra TimothyMothra deleted the 3353_CallerArgumentExpressionAttribute branch July 29, 2022 21:21
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.

5 participants