-
Notifications
You must be signed in to change notification settings - Fork 224
Functional tests for prebid cache traceability #3763
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
Functional tests for prebid cache traceability #3763
Conversation
…ests/prebid-cache-traceability
| import org.prebid.server.functional.model.response.auction.Adm | ||
| import org.prebid.server.functional.model.response.auction.BidResponse | ||
| import org.prebid.server.functional.util.PBSUtils | ||
| import spock.lang.IgnoreRest |
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.
Please remove redundant import
| private final static String PBS_API_HEADER = 'x-pbc-api-key' | ||
| private static final Integer MAX_DATACENTER_REGION_LENGTH = 4 | ||
|
|
||
| private final static String XML_CREATIVE_SIZE_METRIC = "account.%s.prebid_cache.creative_size.xml" | ||
| private final static String JSON_CREATIVE_SIZE_METRIC = "account.%s.prebid_cache.creative_size.json" | ||
| private final static String XML_CREATIVE_TTL_METRIC = "account.%s.prebid_cache.creative_ttl.xml" | ||
| private final static String JSON_CREATIVE_TTL_METRIC = "account.%s.prebid_cache.creative_ttl.json" | ||
| private final static String CACHE_REQUEST_OK_METRIC = "account.%s.prebid_cache.requests.ok" | ||
| private final static String XML_CREATIVE_SIZE_GENERAL_METRIC = "prebid_cache.creative_size.xml" | ||
| private final static String JSON_CREATIVE_SIZE_GENERAL_METRIC = "prebid_cache.creative_size.json" | ||
| private final static String OK_GENERAL_METRIC = "prebid_cache.requests.ok" | ||
|
|
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.
Please use one order for all variables (like private static final TYPE NAME)
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.
We specified general metrics but not specified for accounts.
Maybe better to specify them
| and: "Set bidder response" | ||
| def bidResponse = BidResponse.getDefaultBidResponse(bidRequest) | ||
| bidder.setResponse(bidRequest.id, bidResponse) |
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 need the bidder's response?
| and: "PBS cache key should have length equal to default UUID" | ||
| assert cacheKey.length() == UUID.randomUUID().toString().length() |
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 it's better to specify certain values for the length instead of generating them each time?
| def pbsService = pbsServiceFactory.getService(pbsConfig) | ||
|
|
||
| and: "Default BidRequest with cache, targeting and large account ID" | ||
| def bidRequest = BidRequest.defaultBidRequest |
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 it's almost a coding style for us to use tap.{} for bidRequest.
🔧 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