From b2121ac3a229f63e73232868aa174719c93bbd75 Mon Sep 17 00:00:00 2001 From: Laurentiu Badea Date: Wed, 31 Jul 2024 19:21:06 +0000 Subject: [PATCH 1/2] Load bidVideo in exchange tests mockResponse to support correct video targeting generation --- exchange/exchange_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/exchange/exchange_test.go b/exchange/exchange_test.go index bab8dded1c5..aec062b70c6 100644 --- a/exchange/exchange_test.go +++ b/exchange/exchange_test.go @@ -5568,9 +5568,10 @@ type bidderSeatBid struct { // bidderBid is basically a subset of entities.PbsOrtbBid from exchange/bidder.go. // See the comment on bidderSeatBid for more info. type bidderBid struct { - Bid *openrtb2.Bid `json:"ortbBid,omitempty"` - Type string `json:"bidType,omitempty"` - Meta *openrtb_ext.ExtBidPrebidMeta `json:"bidMeta,omitempty"` + Bid *openrtb2.Bid `json:"ortbBid,omitempty"` + Type string `json:"bidType,omitempty"` + BidVideo *openrtb_ext.ExtBidPrebidVideo `json:"bidVideo,omitempty"` + Meta *openrtb_ext.ExtBidPrebidMeta `json:"bidMeta,omitempty"` } type mockIdFetcher map[string]string @@ -5617,6 +5618,7 @@ func (b *validatingBidder) requestBid(ctx context.Context, bidderRequest BidderR bids[i] = &entities.PbsOrtbBid{ OriginalBidCPM: mockSeatBid.Bids[i].Bid.Price, Bid: mockSeatBid.Bids[i].Bid, + BidVideo: mockSeatBid.Bids[i].BidVideo, BidType: openrtb_ext.BidType(mockSeatBid.Bids[i].Type), BidMeta: mockSeatBid.Bids[i].Meta, } From 223e70d466c3ecc6d11ed771279ab484e2e6565c Mon Sep 17 00:00:00 2001 From: Laurentiu Badea Date: Thu, 1 Aug 2024 04:21:34 +0000 Subject: [PATCH 2/2] tests update: update hb_pb_cat_dur for json exchange tests that return BidVideo --- exchange/exchangetest/append-bidder-names.json | 8 ++++++-- exchange/exchangetest/debuglog_disabled.json | 8 ++++++-- exchange/exchangetest/debuglog_enabled.json | 8 ++++++-- exchange/exchangetest/generate-bid-id-error.json | 8 ++++++-- exchange/exchangetest/generate-bid-id-many.json | 15 ++++++++++++--- exchange/exchangetest/generate-bid-id-one.json | 9 +++++++-- exchange/exchangetest/include-brand-category.json | 8 ++++++-- 7 files changed, 49 insertions(+), 15 deletions(-) diff --git a/exchange/exchangetest/append-bidder-names.json b/exchange/exchangetest/append-bidder-names.json index bc45321303f..0be1fdca522 100644 --- a/exchange/exchangetest/append-bidder-names.json +++ b/exchange/exchangetest/append-bidder-names.json @@ -148,10 +148,14 @@ "hb_cache_path_appnex": "/pbcache/endpoint", "hb_pb": "0.20", "hb_pb_appnexus": "0.20", - "hb_pb_cat_dur": "0.20_VideoGames_0s_appnexus", - "hb_pb_cat_dur_appnex": "0.20_VideoGames_0s_appnexus", + "hb_pb_cat_dur": "0.20_VideoGames_30s_appnexus", + "hb_pb_cat_dur_appnex": "0.20_VideoGames_30s_appnexus", "hb_size": "200x250", "hb_size_appnexus": "200x250" + }, + "video": { + "duration": 30, + "primary_category": "" } } } diff --git a/exchange/exchangetest/debuglog_disabled.json b/exchange/exchangetest/debuglog_disabled.json index ce0669cf6fb..4b1ad744be4 100644 --- a/exchange/exchangetest/debuglog_disabled.json +++ b/exchange/exchangetest/debuglog_disabled.json @@ -157,10 +157,14 @@ "hb_cache_path_appnex": "/pbcache/endpoint", "hb_pb": "0.20", "hb_pb_appnexus": "0.20", - "hb_pb_cat_dur": "0.20_VideoGames_0s", - "hb_pb_cat_dur_appnex": "0.20_VideoGames_0s", + "hb_pb_cat_dur": "0.20_VideoGames_30s", + "hb_pb_cat_dur_appnex": "0.20_VideoGames_30s", "hb_size": "200x250", "hb_size_appnexus": "200x250" + }, + "video": { + "duration": 30, + "primary_category": "" } } } diff --git a/exchange/exchangetest/debuglog_enabled.json b/exchange/exchangetest/debuglog_enabled.json index 71a0bc06e96..faf3834a655 100644 --- a/exchange/exchangetest/debuglog_enabled.json +++ b/exchange/exchangetest/debuglog_enabled.json @@ -159,10 +159,14 @@ "hb_cache_path_appnex": "/pbcache/endpoint", "hb_pb": "0.20", "hb_pb_appnexus": "0.20", - "hb_pb_cat_dur": "0.20_VideoGames_0s", - "hb_pb_cat_dur_appnex": "0.20_VideoGames_0s", + "hb_pb_cat_dur": "0.20_VideoGames_30s", + "hb_pb_cat_dur_appnex": "0.20_VideoGames_30s", "hb_size": "200x250", "hb_size_appnexus": "200x250" + }, + "video": { + "duration": 30, + "primary_category": "" } } } diff --git a/exchange/exchangetest/generate-bid-id-error.json b/exchange/exchangetest/generate-bid-id-error.json index c38d0c97e3b..3536f38b3d1 100644 --- a/exchange/exchangetest/generate-bid-id-error.json +++ b/exchange/exchangetest/generate-bid-id-error.json @@ -121,10 +121,14 @@ "hb_cache_path_appnex": "/pbcache/endpoint", "hb_pb": "0.20", "hb_pb_appnexus": "0.20", - "hb_pb_cat_dur": "0.20_VideoGames_0s_appnexus", - "hb_pb_cat_dur_appnex": "0.20_VideoGames_0s_appnexus", + "hb_pb_cat_dur": "0.20_VideoGames_30s_appnexus", + "hb_pb_cat_dur_appnex": "0.20_VideoGames_30s_appnexus", "hb_size": "200x250", "hb_size_appnexus": "200x250" + }, + "video": { + "duration": 30, + "primary_category": "" } } } diff --git a/exchange/exchangetest/generate-bid-id-many.json b/exchange/exchangetest/generate-bid-id-many.json index 8a55d1976d4..ecdefbaa71b 100644 --- a/exchange/exchangetest/generate-bid-id-many.json +++ b/exchange/exchangetest/generate-bid-id-many.json @@ -67,7 +67,8 @@ }, "bidType": "video", "bidVideo": { - "duration": 30 + "duration": 30, + "PrimaryCategory": "" } } ], @@ -100,7 +101,11 @@ "meta": { }, "bidid": "bid-appnexus-1", - "type": "video" + "type": "video", + "video": { + "duration": 30, + "primary_category": "" + } } } }, @@ -120,7 +125,11 @@ "meta": { }, "bidid": "bid-appnexus-2", - "type": "video" + "type": "video", + "video": { + "duration": 30, + "primary_category": "" + } } } } diff --git a/exchange/exchangetest/generate-bid-id-one.json b/exchange/exchangetest/generate-bid-id-one.json index e14e5db22b9..ccd6abd05f2 100644 --- a/exchange/exchangetest/generate-bid-id-one.json +++ b/exchange/exchangetest/generate-bid-id-one.json @@ -50,7 +50,8 @@ }, "bidType": "video", "bidVideo": { - "duration": 30 + "duration": 30, + "primary_category": "" } } ], @@ -83,7 +84,11 @@ "meta": { }, "bidid": "bid-appnexus-1", - "type": "video" + "type": "video", + "video": { + "duration": 30, + "primary_category": "" + } } } } diff --git a/exchange/exchangetest/include-brand-category.json b/exchange/exchangetest/include-brand-category.json index 74950598ec2..7334cf1a6c1 100644 --- a/exchange/exchangetest/include-brand-category.json +++ b/exchange/exchangetest/include-brand-category.json @@ -146,10 +146,14 @@ "hb_cache_path_appnex": "/pbcache/endpoint", "hb_pb": "0.20", "hb_pb_appnexus": "0.20", - "hb_pb_cat_dur": "0.20_VideoGames_0s", - "hb_pb_cat_dur_appnex": "0.20_VideoGames_0s", + "hb_pb_cat_dur": "0.20_VideoGames_30s", + "hb_pb_cat_dur_appnex": "0.20_VideoGames_30s", "hb_size": "200x250", "hb_size_appnexus": "200x250" + }, + "video": { + "duration": 30, + "primary_category": "" } } }