-
Notifications
You must be signed in to change notification settings - Fork 224
Test: Vtrack account ttl #4241
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
Test: Vtrack account ttl #4241
Conversation
| then: "Pbs should emit creative_ttl.xml with lowest value" | ||
| def metrics = defaultPbsService.sendCollectedMetricsRequest() | ||
| def minTllSecond = PBSUtils.getMinValue(requestedTtl, accountTtl) | ||
| assert metrics[XML_CREATIVE_TTL_ACCOUNT_METRIC.formatted(accountId)] == minTllSecond |
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.
assert metrics[XML_CREATIVE_TTL_ACCOUNT_METRIC.formatted(accountId)] == [requestedTtl, accountTtl].findAll().min()
| } | ||
| } | ||
|
|
||
| static Integer getMinValue(Integer valueOne, Integer valueTwo) { |
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.
pls remove it
| PBSUtils.getRandomNumber(300, 1500) as Integer | PBSUtils.getRandomNumber(300, 1500) as Integer | ||
| PBSUtils.getRandomNumber(300, 1500) as Integer | PBSUtils.getRandomNegativeNumber(-300, -1500) as Integer | ||
| PBSUtils.getRandomNegativeNumber(-300, -1500) as Integer | PBSUtils.getRandomNumber(300, 1500) as Integer | ||
| PBSUtils.getRandomNegativeNumber(-300, -1500) as Integer | PBSUtils.getRandomNegativeNumber(-300, -1500) as Integer |
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.
Is a negative value even legit?
| assert exception.responseBody == "Account 'a' is required query parameter and can't be empty" | ||
| } | ||
|
|
||
| def "PBS shouldn't negative value in tllSecond when account vtrack ttl is #accountTtl and request ttl second is #requestedTtl"() { |
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.
PBS shouldn't use negative value
| then: "Pbs should emit creative_ttl.xml with lowest value" | ||
| def metrics = defaultPbsService.sendCollectedMetricsRequest() | ||
| assert metrics[XML_CREATIVE_TTL_ACCOUNT_METRIC.formatted(accountId)] | ||
| == [requestedTtl, accountTtl].findAll({ it -> it > 0 }).min() |
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.
[requestedTtl, accountTtl].findAll { it > 0 }.min()
| then: "Pbs should emit creative_ttl.xml with lowest value" | ||
| def metrics = defaultPbsService.sendCollectedMetricsRequest() | ||
| assert metrics[XML_CREATIVE_TTL_ACCOUNT_METRIC.formatted(accountId)] | ||
| == [requestedTtl, accountTtl].findAll().min() |
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.
[requestedTtl, accountTtl].min()
🔧 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