Skip to content

test: migrate account deletion sync tests to testcontainers#34091

Merged
asukaminato0721 merged 2 commits intolanggenius:mainfrom
YB0y:test/migrate-account-deletion-sync-tests-to-testcontainers
Mar 25, 2026
Merged

test: migrate account deletion sync tests to testcontainers#34091
asukaminato0721 merged 2 commits intolanggenius:mainfrom
YB0y:test/migrate-account-deletion-sync-tests-to-testcontainers

Conversation

@YB0y
Copy link
Copy Markdown
Contributor

@YB0y YB0y commented Mar 25, 2026

Summary

Migrate tests from api/tests/unit_tests/services/enterprise/test_account_deletion_sync.py
to testcontainers integration tests at
api/tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py.

All 11 tests migrated. DB-dependent tests (sync_account_deletion with multiple workspaces, no workspaces, partial/all failures) now use real PostgreSQL with TenantAccountJoin records instead of mocking db.session. The _queue_task success test uses real Redis to verify task payload. Redis error/type error tests and dify_config.ENTERPRISE_ENABLED remain mocked. Deleted the unit test file.

Part of #32454

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues.
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint and make type-check (backend) and cd web && npx lint-staged (frontend) to appease the lint gods

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

No changes detected.

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

No changes detected.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Mar 25, 2026
@asukaminato0721 asukaminato0721 merged commit 87a25e3 into langgenius:main Mar 25, 2026
14 checks passed
@asukaminato0721
Copy link
Copy Markdown
Contributor

you can run ruff check --fix to speed up the ci.

GareArc pushed a commit that referenced this pull request Mar 25, 2026
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
@YB0y YB0y deleted the test/migrate-account-deletion-sync-tests-to-testcontainers branch April 1, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants