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

Tests: Multiple Uids Cookies Support #3691

Merged

Conversation

osulzhenko
Copy link
Collaborator

@osulzhenko osulzhenko commented Jan 22, 2025

🔧 Type of changes

  • new bid adapter
  • bid adapter update
  • new feature
  • new analytics adapter
  • new module
  • module update
  • bugfix
  • documentation
  • configuration
  • dependency update
  • tech debt (test coverage, refactorings, etc.)

✨ 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

  • verify email contact works
  • NO fully dynamic hostnames
  • geographic host parameters are NOT required
  • direct use of HTTP is prohibited - implement an existing Bidder interface that will do all the job
  • if the ORTB is just forwarded to the endpoint, use the generic adapter - define the new adapter as the alias of the generic adapter
  • cover an adapter configuration with an integration test

🧪 Test plan

How do you know the changes are safe to ship to production?

🏎 Quality check

  • Are your changes following our code style guidelines?
  • Are there any breaking changes in your code?
  • Does your test coverage exceed 90%?
  • Are there any erroneous console logs, debuggers or leftover code in your changes?

@osulzhenko osulzhenko added the tests Functional or other tests label Jan 22, 2025
@osulzhenko osulzhenko requested a review from marki1an January 22, 2025 13:25
@osulzhenko osulzhenko self-assigned this Jan 22, 2025
Copy link
Collaborator

@marki1an marki1an left a comment

Choose a reason for hiding this comment

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

Add tests for config:
The values can be 1-30. Anything outside of that range should cause a startup failure. If not specified, the default value is 1.
When value -1 and biggest than 30

@@ -16,11 +16,11 @@ class UidsCookie {
Map<BidderName, UidWithExpiry> tempUIDs
Boolean optout

static UidsCookie getDefaultUidsCookie(BidderName bidder = GENERIC) {
static UidsCookie getDefaultUidsCookie(BidderName bidder = GENERIC, Integer expireDays = 2) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should choose one name for expiration day(expireDays or plusDays)

@@ -11,10 +11,10 @@ class UidWithExpiry {
String uid
ZonedDateTime expires

static UidWithExpiry getDefaultUidWithExpiry() {
static UidWithExpiry getDefaultUidWithExpiry(Integer plusDays = 2) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one is related to the comment above.

@@ -6,7 +6,7 @@ import org.prebid.server.functional.model.UidsCookie
@ToString(includeNames = true, ignoreNulls = true)
class SetuidResponse {

Map<String, String> headers
LinkedHashMap<String, List<String>> headers
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe here Map should be fine.

@@ -312,14 +335,50 @@ class SetUidSpec extends BaseSpec {
pbsServiceFactory.removeContainer(pbsConfig)
}

def "PBS SetUid should remove most distant expiration bidder from uids cookie in prioritized bidder"() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

PBS set uid should emit sizedout metric and remove most distant expiration bidder from uids cookie in prioritized bidder

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please ad test for sizeblocked.

assert uidsCookie.tempUIDs[RUBICON]
}

def "PBS should sout multiple uids cookies by priority and expiration timestamp"() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo: send*

PBS should send multiple uids cookies by priority and expiration timestamp

Comment on lines 505 to 507
then: "Response should contain requested uids"
assert response.uidsCookie.tempUIDs[GENERIC]
assert response.uidsCookie.tempUIDs[RUBICON]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wrong description or assert, don't see check uids

@osulzhenko osulzhenko requested a review from marki1an January 26, 2025 17:45
@osulzhenko osulzhenko merged commit db75507 into multiple-uids-cookies Jan 28, 2025
1 check passed
@osulzhenko osulzhenko deleted the functional-tests/multiple-uids-cookies branch January 28, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Functional or other tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants