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: improved handling of complex yaml in YAMLNodeToJSON #316

Merged
merged 4 commits into from
Aug 7, 2024

Conversation

TristanSpeakEasy
Copy link
Contributor

Makes it possible to render yaml that uses anchors and complex map keys

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 99.65%. Comparing base (61b8a2f) to head (ecc3d69).

Files Patch % Lines
json/json.go 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #316      +/-   ##
==========================================
+ Coverage   99.62%   99.65%   +0.02%     
==========================================
  Files         164      164              
  Lines       16586    16593       +7     
==========================================
+ Hits        16524    16535      +11     
+ Misses         57       53       -4     
  Partials        5        5              
Flag Coverage Δ
unittests 99.65% <87.50%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@daveshanley
Copy link
Member

Bump those two lines of coverage, and it's good to go.

@TristanSpeakEasy
Copy link
Contributor Author

@daveshanley I didn't cover those lines as I really don't know how to inject invalid data into this to cause those to be covered.

If you have any ideas let me know and I will add tests

@TristanSpeakEasy
Copy link
Contributor Author

@daveshanley essential asking for a pass on dealing with those bits of coverage, though if you really do want them covered I guess a way forward is to unit test the internal functions directly (currently I am only testing the public interface with the package json_test restriction in the test file) and manually trying to construct an invalid yaml.Node

@daveshanley
Copy link
Member

I spent about 20 minutes and I could get one line covered, but the other is impossible to test as it's a deep catch.

Pass granted.

@daveshanley daveshanley merged commit fb545f9 into pb33f:main Aug 7, 2024
3 of 4 checks passed
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