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

Test: Transition PAAPI parameters #3634

Open
wants to merge 48 commits into
base: feature/paa
Choose a base branch
from

Conversation

marki1an
Copy link
Collaborator

@marki1an marki1an commented Dec 16, 2024

🔧 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?

@marki1an marki1an added tests Functional or other tests do not merge Not the time for merging yet labels Dec 16, 2024
@marki1an
Copy link
Collaborator Author

Corresponding issue prebid/prebid-server#3536

Comment on lines +1062 to +1065
then: "Bidder request should imp[].{ae/ext.igs.ae} same value as requested"
def bidderRequest = bidder.getBidderRequest(bidRequest.id)
assert bidderRequest.imp[0].ext.ae == auctionEnvironment
assert bidderRequest.imp[0].ext.interestGroupAuctionSupport.auctionEnvironment == auctionEnvironment
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment and code are mismatched

@@ -23,6 +24,7 @@ class AccountAuctionConfig {
AccountEventsConfig events
AccountPriceFloorsConfig priceFloors
Targeting targeting
PaaFormant paaformat
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be PaaFormant paaFormat, as in the request variable

Comment on lines +11 to +13
UNKNOWN(PBSUtils.getRandomNumberWithExclusion([NOT_SUPPORTED.value,
DEVICE_ORCHESTRATED.value,
SERVER_ORCHESTRATED.value])),
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 UNKNOWN(Integer.MAX_VALUE) should be enough

@@ -23,10 +23,12 @@ class ImpExt {
String tid
String gpid
String sid
Integer ae
AuctionEnvironment ae
Copy link
Collaborator

Choose a reason for hiding this comment

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

I prefer not to violate Java conventions and to use full names; in this case, it is easy to understand purpose and context

    @JsonProperty("ae")
    AuctionEnvironment auctionEnvironment

@@ -1040,4 +1046,66 @@ class BidderParamsSpec extends BaseSpec {
assert seatNonBid.nonBid[0].impId == bidRequest.imp[0].id
assert seatNonBid.nonBid[0].statusCode == REQUEST_BLOCKED_UNACCEPTABLE_CURRENCY
}

def "PBS should pass imp.ext.ae to imp.ext.igs.ae when imp.ext.ae specified and imp.ext.igs.ae doesn't specified"() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

PBS should add auction environment to imp.ext.igs when it is present in imp.ext and imp.ext.igs is empty

Comment on lines +115 to +119
def bidRequest = BidRequest.defaultBidRequest.tap {
imp[0].ext.ae = DEVICE_ORCHESTRATED
imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx
ext.prebid.paaFormat = requestPaaFormant
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can be a private method for creating a proper request

Comment on lines +144 to +147
assert auctionConfigs[0].impId == impId
assert auctionConfigs[0].bidder == bidResponse.seatbid[0].seat.value
assert auctionConfigs[0].adapter == bidResponse.seatbid[0].seat.value
assert auctionConfigs[0].config == fledgeConfig
Copy link
Collaborator

Choose a reason for hiding this comment

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

auctionConfigs.impId == [impId]
auctionConfigs.bidder == bidResponse.seatbid.seat.value
auctionConfigs.adapter == bidResponse.seatbid.seat.value
auctionConfigs.config == [fledgeConfig]


and: "PBS shouldn't emit metric"
def metricsRequest = pbsService.sendCollectedMetricsRequest()
assert !metricsRequest["Some name of metric for dropped igb object"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move these stubs to a constant

assert !bidResponse.ext.warnings[PREBID]

and: "PBS shouldn't emit log"
assert !pbsService.getLogsByValue("DROP igb obj")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move these stubs to a constant


and: "Alert.general metric should be updated"
def metricsRequest = pbsService.sendCollectedMetricsRequest()
assert metricsRequest["alerts.general" as String] == 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

assert metrics[ALERT_GENERAL.getValue()] == 1

@osulzhenko
Copy link
Collaborator

Required update

@osulzhenko osulzhenko changed the base branch from master to feature/paa January 10, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Not the time for merging yet tests Functional or other tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.