Skip to content

Conversation

@G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Dec 4, 2025

This should make it a lot easier to review changes to the cassettes

@G-Rath G-Rath requested review from another-rex and cuixq December 4, 2025 19:16
Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Ah nice! I was just thinking of doing this.

if !bytes.Equal(body2, []byte(i.Body)) {
if !bytes.Equal(
pretty.PrettyOptions(buffer.Bytes(), &pretty.Options{SortKeys: true}),
pretty.PrettyOptions([]byte(i.Body), &pretty.Options{SortKeys: true}),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should actually be a cmp compare of the parsed output, rather than formatting both JSONs and doing a byte compare.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

could be, but what do you think of landing this as-is? just cause of its size and I've got a few other tweaks I'm planning to make which I do at the same time as moving to cmp (namely, I'm pretty sure we don't need to be touching some of the headers)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure

@G-Rath G-Rath force-pushed the test/format-request-body branch from 5e2ca58 to 87dd406 Compare December 5, 2025 02:22
@G-Rath G-Rath requested a review from another-rex December 5, 2025 02:23
@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.75%. Comparing base (348b48c) to head (87dd406).

Files with missing lines Patch % Lines
cmd/osv-scanner/internal/testcmd/vcr.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2393      +/-   ##
==========================================
- Coverage   67.84%   67.75%   -0.10%     
==========================================
  Files         172      172              
  Lines       13282    13291       +9     
==========================================
- Hits         9011     9005       -6     
- Misses       3565     3581      +16     
+ Partials      706      705       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@another-rex another-rex merged commit c82c9c9 into google:main Dec 5, 2025
16 checks passed
@another-rex another-rex deleted the test/format-request-body branch December 5, 2025 03:11
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