-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Refactor FXIOS-11025 [Glean improvements] Refactor HomepageTelemetry to Use Glean Wrapper for Improved Testability 🚀 #24121
base: main
Are you sure you want to change the base?
Conversation
firefox-ios/firefox-ios-tests/Tests/ClientTests/Telemetry/HomepageTelemetryTests.swift
Outdated
Show resolved
Hide resolved
…eanWrapper for Event Recording
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.
Thanks for the change! HomepageTelemetry
looks great. We just miss to adjust the unit tests HomepageTelemetryTests
and all should be good 👍
@lmarceau, i've fixed the test cases. kindly check it. |
Note that this user appears to be identity farming with AI generated content rust-lang/rust#135436 Additional scrutiny of contributions is warranted. |
@DianQK please dont keep false accusations like these. I noticed the concerns raised regarding my contributions, and I would like to clarify that I am committed to maintaining integrity and transparency in all of my work. I take pride in delivering quality contributions and am always open to further discussion or clarification on any matter. |
firefox-ios/firefox-ios-tests/Tests/ClientTests/Telemetry/HomepageTelemetryTests.swift
Outdated
Show resolved
Hide resolved
firefox-ios/firefox-ios-tests/Tests/ClientTests/Telemetry/HomepageTelemetryTests.swift
Outdated
Show resolved
Hide resolved
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.
Ill run the build and if green then we can merge
📜 Tickets
Jira ticket
Github issue
💡 Description
This PR refactors the
HomepageTelemetry
class to inject a customGleanWrapper
for better dependency management and to facilitate mocking in unit tests. The current approach directly interacts with Glean metrics, making it difficult to test and mock. By introducing aGleanWrapperProtocol
and aCustomGleanWrapper
class, we decouple the telemetry logic from Glean, allowing for more flexible and testable code. 🔧Key Changes:
GleanWrapperProtocol
, making it more modular and easier to mock for unit tests. 🔄Additionally, I have added unit tests to verify the correct functionality of the
sendHomepageTappedTelemetry
method, ensuring that the proper telemetry data is being recorded based on the input values. These tests check both private and normal mode toggle scenarios. 🧪Output Log:
Test Cases:
isPrivateMode
flag when entering normal mode. 🔒isPrivateMode
flag when entering private mode. 🕵️Issue:
📝 Checklist
You have to check all boxes before merging ✅
@Mergifyio backport release/v120
) 🔄