Skip to content

Conversation

@rimanshu-SF
Copy link
Owner

📦 Overview

This PR introduces a complete testing and CI setup for the Book Management System (BMS) microservices architecture, including:

  • ✅ Unit tests for isolated components
  • ✅ Integration tests to validate inter-module communication
  • ✅ End-to-End (E2E) tests via the API Gateway
  • ✅ GitHub Actions CI pipeline to run all tests on every commit/PR

🧪 Testing Strategy

  • Unit Tests:

    • Each microservice contains its own unit tests using Mocha, Chai, and LoopBack 4's testing utilities.
  • Integration Tests:

    • Validate service-level operations (e.g., creating a book with a valid author/category).
    • Ensure services interact correctly with their repositories and controllers.
  • E2E Tests (API Gateway):

    • Simulate full user flow: create author, category, book via the gateway.
    • Uses supertest with mock JWT tokens for protected routes.

⚙️ GitHub Actions

  • A new workflow (.github/workflows/e2e.yml) is added to:
    • Clone all microservices
    • Install dependencies
    • Start services in the background
    • Run E2E tests through the API Gateway

📌 Notes

  • Microservices are maintained in separate repositories.
  • All services assumed to run on separate ports.
  • DB interactions are mocked or use in-memory DBs.
  • Secrets and private repo tokens should be configured for full CI coverage.

✅ Checklist

  • Unit tests added
  • Integration tests added
  • E2E tests implemented via gateway
  • GitHub Actions workflow tested and passing

@rimanshu-SF rimanshu-SF added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 10, 2025
@rimanshu-SF rimanshu-SF self-assigned this Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant