Skip to content

chore: Add Dependabot alert marshal tests#4251

Open
KirtiRamchandani wants to merge 1 commit into
google:masterfrom
KirtiRamchandani:test/dependabot-alerts-marshal
Open

chore: Add Dependabot alert marshal tests#4251
KirtiRamchandani wants to merge 1 commit into
google:masterfrom
KirtiRamchandani:test/dependabot-alerts-marshal

Conversation

@KirtiRamchandani
Copy link
Copy Markdown

Problem

  • Issue add tests for resource JSON marshalling #55 tracks missing JSON marshal test coverage for exported structs.
  • The Dependabot alert models covered service behavior, but AdvisoryEPSS, DependabotAlert, and DependabotAlertState did not have direct marshal round-trip tests.

Root cause

  • These structs were added/expanded without corresponding testJSONMarshal coverage.

Solution

  • Add JSON marshal/unmarshal round-trip tests for AdvisoryEPSS, DependabotAlert, and DependabotAlertState.
  • Cover nested advisory, vulnerability, dismissal, timestamp, user, and repository fields on DependabotAlert.

Tests run

  • gofmt -w github/dependabot_alerts_test.go
  • go test ./github -run 'Test(AdvisoryEPSS|DependabotAlert|DependabotAlertState)_Marshal'
  • go test ./github
  • go test ./...
  • git diff --check

Updates #55

@gmlewis gmlewis changed the title Add Dependabot alert marshal tests chore: Add Dependabot alert marshal tests May 26, 2026
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label May 26, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.48%. Comparing base (c207b27) to head (cf662e0).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4251   +/-   ##
=======================================
  Coverage   97.48%   97.48%           
=======================================
  Files         190      190           
  Lines       19178    19178           
=======================================
  Hits        18695    18695           
  Misses        268      268           
  Partials      215      215           

☔ 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.

Copy link
Copy Markdown
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @KirtiRamchandani!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants