Skip to content

SEP-1885: Migrate the test suite off SettingClassEnum members as setting_class values so the column can be a plain string - #1430

Merged
peter-o-addo merged 13 commits into
mainfrom
SEP-1885
Sep 3, 2026
Merged

SEP-1885: Migrate the test suite off SettingClassEnum members as setting_class values so the column can be a plain string#1430
peter-o-addo merged 13 commits into
mainfrom
SEP-1885

Conversation

@peter-o-addo

@peter-o-addo peter-o-addo commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrate settings-override tests off SettingClassEnum for SettingOverride.setting_class, using setting_class_token() (and shared conftest constants) for DB rows and SettingsCls.__name__ for proxy/API setting_class args.

  • tests/app/core/settings_override/conftest.py: add shared *_SETTINGS_TOKEN / SETTINGS_TOKEN constants via setting_class_token()
  • tests/app/core/settings_override/test_{cache,manager,lifecycle,policy_gates,registry}.py, api/test_policy_lockdown.py: write/filter override rows with those tokens instead of SettingClassEnum
  • tests/app/core/settings_override/test_{lifecycle,worker,registry_nested}.py, api/test_registry_helpers.py: pass XxxSettings.__name__ to OverridableSettingsProxy / _settings_response_from_field
  • tests/app/sep/test_settings_override_{integration,worker}.py, api/routes/test_settings.py, apps/atw/test_send.py, test_proxy_routes_with_override.py: same token/__name__ migration (helpers typed on settings class where used)
  • tests/app/tasks/test_{celery_settings_override,settings_override_integration}.py, settings/test_routes.py, tests/app/inventory/test_settings_routes.py: same for Tasks/Inventory override fixtures and filters
  • Tests only; no production app/ changes; existing suites still pass with no assertion rewrites beyond the token/__name__ swap

Tested

  • All 18 test modules touched by the setting_class_token migration PR (585 tests, 0 added/removed).

Checklist

  • New/modified functions have type hints and rST docstrings
  • New tests added for new features or bug fixes
  • All tests pass locally (make test)
  • Pre-commit hooks pass (make run-pre-commit)
  • Database migrations generated if models changed (make makemigrations)
  • User-facing changes documented (README, inline help, UI text)
  • Configuration changes documented with examples
  • Changelog fragment added under changelog.d/ if the change is user-facing (make changelog-add), or confirmed N/A (internal-only change, or a same-release-cycle fix for an unreleased sibling ticket)

@github-actions github-actions Bot added python app:atw PR touches the atw app slice labels Aug 31, 2026
@peter-o-addo
peter-o-addo marked this pull request as ready for review August 31, 2026 17:10
Copilot AI balanced review requested due to automatic review settings August 31, 2026 17:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The migration is consistent with the storage and API contracts; only minor docstring updates remain.

Pull request overview

This test-only PR consistently separates database storage tokens from proxy/API class-name identifiers.

Changes:

  • Replaces enum-backed database values and filters with derived storage tokens.
  • Uses settings-class __name__ values for proxy/API identifiers.
  • Centralizes common test tokens in shared configuration.
File summaries
File Description
tests/app/tasks/test_settings_override_integration.py Uses the Tasks storage token.
tests/app/tasks/test_celery_settings_override.py Updates Tasks and Anonymizer row seeding.
tests/app/tasks/settings/test_routes.py Filters persisted rows by storage token.
tests/app/sep/test_settings_override_worker.py Derives tokens from settings classes.
tests/app/sep/test_settings_override_integration.py Updates SEP and Snippets rows.
tests/app/sep/test_proxy_routes_with_override.py Derives proxy-route test tokens.
tests/app/sep/apps/atw/test_send.py Uses the SEP storage token.
tests/app/sep/api/routes/test_settings.py Updates settings API row filters.
tests/app/inventory/test_settings_routes.py Uses the Inventory storage token.
tests/app/core/settings_override/test_worker.py Uses class names for proxies.
tests/app/core/settings_override/test_registry.py Updates registry row identifiers.
tests/app/core/settings_override/test_registry_nested.py Uses class names in nested helpers.
tests/app/core/settings_override/test_policy_gates.py Updates policy test row tokens.
tests/app/core/settings_override/test_manager.py Exercises plain-string manager values.
tests/app/core/settings_override/test_lifecycle.py Separates proxy names from row tokens.
tests/app/core/settings_override/test_cache.py Updates snapshot fixture tokens.
tests/app/core/settings_override/conftest.py Defines shared derived tokens.
tests/app/core/settings_override/api/test_registry_helpers.py Uses class-name API identifiers.
tests/app/core/settings_override/api/test_policy_lockdown.py Updates lockdown row tokens.
Review details
  • Files reviewed: 19/19 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/app/sep/test_settings_override_worker.py Outdated
Comment thread tests/app/sep/test_proxy_routes_with_override.py Outdated
@peter-o-addo

Copy link
Copy Markdown
Contributor Author

@copilot, please resolve your comments

@peter-o-addo peter-o-addo added the qa in progress Someone is currently testing this PR - do not merge it label Sep 1, 2026
@peter-o-addo

Copy link
Copy Markdown
Contributor Author

======================= 585 passed, 46 warnings in 8.44s =======================

@peter-o-addo peter-o-addo added qa passed Tests for this PR are completed and successful. and removed qa in progress Someone is currently testing this PR - do not merge it labels Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  app/core/settings_override
  models.py
Project Total  

This report was generated by python-coverage-comment-action

@peter-o-addo
peter-o-addo enabled auto-merge (squash) September 3, 2026 15:56
@peter-o-addo
peter-o-addo merged commit eb17427 into main Sep 3, 2026
18 checks passed
@peter-o-addo
peter-o-addo deleted the SEP-1885 branch September 3, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:atw PR touches the atw app slice python qa passed Tests for this PR are completed and successful.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants