Skip to content

test: unit tests for fsProvider, s3Provider, tileDeletionStrategy(MAPCO-9806)#25

Merged
almog8k merged 5 commits into
feat/fs-s3-integrationfrom
test/deletion-strategy
May 13, 2026
Merged

test: unit tests for fsProvider, s3Provider, tileDeletionStrategy(MAPCO-9806)#25
almog8k merged 5 commits into
feat/fs-s3-integrationfrom
test/deletion-strategy

Conversation

@almog8k
Copy link
Copy Markdown
Collaborator

@almog8k almog8k commented May 12, 2026

Question Answer
Tests added

New and Improved Unit Tests:

  • Added a full test suite for FsStorageProvider, covering file deletion, directory cleanup, and existence checks, including error scenarios and edge cases.
  • Added a full test suite for S3StorageProvider, covering object deletion (including batching, error handling, and S3-specific behaviors), prefix existence checks, and client construction.

Test Helpers and Mocks:

  • Enhanced tests/helpers/mocks.ts with new mock creators for storage providers, S3 config, and strategy config, and added a mock implementation for updateProgress on the queue client. [1] [2] [3]

Test Infrastructure Improvements:

  • Updated strategyFactory.spec.ts to use the new mock config, queue client, and storage providers, improving test isolation and reliability. [1] [2]

Minor Implementation Improvements:

  • Improved error handling in FsStorageProvider.delete to ensure failed paths are correctly reported for all error types.
  • Cleaned up unused constants and imports in S3StorageProvider.

@almog8k almog8k changed the title test: unit tests for fsProvider, s3Provider, tileDeletionStrategy test: unit tests for fsProvider, s3Provider, tileDeletionStrategy(MAPCO-9806) May 12, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

🎫 Related Jira Issue: MAPCO-9806

Comment thread tests/storageProviders/fsStorageProvider.spec.ts Outdated
Comment thread tests/storageProviders/fsStorageProvider.spec.ts Outdated
Comment thread tests/storageProviders/fsStorageProvider.spec.ts Outdated
Comment thread tests/storageProviders/fsStorageProvider.spec.ts
Comment thread tests/storageProviders/fsStorageProvider.spec.ts Outdated
Comment thread tests/storageProviders/fsStorageProvider.spec.ts
@almog8k almog8k merged commit 2ac9b1a into feat/fs-s3-integration May 13, 2026
6 checks passed
almog8k added a commit that referenced this pull request May 13, 2026
* feat: add AWS SDK S3 client and new storage provider constant

- Added "@aws-sdk/client-s3" dependency to package.json for S3 interactions.
- Introduced STORAGE_PROVIDERS constant in constants.ts for future storage provider implementations.

* feat: integrate S3 storage provider with configuration updates

* feat: update tilesDeletion strategy configuration for S3 integration

* feat: tiles deletion strategy with S3 integration and validation schemas

Co-authored-by: Copilot <copilot@github.com>

* feat: register task context and update tiles deletion strategy for progress tracking

* feat: enhance file deletion process by adding cleanup of empty directories

* feat: improve logging level during S3 deletion and clean up unused type imports

Co-authored-by: Copilot <copilot@github.com>

* feat: integrate @map-colonies/raster-shared and update tiles deletion strategy

Co-authored-by: Copilot <copilot@github.com>

* feat: remove unused tiles deletion validation exports

* feat: update storage provider keys to use SourceType constants

Co-authored-by: Copilot <copilot@github.com>

* fix: correct file extension formatting in generateRangePaths method

* fix: replace console.debug with logger.debug in validateSchema function

* chore: update dependencies for mc-priority-queue and raster-shared

- upgraded @map-colonies/mc-priority-queue from ^9.0.2 to ^9.1.0
- upgraded @map-colonies/raster-shared from ^8.1.0-alpha.2 to ^8.1.0-alpha.3

* fix: pr issues

* feat: update js-logger to version 5.0.0 and switch schemas to commonWorkerBoilerplateV2

* feat: add opentelemetry options to logger configuration in JSON files

* feat: implement targetExists method for filesystem and S3 storage providers

Co-authored-by: Copilot <copilot@github.com>

* helm: deployment adjustments

* feat: update simulate-deletion script and Dockerfile for tile deletion testing

* feat: update @map-colonies/schemas dependency to version 1.20.0

* feat: update ConfigMap and Deployment templates for CA secret handling and logging configuration

* feat: count not found paths as failed paths

* feat: update metrics URL definition and refactor CA configuration in values.yaml

* feat: handle undefined values in failed paths during file deletion

* feat: integrate CA configuration into deployment and template rendering

* feat: add K8S_POD_UID environment variable to deployment

* feat: update log level key in configmap and values.yaml for consistency

* test: unit tests for fsProvider, s3Provider, tileDeletionStrategy(MAPCO-9806) (#25)

* test: unit tests for fsProvider, s3Provider, tileDeletionStrategy

* fix: correct mocked return value for stat in FsStorageProvider tests to be more readable

* Update tests/storageProviders/fsStorageProvider.spec.ts

Co-authored-by: Shlomi k <65117898+CL-SHLOMIKONCHA@users.noreply.github.com>

* test: improve clarity of targetExists test description and expectation

---------

Co-authored-by: Shlomi k <65117898+CL-SHLOMIKONCHA@users.noreply.github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Shlomi k <65117898+CL-SHLOMIKONCHA@users.noreply.github.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.

2 participants