Add Compose-driven cross-service integration tests for the Order → Product → Notification flow - #85
Open
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
src/Tests/IntegrationTests— an xUnit suite that drives the running services over HTTP — plus asrc/docker-compose.test.ymloverlay that runs it as a container on the compose network after polling each dependency's/healthz:Base URLs come from
ORDER_URL/PRODUCT_URL/NOTIFICATION_URL(localhost defaults), so the same suite runs locally against an already-up stack.The requested flow is only partially executable today.
Order,ProductandCustomerare still scaffolds — GET-only stub controllers returning{"status":"scaffold"}, emptyDomain/Entities,OnModelCreatingTODOs, no POST endpoints, no product-existence validation, noOrderPlacedEventpublishing. So the suite is split:NotificationFlowTests— live and green:POST /api/notification/events/order-placedingestion, persistedOrderId/CustomerId/OrderTotal, retrieval by id, HTML preview, unknown-id 404, invalid-guid 400, and the current (surprising)201for{}with default values.OrderProductNotificationFlowContractTests— the five requested steps written as complete, compiling tests, each[Fact(Skip = "…")]naming the exact missing capability. They are one implementation away from running. Assumed contracts (documented in the class doc and README):POST /api/product {name, description, price} → {id},POST /api/order {customerId, items:[{productId, quantity}]} → {id, customerId, totalAmount}, order publishes the existingShared.Contracts.Events.OrderPlacedEvent.ScaffoldGapTests— asserts the create endpoints are still405and the GETs still return the scaffold marker, so implementing the services makes these fail loudly; delete them at that point.Two defects surfaced and are not fixed here:
NotificationRenderer.FormatCurrencytreats the posted decimal as cents and formats with the process culture, sototalAmount: 42.50renders as¤0.43. The correct expectation is captured as a skipped test./api/orders) and its transforms strip the prefix into paths no controller matches, so every gateway route 404s.Also required to make the stack buildable at all: every
*.API.csprojreferenced Shared as..\..\Shared\…(one level short), which brokeNotification.API's build and silently emittedMSB9008for the rest.Verified: all six entrypoints build clean; suite passes locally and via compose (10 passed, 6 skipped);
dotnet format --verify-no-changesclean on the new project.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/b51ebf5228cc4f7ea6897107047dd477
Requested by: @sumitshatwara