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

Add tests for Zero Non Deal Bids Warning Only in Debug #3528

Conversation

osulzhenko
Copy link
Collaborator

@osulzhenko osulzhenko commented Oct 28, 2024

🔧 Type of changes

  • new bid adapter
  • update bid adapter
  • new feature
  • new analytics adapter
  • new module
  • bugfix
  • documentation
  • configuration
  • tech debt (test coverage, refactorings, etc.)

✨ What's the context?

What's the context for the changes? Are there any

🧠 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 hosts
  • geographic host parameters are NOT required
  • NO 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?

@osulzhenko osulzhenko added the tests Functional or other tests label Oct 28, 2024
@osulzhenko osulzhenko self-assigned this Oct 28, 2024
Comment on lines 116 to 117
it.dooh = Dooh.defaultDooh
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update style please

Comment on lines 274 to 275
test = 0
ext.prebid.debug = 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you don't mind, please make test and debug like enum DISABLED(0), ENABLED(1)

Comment on lines 290 to 292
then: "Invalid bid should be deleted"
assert response.seatbid.size() == 0

Copy link
Collaborator

Choose a reason for hiding this comment

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

Strangely, seat bid is not about invalid bids, better to check the seatNonBid field.

Comment on lines 279 to 282
def bidResponse = BidResponse.getDefaultBidResponse(bidRequest)
def bid = bidResponse.seatbid.first().bid.first()
bid.dealid = dealId
bid.price = bidPrice
Copy link
Collaborator

Choose a reason for hiding this comment

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

   def bidResponse = BidResponse.getDefaultBidResponse(bidRequest).tap{
     it.bid.tap{
     dealid = dealId
     price = bidPrice
            }   
   }

1 | 0 | null | null
}

def "PBS should drop invalid bid without debug error when request debug disabled and bid price is #bidPrice and deal id is #dealId"() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did the bidder call happen in such case?

def "PBS should update 'adapter.generic.requests.bid_validation' metric when bid validation error appears"() {
given: "Initial 'adapter.generic.requests.bid_validation' metric value"
def initialMetricValue = getCurrentMetricValue(defaultPbsService, "adapter.generic.requests.bid_validation")
def "PBS should only drop invalid bid without discarding whole seat without debug error when request debug disabled "() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a test to the end of the spec.

Comment on lines 332 to 333
then: "Invalid bids should be deleted"
assert response.seatbid?.first()?.bid*.id == [validBidId]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Better description: "Bid response contains only valid bid"

@Compile-Ninja Compile-Ninja merged commit c851395 into drop-zero-non-deal-bids-debug-warning Nov 4, 2024
@Compile-Ninja Compile-Ninja deleted the functional-tests/drop-zero-non-deal-bids-debug-warning branch November 4, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Functional or other tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants