ThisaraWeerakoon opened a new pull request, #16:
URL: https://github.com/apache/synapse-go/pull/16

   ## Description
   This PR introduces an end-to-end (E2E) testing suite for the current 
implementation. While the existing unit tests cover basic functionality, the 
codebase currently lacks component-level integration testing for key features 
like the File Inbound and Call Mediator, as well as full E2E testing for the 
Synapse server. This PR addresses that gap by adding targeted integration tests 
and E2E scenarios to ensure robustness and reliability.
   
   Additionally, this PR includes shared test utilities that can be reused by 
future developers to simplify writing new tests. I've used build tags to 
separate unit, integration, and E2E tests, and adopted a co-located approach 
for organizing test files alongside the relevant implementation code.
   
   ## Key Changes
   The main additions in this PR are summarized below:
   
   1. **Call Mediator Tests**  
      **Purpose:** Tests HTTP endpoint integration with real network 
operations.  
      **Coverage:**  
      - HTTP method validation (GET, POST, PUT, DELETE)  
      - Concurrent request handling (10 simultaneous calls)  
      - Error scenario testing with actual server responses  
      - Timeout and performance validation  
   
   2. **File Inbound Tests**  
      **Purpose:** Component-level file processing integration.  
      **Coverage:**  
      - JSON/XML file processing with real file operations  
      - Concurrent file handling validation  
      - Error handling for malformed data  
      - Message context integration  
   
   3. **Shared Test Utilities**  
      **Purpose:** Reusable test components and mocks.  
      **Features:**  
      - Mock HTTP servers and test data generators  
      - Performance timing utilities  
      - JSON validation helpers  
      - Test context builders  
   
   4. **Synapse Application E2E Tests**  
      **Purpose:** End-to-end application lifecycle testing.  
      **Coverage:**  
      - Application startup/shutdown simulation  
      - Configuration validation and error handling  
      - Concurrent operations testing  
      - Graceful shutdown scenarios  
   
   ## Testing Instructions
   - Run unit tests: `go test ./...` (excludes integration/E2E via build tags)  
   - Run integration tests: `go test -tags=integration ./...`  
   - Run E2E tests: `go test -tags=e2e ./...`  
   - All tests should pass without external dependencies (mocks are 
self-contained).  
   
   This PR improves test coverage and maintainability without introducing 
breaking changes to the core functionality. Feedback welcome!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to