refactor: organize tests, add mock infra, update env example#74
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis update introduces environment configuration for mock and blockchain modes, a mock booking contract for testing, and comprehensive test scripts for API and Docker. The booking contract now conditionally uses a mock based on an environment variable. Documentation and ignore files are updated, and new integration and validation tests are added for backend robustness. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API
participant BookingContract
participant MockBookingContract
Client->>API: Request booking availability (propertyId, from, to)
API->>API: Check USE_MOCK env variable
alt USE_MOCK=true
API->>MockBookingContract: checkBookingAvailability(propertyId, from, to)
MockBookingContract-->>API: availability (boolean)
else USE_MOCK=false
API->>BookingContract: checkBookingAvailability(propertyId, from, to)
BookingContract->>Blockchain: Simulate contract call
Blockchain-->>BookingContract: Result (boolean)
BookingContract-->>API: availability (boolean)
end
API-->>Client: Return availability (boolean)
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (13)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Pull Request | StellarRent
📝 Summary
Provide a brief description of what this PR accomplishes.
🔗 Related Issues
Closes #(issue number) (Replace with the actual issue number).
🔄 Changes Made
Provide a general description of the changes. Include any relevant background information or context to help reviewers understand the purpose of this PR.
🖼️ Current Output
Provide visual evidence of the changes:
🧪 Testing
If applicable, describe the tests performed. Include screenshots, test outputs, or any resources that help reviewers understand how the changes were tested.
✅ Testing Checklist
List any possible issues that might arise with this change.
🚀 Next Steps & Improvements
This change lays a solid foundation for further optimizations. Some areas that could benefit from future improvements include:
💬 Comments
Any additional context, questions, or considerations for reviewers.
Summary by CodeRabbit
New Features
Bug Fixes
Chores
.gitignoreto exclude additional development tool files.Tests
Documentation