Skip to content

#feat unitary testing #47#48

Merged
Baptiste-Ferrand merged 10 commits into
developfrom
feat/unitary-testing#47
Aug 28, 2025
Merged

#feat unitary testing #47#48
Baptiste-Ferrand merged 10 commits into
developfrom
feat/unitary-testing#47

Conversation

@Baptiste-Ferrand
Copy link
Copy Markdown
Contributor

close #47

@changelog

🚀 Features

  • Full unit test coverage for domain layer:

    • ProfileService: unit tests for profile creation, update, deletion, login, roles, email, password management, and error handling.
    • GroupService: unit tests for group creation, deletion, member management (add/remove), group/member listing, and coach listing.
    • ExerciseService: unit tests for exercise creation, deletion, update, owner and global listing, and error handling.
    • TrainingService: unit tests for training creation, deletion, update, task management (create/update/delete/list), validation management, and all relevant error cases.
    • DietService: unit tests for diet creation, update, deletion, listing, macro plan and meal plan CRUD, as well as robust error and input handling.
    • BcryptPasswordHasher: comprehensive tests for password hashing and verification, including edge cases, invalid hashes, special/unicode characters, and long passwords.
  • New CI/CD GitHub Actions pipeline:

    • Split jobs for clarity and speed:
      • unit-tests: runs all domain and lib unit tests with coverage reporting.
      • integration-tests: runs all API integration tests (with Uvicorn server startup).
    • Explicit job naming for easier understanding and log analysis.
    • Separate pip cache keys for each test type to optimize build speed.
    • Summary step at the end of each job for quick feedback.
    • Integration tests only run if unit tests pass (job dependency).

🛠️ Files Added/Modified

  • src/domain/tests/test_profile_service.py
  • src/domain/tests/test_group_service.py
  • src/domain/tests/test_exercise_service.py
  • src/domain/tests/test_training_service.py
  • src/domain/tests/test_diet_service.py
  • src/domain/tests/test_bcrypt_password_hasher.py
  • .github/workflows/tests.yml (refactored CI/CD pipeline)

🧪 Test/CI Coverage

  • Strict verification of all business logic and error cases
  • Robustness against integration errors (hashing, mocks, dependencies, API)
  • Security coverage for sensitive operations (password hashing/verification)
  • Automated unit and integration tests on every Pull Request

Check GitHub Actions logs for detailed test outcomes and coverage reports!

@Baptiste-Ferrand Baptiste-Ferrand self-assigned this Aug 28, 2025
@Baptiste-Ferrand Baptiste-Ferrand added the enhancement New feature or request label Aug 28, 2025
@Baptiste-Ferrand Baptiste-Ferrand merged commit b199e69 into develop Aug 28, 2025
3 checks passed
@github-project-automation github-project-automation Bot moved this from To triage to Done in @Baptiste-Ferrand's BackLogs Aug 28, 2025
@Baptiste-Ferrand Baptiste-Ferrand deleted the feat/unitary-testing#47 branch August 28, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Test unitaires

1 participant