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

feat: Container json testing #1604

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

another-rex
Copy link
Collaborator

@another-rex another-rex commented Feb 11, 2025

Fork of #1602

Adds a JSON matching method, and implements a path enumeration function to help mock values in the snapshot to avoid polluting the logs with very long JSON values that we are not necessarily testing.

Moved the normalisation step into the match snapshot function itself to ensure that it is always the last step taken.

@another-rex another-rex changed the title Container json testing feat: Container json testing Feb 11, 2025
@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 91.80328% with 15 lines in your changes missing coverage. Please review.

Project coverage is 69.03%. Comparing base (3d964a5) to head (e7f9025).

Files with missing lines Patch % Lines
internal/testutility/jsonreplace.go 91.89% 4 Missing and 2 partials ⚠️
internal/testutility/utility.go 93.61% 4 Missing and 2 partials ⚠️
internal/testutility/snapshot.go 80.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1604      +/-   ##
==========================================
+ Coverage   68.80%   69.03%   +0.23%     
==========================================
  Files         200      201       +1     
  Lines       18990    19171     +181     
==========================================
+ Hits        13066    13235     +169     
- Misses       5229     5238       +9     
- Partials      695      698       +3     

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

@another-rex
Copy link
Collaborator Author

@michaelkedar fyi this changes some of GR's snapshots to be technically incorrect (changes backslashes to forward slashes).

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