You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: add coverage for bypass_modes in rulesets (#2802)
Add test coverage for all three bypass_modes (always, pull_request,
exempt) for both repository and organization rulesets.
Repository Ruleset Tests (resource_github_repository_ruleset_test.go):
- Add test for all three bypass_modes with Team actors
- Add test for updating bypass_mode (always → exempt)
- Add test for different actor types with different bypass_modes
(Team/always, RepositoryRole/pull_request, OrganizationAdmin/exempt)
Organization Ruleset Tests (resource_github_organization_ruleset_test.go):
- Fix existing "Creates and updates organization using bypasses" test:
* Move bypass_actors from incorrect location (inside rules) to correct
location (at ruleset level)
* Add missing bypass_mode assertions
* Fix incorrect actor_type assertions (was checking for "0", "5" instead
of actual actor type strings)
* Correct OrganizationAdmin actor_id from 0 to 1
- Add test for all three bypass_modes
- Add test for updating bypass_mode
All tests now verify:
- actor_id (both dynamic Team IDs and static role IDs)
- actor_type (Team, RepositoryRole, OrganizationAdmin, DeployKey)
- bypass_mode (always, pull_request, exempt)
This addresses the review comment from PR #2764 requesting test coverage
for bypass_modes, including the newly added "exempt" mode.
Fixes: #2764 (review)
Co-authored-by: Nick Floyd <[email protected]>
0 commit comments