Skip to content
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

Merged
merged 11 commits into from
Oct 18, 2023
Merged

Adds DBP pixel tests #1764

merged 11 commits into from
Oct 18, 2023

Conversation

diegoreymendez
Copy link
Contributor

@diegoreymendez diegoreymendez commented Oct 18, 2023

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:

  1. Review the code
  2. Run the unit tests for the DBP target (WARNING: these are not included in the CI so you should run them manually)

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

Comment on lines +31 to +43
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7B96D0CE2ADFDA7E007E02C8"
BuildableName = "DuckDuckGoDBPTests.xctest"
BlueprintName = "DuckDuckGoDBPTests"
ReferencedContainer = "container:DuckDuckGo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
Copy link
Contributor Author

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,
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 2023

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against 69fa93f

Comment on lines +17 to +19
.library(
name: "PixelKitTestingUtilities",
targets: ["PixelKitTestingUtilities"])
Copy link
Contributor Author

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/")!
Copy link
Contributor Author

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.

@diegoreymendez diegoreymendez self-assigned this Oct 18, 2023
@diegoreymendez diegoreymendez marked this pull request as ready for review October 18, 2023 13:14
Copy link
Collaborator

@jotaemepereira jotaemepereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 👍🏼

diegoreymendez and others added 6 commits October 18, 2023 20:05
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.
@diegoreymendez
Copy link
Contributor Author

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.

@diegoreymendez diegoreymendez merged commit 0f7e8ac into develop Oct 18, 2023
15 checks passed
@diegoreymendez diegoreymendez deleted the diego/add-pixel-tests branch October 18, 2023 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants