-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitAuto: [FEATURE] Add Integration Tests project with WireMock fixture #354
GitAuto: [FEATURE] Add Integration Tests project with WireMock fixture #354
Conversation
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
Committed the Check Run |
Committed the Check Run |
Infisical secrets check: ✅ No secrets leaked! 💻 Scan logs12:11AM INF scanning for exposed secrets...
12:11AM INF 529 commits scanned.
12:11AM INF scan completed in 301ms
12:11AM INF no leaks found
|
❌ Build VTEX-SDK-dotnet 2.3.1579 failed (commit 17938f3413 by @gitauto-ai[bot]) |
Resolves #173
What is the feature
Add comprehensive integration tests for the C# integration library that interacts with the VTEX HTTP REST API. This includes setting up a testing project using XUnit, WireMock for simulating HTTP responses, Snapshooter for snapshot testing, NSubstitute for mocking dependencies, and Bogus for generating realistic fake data.
Why we need the feature
Currently, the integration testing coverage for the HTTP ERP service is insufficient, posing a risk of undetected issues in the library's interactions with the ERP service. Without proper integration tests, bugs and unreliable behavior may go unnoticed in production, affecting the reliability and stability of the application.
How to implement and why
Set Up Integration Tests:
Tests
directory if it doesn't exist.Configure WireMock for Fake HTTP Requests:
Implement Snapshot Testing with Snapshooter:
Generate Realistic Test Data with Bogus:
Mock Dependencies with NSubstitute:
Run and Validate Tests:
This step-by-step approach ensures that the integration library is thoroughly tested against various scenarios, improving reliability and reducing the likelihood of production issues.
About backward compatibility
Adding integration tests does not introduce any changes to the existing library's functionality or public interfaces. Therefore, there are no concerns regarding backward compatibility. The tests enhance the development process by providing better coverage without affecting existing consumers of the library.
Test these changes locally