Skip to content

Convert and mark some more superuser -> staff tests #107803

Open
michelletran-sentry wants to merge 1 commit intomasterfrom
feat/convert-superuser-tests-to-staff
Open

Convert and mark some more superuser -> staff tests #107803
michelletran-sentry wants to merge 1 commit intomasterfrom
feat/convert-superuser-tests-to-staff

Conversation

@michelletran-sentry
Copy link
Contributor

@michelletran-sentry michelletran-sentry commented Feb 6, 2026

Similar to #107368, where I'm trying to convert and mark tests that depends on superusers who should be migrated to staff. This ensures all tests work with staff.ga-rollout=True while maintaining test coverage during the transition. Superuser tests in duplicate pairs can be easily identified and removed later. This is part of the effort to remove the staff.ga-rollout flag and migrate to staff-only mode.

Changes:

  • Converted 5 superuser-only tests to staff in test_sentry_app_details.py:
    • test_staff_can_set_publish_request_inprogress_status
    • test_staff_delete_unpublished_app
    • test_staff_delete_unpublished_app_with_installs
    • test_staff_cannot_delete_published_app
    • test_staff_cannot_delete_partner_apps
  • Converted 1 superuser-only test to staff in test_sentry_apps_stats.py:
    • test_per_page
  • Updated DeleteSentryAppDetailsTest setUp to use staff user by default:
    • Creates staff user as org member in setUp
    • Logs in as staff instead of superuser
    • Simplifies individual test methods (no repeated membership creation)
  • Added decorators to ALL tests (47 total):
    • False decorator on superuser tests in duplicate pairs
    • True decorator on all other tests (staff and general tests)

@michelletran-sentry michelletran-sentry changed the title test(staff): Convert superuser-only tests to staff tests - Batch 9 Convert and mark some more superuser -> staff tests Feb 6, 2026
Converts 6 superuser-only tests (where no staff equivalent exists) to use staff mode
and adds @override_options({"staff.ga-rollout": False/True}) decorators to all tests
to ensure compatibility with staff mode.

Changes:
- Converted 5 superuser-only tests to staff in test_sentry_app_details.py:
  - test_staff_can_set_publish_request_inprogress_status
  - test_staff_delete_unpublished_app
  - test_staff_delete_unpublished_app_with_installs
  - test_staff_cannot_delete_published_app
  - test_staff_cannot_delete_partner_apps
- Converted 1 superuser-only test to staff in test_sentry_apps_stats.py:
  - test_per_page
- Updated DeleteSentryAppDetailsTest setUp to use staff user by default:
  - Creates staff user as org member in setUp
  - Logs in as staff instead of superuser
  - Simplifies individual test methods (no repeated membership creation)
- Added decorators to ALL tests (47 total):
  - False decorator on superuser tests in duplicate pairs
  - True decorator on all other tests (staff and general tests)

This ensures all tests work with staff.ga-rollout=True while maintaining test
coverage during the transition. Superuser tests in duplicate pairs can be easily
identified and removed in Phase 2.

Part of the effort to remove the staff.ga-rollout flag and migrate to staff-only mode.

Co-Authored-By: Claude <noreply@anthropic.com>
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