-
Notifications
You must be signed in to change notification settings - Fork 321
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
chore: add mock reporting server in mtu integration tests #4894
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4894 +/- ##
==========================================
+ Coverage 74.37% 74.44% +0.06%
==========================================
Files 427 428 +1
Lines 49661 49737 +76
==========================================
+ Hits 36935 37026 +91
+ Misses 10286 10276 -10
+ Partials 2440 2435 -5 ☔ View full report in Codecov by Sentry. |
integration_test/trackedusersreporting/tracked_users_reporting_test.go
Outdated
Show resolved
Hide resolved
@@ -292,6 +360,8 @@ func sendEvents( | |||
return 0, fmt.Errorf("failed to send event to rudder server, status code: %d: %s", resp.StatusCode, string(b)) | |||
} | |||
kithttputil.CloseResponse(resp) | |||
// sleeping so that multiple requests can be sent to reporting | |||
time.Sleep(time.Duration(rand.Intn(1000)) * time.Millisecond) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid this sleep in favour of another signal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increased number of events and decreased processor batch size so that multiple processor batches will be processed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
require.Eventuallyf(t, func() bool { | ||
cardinalityMap := tc.reportingServer.getCardinalityFromReportingServer() | ||
return cardinalityMap[workspaceID][sourceID].userIDCount == 2 && | ||
cardinalityMap[workspaceID][sourceID].anonIDCount == 2 && | ||
cardinalityMap[workspaceID][sourceID].identifiedUsersCount == 2 | ||
}, 1*time.Minute, 5*time.Second, "data not reported to reporting service, hllMap: %v", tc.reportingServer.hllMap) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also check that the tracked_users_reports
table is empty here. The cardinality condition might be true even if not all reports are flushed.
Description
Add mock reporting server in MTU integration tests where currently we are reading from DB and validating. We need to add a mock reporting server to record the requests and aggregate HLLs and see if correct data is showing up.
Linear Ticket
https://linear.app/rudderstack/issue/PIPE-1300/add-mock-reporting-server-in-mtu-integration-tests
Security