Add unit tests for dataset service update and delete operations #20597

Closed
opened 2026-02-21 20:08:05 -05:00 by yindo · 0 comments
Owner

Originally created by @SmartDever02 on GitHub (Nov 26, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

We need comprehensive unit test coverage for additional dataset-related services and operations that are not yet covered by existing test suites.
Currently, we have extensive test coverage for dataset creation, retrieval, document CRUD, segment management, hit testing, external datasets, collection bindings, metadata, and controller APIs. However, several critical service methods and operations remain untested, including update/delete operations,.
This makes it harder to safely change or extend these functionalities (e.g., permission logic changes, status management updates, validation rule modifications, indexing optimizations) without risking regressions.

This issue proposes adding 10 new test suites for the following areas:

Dataset service — update/delete operations

  • update_dataset — update internal/external datasets
  • delete_dataset — dataset deletion with cascade checks

2. Additional context or comments

Each test suite should follow the existing patterns used for other service test files, including:

  • Comprehensive test coverage for all methods
  • Proper mocking of dependencies (database, Redis, external services)
  • Error condition testing
  • Edge case handling
  • Detailed documentation and comments
  • Test data factories for reusable mock objects

The tests should be organized into separate files as follows:
dataset_service_update_delete.py - Branch: feat/test-dataset-service-update-delete

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @SmartDever02 on GitHub (Nov 26, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. We need comprehensive unit test coverage for additional dataset-related services and operations that are not yet covered by existing test suites. Currently, we have extensive test coverage for dataset creation, retrieval, document CRUD, segment management, hit testing, external datasets, collection bindings, metadata, and controller APIs. However, several critical service methods and operations remain untested, including update/delete operations,. This makes it harder to safely change or extend these functionalities (e.g., permission logic changes, status management updates, validation rule modifications, indexing optimizations) without risking regressions. This issue proposes adding 10 new test suites for the following areas: **Dataset service — update/delete operations** - `update_dataset` — update internal/external datasets - `delete_dataset` — dataset deletion with cascade checks ### 2. Additional context or comments Each test suite should follow the existing patterns used for other service test files, including: - Comprehensive test coverage for all methods - Proper mocking of dependencies (database, Redis, external services) - Error condition testing - Edge case handling - Detailed documentation and comments - Test data factories for reusable mock objects The tests should be organized into separate files as follows: `dataset_service_update_delete.py` - Branch: `feat/test-dataset-service-update-delete` ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 20:08:05 -05:00
yindo closed this issue 2026-02-21 20:08:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20597