-
Notifications
You must be signed in to change notification settings - Fork 224
Tests: Support testing the USGen privacy module #3722
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
Tests: Support testing the USGen privacy module #3722
Conversation
| def infrastructure = bidResponse.ext.debug.trace.activityInfrastructure | ||
| def ruleConfigurations = findProcessingRule(infrastructure, FETCH_BIDS).ruleConfiguration.and | ||
| assert ruleConfigurations.size() == 1 | ||
| assert ruleConfigurations.first.and.every { it != null } |
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.
Do we really need to assert for the and field?
| where: | ||
| defaultAction << [false, true] |
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.
I hope we can emit this where block
| String privacyModule | ||
| String skipped | ||
| String result |
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.
Maybe better to replace on:
PrivacyModule privacyModule
Boolean skipped
Result(Need to create Enum also need to replace in ActivityInfrastructure) result
| it.geo = [CAN.withState(ARIZONA)] | ||
| } | ||
| def activityRule = ActivityRule.getDefaultActivityRule(condition).tap { | ||
| it.privacyRegulation = [IAB_US_GENERAL] |
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.
I suppose it's not only for iab.usgeneral.
Can we add tests for example IAB_ALL or just ALL?
| device = new Device(geo: new Geo(country: USA, region: ALABAMA.abbreviation)) | ||
| regs.ext = new RegsExt(gpc: PBSUtils.randomString) | ||
| regs.gppSid = [US_CA_V1.intValue] | ||
| regs.gpp = new UsNatV1Consent.Builder().setGpc(true).build() |
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.
Those fields are unnecessary.
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.
Relay on other rest tests
| it.gpc = gpc | ||
| it.geo = [CAN.withState(ARIZONA)] |
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.
Those fields are unnecessary.
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.
Relay on other rest tests
| } | ||
|
|
||
| and: "Set up activities" | ||
| def gpc = PBSUtils.randomString |
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.
It is also unnecessary
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.
Relay on other rest tests
|
|
||
| and: "Should contain information that module was skipped" | ||
| verifyAll(ruleConfigurations.first) { | ||
| it.privacyModule == 'iab.usgeneral' |
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.
it.privacyModule == PrivacyModule.IAB_US_GENERAL
| defaultAction << [false, true] | ||
| } | ||
|
|
||
| def "PBS auction should log consistently for each activity about skips modules in response"() { |
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 one seems like flaky tests
…ests/privacy-modules-skip-rate
7ae0cc5 to
517ca94
Compare
| assert genericBidderRequest.user.eids[0].source == bidRequest.user.eids[0].source | ||
|
|
||
| and: "Bid response should not contain verbose info in debug" | ||
| def infrastructure = bidResponse.ext.debug.trace.activityInfrastructure |
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.
Maybe "Bid response should contain verbose info in debug"
| } | ||
| } | ||
|
|
||
| def "PBS auction shouldn't emit errors or warnings when skip rate is out of borders"() { |
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.
What about checking for bidRequest.user.eids[0].source?
🔧 Type of changes
✨ What's the context?
What's the context for the changes?
🧠 Rationale behind the change
Why did you choose to make these changes? Were there any trade-offs you had to consider?
🔎 New Bid Adapter Checklist
🧪 Test plan
How do you know the changes are safe to ship to production?
🏎 Quality check