Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: migrate utils to common module and reorganize test structure #11

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

shiningflash
Copy link
Owner

Overview

This pull request implements significant improvements to the repository structure, enhancing clarity, maintainability, and scalability.

Changes

  1. Migration to Common Module:

    • Moved all utilities from src/sdk/utils/ to src/common/.
    • Updated imports across the repository to reflect the new structure.
    • Centralized utility files like exceptions.py, logger.py, validators.py, retry.py, and requests.py under src/common/.
  2. Test Structure Reorganization:

    • Grouped tests by type (unit, integration, e2e) and module (sdk, server).
    • Created separate directories for SDK and server tests within unit and integration.
    • Simplified navigation and module-specific test execution.
  3. Improved Flexibility and Readability:

    • Centralized shared configurations in conftest.py.
    • Removed redundant __init__.py files from test directories.
    • Enhanced test discoverability and modularity.

Benefits

  • The common module promotes code reuse and reduces duplication across SDK and server modules.
  • Refactored test structure enhances maintainability and scalability.
  • Aligned repository structure with industry best practices.

Next Steps

  • Review the new structure and suggest improvements.
  • Validate that all tests pass successfully with the new module paths.

- Grouped tests by type (unit, integration, e2e) and module (sdk, server).
- Renamed directories for better readability and alignment with best practices.
- Removed unnecessary __init__.py files from test directories.
- Centralized shared test configurations in conftest.py for reusability.
- Improved flexibility for running module-specific and type-specific tests.

This refactor enhances maintainability, simplifies navigation, and prepares the test suite for future expansion.
Copy link

github-actions bot commented Dec 5, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/common
   __init__.py00100% 
   exceptions.py5299 83%
   logger.py220100% 
   requests.py1544 73%
   retry.py2111 95%
   validators.py6222 97%
src/sdk
   __init__.py00100% 
   client.py390100% 
src/sdk/features
   __init__.py00100% 
   contacts.py380100% 
   messages.py3022 93%
src/sdk/schemas
   __init__.py00100% 
   contacts.py2633 88%
   messages.py2722 93%
src/server
   __init__.py00100% 
   app.py2533 88%
   schemas.py80100% 
TOTAL3652693% 

Tests Skipped Failures Errors Time
56 0 💤 0 ❌ 0 🔥 6.813s ⏱️

@shiningflash shiningflash merged commit c8eef52 into develop Dec 5, 2024
1 check passed
@shiningflash shiningflash deleted the refactoring branch December 6, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant