Skip to content

feat : test coverage for utils functions - #35

Merged
RambokDev merged 13 commits into
mainfrom
feat/test-coverage-utils-func
Mar 12, 2026
Merged

feat : test coverage for utils functions#35
RambokDev merged 13 commits into
mainfrom
feat/test-coverage-utils-func

Conversation

@RambokDev

@RambokDev RambokDev commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Tests

    • Added comprehensive test coverage for PostgreSQL connectivity, compression utilities, configuration deserialization, and edge key handling
  • Chores

    • Updated dependencies to include test infrastructure (tokio, testcontainers, mockall)
    • Improved local development setup with automated Docker environment validation and startup script

@coderabbitai

coderabbitai Bot commented Mar 12, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The pull request introduces comprehensive testing infrastructure and development tooling. Changes include adding test dependencies (tokio, mockall, testcontainers, wiremock, postgres), removing async-http-client, enabling Docker Compose volumes and networking for Postgres, adding a development entrypoint script with Docker/network initialization checks, exposing utility helper functions, and creating test modules covering compression, deserialization, edge key decoding, cron normalization, and database connectivity.

Changes

Cohort / File(s) Summary
Dependency Management
Cargo.toml
Added dev-dependencies for testing (tokio, mockall, testcontainers, wiremock) and production dependencies for Postgres integration (testcontainers-modules, postgres); removed async-http-client.
Docker Infrastructure
Makefile, docker-compose.yml, docker/entrypoints/app-dev-entrypoint.sh
Added Makefile target up pointing to new entrypoint script; uncommented cargo-target volume mapping and cargo-registry volume in compose; added localhost host-gateway mapping and updated EDGE_KEY token; created new bash entrypoint with Docker daemon startup checks (platform-specific), network creation, and docker-compose orchestration.
Test Module Wiring
src/main.rs, src/tests/mod.rs, src/tests/domain/mod.rs, src/tests/utils/mod.rs
Added test-only module declarations to enable test scaffolding and organize test suites under utils and domain namespaces.
Database Connectivity Tests
src/tests/domain/postgres.rs
Created async test using testcontainers to spin up Postgres container, configure DatabaseFactory, and verify database ping connectivity.
Utility Function Tests
src/tests/utils/normalize_cron_tests.rs, src/tests/utils/common_tests.rs, src/tests/utils/compress_tests.rs, src/tests/utils/deserializer.rs, src/tests/utils/edge_key_tests.rs
Added five test modules covering cron normalization validation, backup method/JSON conversion, async compression/decompression workflows, snake_case deserialization, and edge key Base64 decoding with error cases.
Utility Function Exposure
src/utils/deserializer.rs, src/utils/compress.rs
Exposed to_snake_case and camel_to_snake as public functions; removed commented-out code line.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~23 minutes

Possibly related PRs

  • Fix/refactoring #22: Modifies docker-compose configuration (EDGE_KEY, volumes, networking) and introduces Postgres-related dev infrastructure alongside test scaffolding.

Poem

🐰 whiskers twitching with joy
Docker dances and networks align,
Tests bloom in rows, testcontainers divine,
Postgres connected, compression refined—
Development thrives, infrastructure's design! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat : test coverage for utils functions' directly and accurately summarizes the main change—adding comprehensive test coverage for utility functions throughout the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 82.76% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/test-coverage-utils-func
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can validate your CodeRabbit configuration file in your editor.

If your editor has YAML language server, you can enable auto-completion and validation by adding # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

@RambokDev RambokDev changed the title feat : test coverage for util functions feat : test coverage for utils functions Mar 12, 2026
@RambokDev
RambokDev merged commit 7df9df1 into main Mar 12, 2026
1 check was pending
@RambokDev
RambokDev deleted the feat/test-coverage-utils-func branch March 12, 2026 18:40
This was referenced Mar 14, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Mar 22, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Mar 31, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Apr 29, 2026
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.

1 participant