Skip to content

Conversation

@marki1an
Copy link
Collaborator

@marki1an marki1an commented Nov 17, 2025

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

Test cases for open source issue #4248

🧠 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 requested a review from osulzhenko November 17, 2025 16:00
@marki1an marki1an self-assigned this Nov 17, 2025
@marki1an marki1an added the tests Functional or other tests label Nov 17, 2025
Comment on lines 39 to 40
.withUsername("prebid")
.withUsername("prebid")
Copy link
Collaborator

Choose a reason for hiding this comment

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

duplicate

Comment on lines 112 to 113
"metrics.influxdb.database" : PREBID_DATABASE,
"metrics.influxdb.auth" : "prebid:prebid",
Copy link
Collaborator

Choose a reason for hiding this comment

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

     "metrics.influxdb.database"      : influx.database,
     "metrics.influxdb.auth"          : "${influx.username}:${influx.password}",

Comment on lines 15 to 16
private static final PrebidServerService pbsServiceWithEnforceValidAccount
= pbsServiceFactory.getService(["settings.enforce-valid-account": true as String])
Copy link
Collaborator

Choose a reason for hiding this comment

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

pls add cleanupSpec

Comment on lines 17 to 19
private static final Closure<String> REJECT_INVALID_ACCOUNT_METRIC = { accountId ->
"influx.metric.account.${accountId}.requests.rejected.invalid-account"
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a simple, straightforward metrics check; simple formatting will be enough

Comment on lines 22 to 30
given: "Inactive account id"
def accountId = PBSUtils.randomNumber
def account = new Account(uuid: accountId, config: new AccountConfig(status: AccountStatus.INACTIVE))
accountDao.save(account)

and: "Default basic BidRequest with inactive account id"
def bidRequest = BidRequest.defaultBidRequest.tap {
site.publisher.id = accountId
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

same for other

        given: "BidRequest with inactive account id"
        def bidRequest = BidRequest.defaultBidRequest

        and: "Inactive account id"
        def account = new Account(uuid: bidRequest.accountId, config: new AccountConfig(status: AccountStatus.INACTIVE))
        accountDao.save(account)

Copy link
Collaborator

Choose a reason for hiding this comment

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

actual

Comment on lines 67 to 71
PBSUtils.waitUntil({
!pbsServiceWithEnforceValidAccount.sendInfluxMetricsRequest()
.containsKey(REJECT_INVALID_ACCOUNT_METRIC(bidRequest.accountId) as String)
})
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

what if we make it like in logs:

    Boolean isContainLogsByValue(String value) {
        try {
            PBSUtils.waitUntil({ getPbsLogsByValue(value) != null })
            true
        } catch (IllegalStateException ignored) {
            false
        }
    }

.containsKey(REJECT_INVALID_ACCOUNT_METRIC(bidRequest.accountId) as String)
})
def influxMetricsRequest = pbsServiceWithEnforceValidAccount.sendInfluxMetricsRequest()
assert influxMetricsRequest[REJECT_INVALID_ACCOUNT_METRIC(bidRequest.accountId) 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 isContainDbMetricsByValue
def influxMetricsRequest = pbsServiceWithEnforceValidAccount.sendInfluxMetricsRequest()
assert influxMetricsRequest[REJECT_INVALID_ACCOUNT_METRIC(bidRequest.accountId) as String] == 1

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

TestsPassed ✅Skipped ⚠️Failed
JUnit Test Report9058 ran9056 passed2 skipped0 failed

@osulzhenko osulzhenko changed the base branch from master to influxdb-metrics-fix December 2, 2025 10:56

Map<String, Number> sendInfluxMetricsRequest() {
def response = given(influxRequestSpecification)
.queryParams(["db": "prebid",
Copy link
Collaborator

Choose a reason for hiding this comment

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

"db": influxdbContainer.getDatabase(),

"metrics.influxdb.interval" : "1",
"metrics.influxdb.connectTimeout": "5000",
"metrics.influxdb.readTimeout" : "100",

Copy link
Collaborator

Choose a reason for hiding this comment

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

remove empty space

@osulzhenko osulzhenko merged commit c962080 into influxdb-metrics-fix Dec 2, 2025
1 check passed
@osulzhenko osulzhenko deleted the add-functional-tests-for-influx branch December 2, 2025 12:38
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