Skip to content

Commit

Permalink
Fix: floors flakey test (#2799)
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-nilesh-chate committed May 26, 2023
1 parent de804a5 commit f2add44
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions floors/enforce_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ func TestEnforce(t *testing.T) {
},
},
conversions: convert{},
priceFloorsCfg: config.AccountPriceFloors{Enabled: true, EnforceFloorsRate: 100, EnforceDealFloors: true},
priceFloorsCfg: config.AccountPriceFloors{Enabled: true, EnforceFloorsRate: 0, EnforceDealFloors: true},
},
expEligibleBids: map[openrtb_ext.BidderName]*entities.PbsOrtbSeatBid{
"pubmatic": {
Expand Down Expand Up @@ -632,7 +632,7 @@ func TestEnforce(t *testing.T) {
},
},
conversions: convert{},
priceFloorsCfg: config.AccountPriceFloors{Enabled: true, EnforceFloorsRate: 100, EnforceDealFloors: false},
priceFloorsCfg: config.AccountPriceFloors{Enabled: true, EnforceFloorsRate: 0, EnforceDealFloors: false},
},
expEligibleBids: map[openrtb_ext.BidderName]*entities.PbsOrtbSeatBid{
"pubmatic": {
Expand Down Expand Up @@ -661,12 +661,10 @@ func TestEnforce(t *testing.T) {
for _, tt := range tests {
actEligibleBids, actErrs, actRejecteBids := Enforce(tt.args.bidRequestWrapper, tt.args.seatBids, config.Account{PriceFloors: tt.args.priceFloorsCfg}, tt.args.conversions)
assert.Equal(t, tt.expErrs, actErrs, tt.name)
if !reflect.DeepEqual(tt.expRejectedBids, actRejecteBids) {
assert.Fail(t, "rejected bids don't match")
}
assert.ElementsMatch(t, tt.expRejectedBids, actRejecteBids, tt.name)

if !reflect.DeepEqual(tt.expEligibleBids, actEligibleBids) {
assert.Fail(t, "eligible bids don't match")
assert.Failf(t, "eligible bids don't match", "Expected: %v, Got: %v", tt.expEligibleBids, actEligibleBids)
}
}
}
Expand Down

0 comments on commit f2add44

Please sign in to comment.