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: Address issue with newline characters when running Logging Hook Unit Tests on linux #374

Merged

Conversation

kylejuliandev
Copy link
Contributor

This PR

I noticed when I ran the LoggingHook unit tests on a WSL Ubuntu instance the some tests fails due to new line characters. It appears I never normalized or excluded newline characters when asserting equal

image

I also removed the Assert.Contains snippets as the content and layout of the log message is asserted in the other tests. This Assert method does not have an overload for ignoring new line characters

I assume the GitHub CI runner may be ignore the line endings by default?

Related Issues

Notes

Follow-up Tasks

How to test

* I noticed when I ran these tests on a WSL Ubuntu instance the Logging
  Hook tests fail. It appears I never normalized or excluded newline
  characters when asserting equal.
* Remove Assert.Contains examples as this does not provide an overload
  for ignore newline characters

Signed-off-by: Kyle Julian <[email protected]>
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.13%. Comparing base (4977542) to head (9019780).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #374   +/-   ##
=======================================
  Coverage   86.13%   86.13%           
=======================================
  Files          39       39           
  Lines        1601     1601           
  Branches      173      173           
=======================================
  Hits         1379     1379           
  Misses        186      186           
  Partials       36       36           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@beeme1mr
Copy link
Member

Hey @kylejuliandev, is this ready for a review? It's marked as a draft, so I wasn't sure. Thanks!

@kylejuliandev kylejuliandev marked this pull request as ready for review February 14, 2025 15:26
@kylejuliandev kylejuliandev requested a review from a team as a code owner February 14, 2025 15:26
@kylejuliandev
Copy link
Contributor Author

Hey @beeme1mr, I've moved it from draft now

I'm not sure this change is strictly necessary, as the pipelines can execute (on Ubuntu) these tests fine. But this potentially improves the experience for those using the WSL as well as Windows to develop and contribute to this project

@askpt askpt added this pull request to the merge queue Feb 17, 2025
Merged via the queue into open-feature:main with commit a98334e Feb 17, 2025
15 checks passed
@kylejuliandev kylejuliandev deleted the fix/address-logging-hook-newlines branch February 17, 2025 21:58
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.

3 participants