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

fix: IsOsPlatform() fails on older .NET Framework Versions #1552

Merged
merged 5 commits into from Apr 18, 2023

Conversation

tippmar-nr
Copy link
Member

Thank you for submitting a pull request. Please review our contributing guidelines and code of conduct.

Description

Moved all calls to RuntimeInformation.IsOsPlatform() within a #if NETSTANDARD2_0 block.

Author Checklist

  • Unit tests, Integration tests, and Unbounded tests completed
  • Performance testing completed with satisfactory results (if required)

Reviewer Checklist

  • Perform code review
  • Pull request was adequately tested (new/existing tests, performance tests)

@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2023

Codecov Report

Merging #1552 (6f28d01) into main (e49bf63) will increase coverage by 0.00%.
The diff coverage is 12.50%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1552   +/-   ##
=======================================
  Coverage   73.03%   73.03%           
=======================================
  Files         408      408           
  Lines       25575    25576    +1     
=======================================
+ Hits        18678    18679    +1     
  Misses       6897     6897           
Impacted Files Coverage Δ
...elic/Agent/Core/NewRelic.Agent.Core/Environment.cs 56.72% <0.00%> (-0.59%) ⬇️
...Core/NewRelic.Agent.Core/RuntimeEnvironmentInfo.cs 18.18% <14.28%> (-2.23%) ⬇️

... and 1 file with indirect coverage changes

@chynesNR
Copy link
Member

I think RuntimeEnvironmentInfo.DetermineOSPlatform() may need the same protection?

@tippmar-nr
Copy link
Member Author

@chynesNR It does need that protection, but I opted not to add it, as doing so broke the unit tests for that class (we only have .NET 462 unit tests for Core). I'll add a comment to the class that will hopefully dissuade folks from using it outside of the protection of .NET Standard 2.0+.

@tippmar-nr tippmar-nr merged commit 699c205 into main Apr 18, 2023
72 checks passed
@tippmar-nr tippmar-nr deleted the experimental/is-os-platform-fix branch April 18, 2023 21:22
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.

None yet

6 participants