feat: Add comprehensive unit tests for S3 datastore#34
Open
sumitvekariya wants to merge 2 commits intostoracha:mainfrom
Open
feat: Add comprehensive unit tests for S3 datastore#34sumitvekariya wants to merge 2 commits intostoracha:mainfrom
sumitvekariya wants to merge 2 commits intostoracha:mainfrom
Conversation
- Add complete test suite with 14 test functions covering all datastore operations - Tests include CRUD operations, query functionality, batch operations, and concurrent access - Use MinIO testcontainers for realistic S3 testing environment - Cover edge cases: special characters, path transformation, error handling - Add context cancellation and timeout testing - Verify interface compliance with go-datastore.Datastore and go-datastore.Batching - All tests pass successfully with ~73s execution time Test coverage includes: - Basic operations: Put, Get, Has, GetSize, Delete - Query operations: prefix filtering, keys-only mode, unsupported filters - Batch operations: small batches, large batches (50+ operations), mixed operations - Concurrency: 10 goroutines with 100 total operations - Edge cases: path transformation, special characters, deep nesting - Error handling: context cancellation, timeouts, not-found scenarios - Resource management: Sync and Close operations
- Fix batch delete to use s3Path() for proper root directory handling - Ensures batch delete operations work correctly with RootDirectory configuration - Fixes inconsistency where individual operations used s3Path() but batch delete did not This ensures that when using a root directory configuration, batch delete operations will correctly prefix the S3 keys with the root directory path, maintaining consistency with other datastore operations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test coverage includes:
Closes #24