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

Functional tests for module execution host config check #3589

Merged

Conversation

osulzhenko
Copy link
Collaborator

@osulzhenko osulzhenko commented Dec 1, 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?

@osulzhenko osulzhenko added the tests Functional or other tests label Dec 1, 2024
@osulzhenko osulzhenko requested a review from marki1an December 1, 2024 20:55
@osulzhenko osulzhenko self-assigned this Dec 1, 2024

and: "hook call metrics should be updated"
and: "Response-correction module call metrics should be updated"
Copy link
Collaborator

Choose a reason for hiding this comment

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

"PB_RICHMEDIA_FILTER module call metrics should be updated"

and: "hook call metrics shouldn't be updated"
assert !metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)]
assert !metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
and: "Response-correction module call metrics should be updated"
Copy link
Collaborator

Choose a reason for hiding this comment

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

"PB_RICHMEDIA_FILTERmodule call metrics should be updated"

Comment on lines +350 to +353
and: "Save account without modules config"
def accountConfig = new AccountConfig(hooks: new AccountHooksConfiguration(modules: null))
def account = new Account(uuid: bidRequest.getAccountId(), config: accountConfig)
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.

I hope we can delete the account config with empty modules.

Comment on lines 306 to 309
and: "Save account without modules config"
def accountConfig = new AccountConfig(hooks: new AccountHooksConfiguration(modules: null))
def account = new Account(uuid: bidRequest.getAccountId(), config: accountConfig)
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.

Same here we can delete it

pbsServiceFactory.removeContainer(pbsConfig)
}

def "PBS should call all modules without account config when modules disabled in module-execution host config"() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

PBS shouldn't allow call module when module disabled in hooks.admin.module-execution

@osulzhenko osulzhenko requested a review from marki1an December 2, 2024 19:30

@ToString(includeNames = true, ignoreNulls = true)
@JsonNaming(PropertyNamingStrategies.LowerCaseStrategy)
class TraceOutcome {

Stage entity
String entity
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not stage?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because BIDDER_REQUEST, RAW_BIDDER_RESPONSE, and PROCESSED_BIDDER_RESPONSE from beginning had bidder as entity and stage as a separate parameter, we didn’t have any tests for it previously, so it was implemented as a Stage. However, this is not accurate. You can check it here:
#1345

@osulzhenko osulzhenko requested a review from marki1an December 3, 2024 09:36
@osulzhenko osulzhenko requested a review from marki1an December 3, 2024 12:52
@osulzhenko osulzhenko merged commit 1b6365f into module-execution-fix Dec 4, 2024
@osulzhenko osulzhenko deleted the functional-tests/module-execution-fix branch December 4, 2024 10:51
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.

2 participants