-
Notifications
You must be signed in to change notification settings - Fork 14
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
Adds DBP pixel tests #1764
Adds DBP pixel tests #1764
Conversation
<Testables> | ||
<TestableReference | ||
skipped = "NO" | ||
parallelizable = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "7B96D0CE2ADFDA7E007E02C8" | ||
BuildableName = "DuckDuckGoDBPTests.xctest" | ||
BlueprintName = "DuckDuckGoDBPTests" | ||
ReferencedContainer = "container:DuckDuckGo.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> |
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.
New DBP unit tests target. I couldn't add the tests to the regular target since it doesn't include the DBP swift files.
init(store: @escaping @autoclosure () -> PixelDataStore, requestSender: @escaping RequestSender) { | ||
private let appVersion: String | ||
|
||
init(appVersion: String = AppVersion.shared.versionNumber, |
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.
Make the app version injectable for testing.
|
||
/// Tests to ensure that DBP pixels sent from the main app work well | ||
/// | ||
final class DataBrokerProtectionPixelTests: XCTestCase { |
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.
This is the test that I added for validating pixel behavior. There are no changes to the pixel logic right now, so this test is here to help me set a baseline for my upcoming changes.
.library( | ||
name: "PixelKitTestingUtilities", | ||
targets: ["PixelKitTestingUtilities"]) |
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.
New module for offering the standardized pixel validation logic.
@@ -56,7 +56,7 @@ public final class PixelKit { | |||
|
|||
public typealias Event = PixelKitEvent | |||
|
|||
static let duckDuckGoMorePrivacyInfo = URL(string: "https://help.duckduckgo.com/duckduckgo-help-pages/privacy/atb/")! | |||
public static let duckDuckGoMorePrivacyInfo = URL(string: "https://help.duckduckgo.com/duckduckgo-help-pages/privacy/atb/")! |
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.
Just make sure this value can be accessed for testing purposes.
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.
Looks great 👍🏼
Task/Issue URL: https://app.asana.com/0/0/1205746905965974/f ## Stack PR: Feel free to look at other PRs in the stack to understand the full set of changes, but this can be tested individually. - #1764 - #1766 <-- You're here ## Description Removes the DBP pixels from `Pixel.Event` and makes them implement `PixelKitEvent`, which makes it possible for us to fire them from our agent app.
Just a note that all of the extra commits after the review are from the child PR being merged into this, and from fixing CI issues. |
Task/Issue URL: https://app.asana.com/0/0/1205746905965973/f
Stack PR:
Feel free to look at other PRs in the stack to understand the full set of changes, but this can be tested individually.
Description
This PR adds a DBP unit testing target, and some basic pixel tests to ensure pixel's aren't broken in the transition to offer some level of PixelKit support.
Steps to test this PR:
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation