-
Notifications
You must be signed in to change notification settings - Fork 224
Tests: Module Storage Metrics #4219
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: Module Storage Metrics #4219
Conversation
| package org.prebid.server.functional.model.config | ||
|
|
||
| import groovy.transform.ToString | ||
|
|
||
| @ToString(includeNames = true, ignoreNulls = true) | ||
| class Audience { | ||
| String provider | ||
| List<AudienceId> ids | ||
| String keyspace | ||
| Integer rtbSegtax | ||
| } |
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 add an empty line
- keyspace and rtbSegtax unused variable
| class AudienceId { | ||
| String id |
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 add empty line
| boolean enabled | ||
| int ttlSeconds |
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 boolean and int like Object in order to possibly have null.
| String apiKey | ||
| String tenant | ||
| String origin |
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.
apiKey, tenant, origin, unused fields, add it into default method or remove
| when: "PBS processes auction request" | ||
| prebidServerStoredCacheService.sendAuctionRequest(bidRequest) | ||
|
|
||
| then: "PBS should update metrics for new saved text storage cache" |
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.
Wrong description
|
|
||
| then: "PBS should update metrics for new saved text storage cache" | ||
| def metrics = prebidServerStoredCacheService.sendCollectedMetricsRequest() | ||
| assert metrics[METRIC_CREATIVE_SIZE_TEXT] == getTargetingResultSize(targetingResult) |
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.
Use in line since one use case encodeBase64(encode(result).bytes).size()
| def targetingResult = getBodyByRequest(bidRequest) | ||
| mockServerClient.when(request() | ||
| .withMethod("GET") | ||
| .withPath('/stored-cache'), Times.unlimited(), TimeToLive.unlimited(), -10) |
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.
'/stored-cache' can be raplaced with endpoint
| } | ||
|
|
||
| TargetingResult setCachedTargetingResponse(BidRequest bidRequest) { | ||
| def targetingResult = getBodyByRequest(bidRequest) |
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 direct pass targetingResult without returning the same object?
|
|
||
| void setCachingResponse(HttpStatusCode statusCode = NO_CONTENT_204) { | ||
| mockServerClient.when(request() | ||
| .withMethod("POST") |
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.
Are you sure that should be POST here?
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.
sure, that for BasicPbcStorageService.storeEntry
| def gdprConsent = bidRequest.user?.consent | ||
|
|
||
| [gdprConsent != null ? "&gdpr_consent=${gdprConsent}" : null, | ||
| "&gdpr=${gdpr ? 1 : 0}", |
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.
Can be regs?.gdpr in line(meaning no need variable for it)
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 should be either 1 or 0, but with regs?.gdpr, it can be null.
…s/module-storage-metrics # Conflicts: # src/test/groovy/org/prebid/server/functional/model/ModuleName.groovy # src/test/groovy/org/prebid/server/functional/model/config/ModuleHookImplementation.groovy # src/test/groovy/org/prebid/server/functional/model/config/PbsModulesConfig.groovy
🔧 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