Skip to content

test: cover actions permission JSON marshalling#4250

Open
KirtiRamchandani wants to merge 1 commit into
google:masterfrom
KirtiRamchandani:test/actions-permissions-marshal
Open

test: cover actions permission JSON marshalling#4250
KirtiRamchandani wants to merge 1 commit into
google:masterfrom
KirtiRamchandani:test/actions-permissions-marshal

Conversation

@KirtiRamchandani
Copy link
Copy Markdown

Problem

Issue #55 tracks adding JSON marshal coverage for public resource types that implement String().

Root cause

Several Actions permission-related response types had String() implementations but no matching marshal tests, leaving their JSON field names and omitted-empty behavior uncovered.

Solution

Add marshal tests for the remaining Actions permission and retention structs in the existing test files:

  • ArtifactPeriod
  • ActionsPermissionsEnterprise
  • SelfHostRunnerPermissionsEnterprise
  • SelfHostedRunnersSettingsOrganization
  • WorkflowsPermissions
  • ContributorApprovalPermissions

Tests

  • go test ./github -run 'Test(ArtifactPeriod|ActionsPermissionsEnterprise|SelfHostRunnerPermissionsEnterprise|SelfHostedRunnersSettingsOrganization|WorkflowsPermissions|ContributorApprovalPermissions)_Marshal'
  • go test ./github
  • go test ./...
  • git diff --check

Fixes part of #55.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4250   +/-   ##
=======================================
  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.

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.

1 participant