Skip to content

Commit 75cbe6a

Browse files
committed
Tests: Rename open-source modules and align hook suffixes
1 parent 5eeb1a3 commit 75cbe6a

17 files changed

Lines changed: 240 additions & 258 deletions

src/test/groovy/org/prebid/server/functional/model/ModuleName.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ enum ModuleName {
66

77
PB_RICHMEDIA_FILTER("pb-richmedia-filter"),
88
PB_RESPONSE_CORRECTION ("pb-response-correction"),
9-
ORTB2_BLOCKING("ortb2-blocking"),
9+
ORTB2_BLOCKING("pb-ortb2-blocking"),
1010
PB_REQUEST_CORRECTION('pb-request-correction'),
11-
OPTABLE_TARGETING('optable-targeting'),
11+
OPTABLE_TARGETING('pb-optable-targeting'),
1212
PB_RULE_ENGINE('pb-rule-engine')
1313

1414
@JsonValue

src/test/groovy/org/prebid/server/functional/model/config/ExecutionGroup.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ExecutionGroup {
1919
static ExecutionGroup getModuleExecutionGroup(ModuleName name, Stage stage) {
2020
new ExecutionGroup().tap {
2121
timeout = 1000
22-
hookSequence = [new HookId(moduleCode: name.code, hookImplCode: ModuleHookImplementation.forValue(name, stage).code)]
22+
hookSequence = [new HookId(moduleCode: name.code, hookImplCode: "${name.code}-$stage-hook")]
2323
}
2424
}
2525
}

src/test/groovy/org/prebid/server/functional/model/config/ModuleHookImplementation.groovy

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/test/groovy/org/prebid/server/functional/model/config/PbsModulesConfig.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import org.prebid.server.functional.model.request.auction.RichmediaFilter
1010
class PbsModulesConfig {
1111

1212
RichmediaFilter pbRichmediaFilter
13-
Ortb2BlockingConfig ortb2Blocking
13+
Ortb2BlockingConfig pbOrtb2Blocking
1414
PbResponseCorrection pbResponseCorrection
1515
PbRequestCorrectionConfig pbRequestCorrection
16-
OptableTargetingConfig optableTargeting
16+
OptableTargetingConfig pbOptableTargeting
1717
PbRulesEngine pbRuleEngine
1818
}

src/test/groovy/org/prebid/server/functional/model/response/auction/ModuleError.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ import groovy.transform.ToString
88
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy)
99
class ModuleError {
1010

11-
Map<String, List<String>> ortb2Blocking
11+
Map<String, List<String>> pbOrtb2Blocking
1212
}

src/test/groovy/org/prebid/server/functional/model/response/auction/ModuleWarning.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ import groovy.transform.ToString
88
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy)
99
class ModuleWarning {
1010

11-
Map<String, List<String>> ortb2Blocking
11+
Map<String, List<String>> pbOrtb2Blocking
1212
}

src/test/groovy/org/prebid/server/functional/tests/module/AbTestingModuleSpec.groovy

Lines changed: 125 additions & 128 deletions
Large diffs are not rendered by default.

src/test/groovy/org/prebid/server/functional/tests/module/GeneralModuleSpec.groovy

Lines changed: 66 additions & 72 deletions
Large diffs are not rendered by default.

src/test/groovy/org/prebid/server/functional/tests/module/ModuleBaseSpec.groovy

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.prebid.server.functional.tests.module
22

3+
import org.prebid.server.functional.model.ModuleName
34
import org.prebid.server.functional.model.config.Endpoint
45
import org.prebid.server.functional.model.config.ExecutionPlan
56
import org.prebid.server.functional.model.config.Stage
@@ -16,6 +17,8 @@ import static org.prebid.server.functional.model.ModuleName.PB_RICHMEDIA_FILTER
1617
import static org.prebid.server.functional.model.ModuleName.PB_REQUEST_CORRECTION
1718
import static org.prebid.server.functional.model.ModuleName.PB_RULE_ENGINE
1819
import static org.prebid.server.functional.model.config.Endpoint.OPENRTB2_AUCTION
20+
import static org.prebid.server.functional.model.config.ModuleHookImplementation.PB_RULES_ENGINE_PROCESSED_AUCTION_REQUEST
21+
import static org.prebid.server.functional.model.config.ModuleHookImplementation.PB_RULES_ENGINE_PROCESSED_AUCTION_REQUEST
1922
import static org.prebid.server.functional.model.config.Stage.ALL_PROCESSED_BID_RESPONSES
2023
import static org.prebid.server.functional.model.config.Stage.PROCESSED_AUCTION_REQUEST
2124
import static org.prebid.server.functional.testcontainers.Dependencies.getNetworkServiceContainer
@@ -33,6 +36,22 @@ class ModuleBaseSpec extends BaseSpec {
3336
repository.removeAllDatabaseData()
3437
}
3538

39+
protected final static Closure<String> CALL_METRIC = { ModuleName module, Stage stage ->
40+
"modules.module.${module.code}.stage.${stage.metricValue}.hook.${module.code}-${stage.value}-hook.call"
41+
}
42+
protected final static Closure<String> UPDATE_METRIC = { ModuleName module, Stage stage ->
43+
"modules.module.${module.code}.stage.${stage.metricValue}.hook.${module.code}-${stage.value}-hook.success.update"
44+
}
45+
protected final static Closure<String> NOOP_METRIC = { ModuleName module, Stage stage ->
46+
"modules.module.${module.code}.stage.${stage.metricValue}.hook.${module.code}-${stage.value}-hook.success.noop"
47+
}
48+
protected final static Closure<String> NO_INVOCATION_METRIC = { ModuleName module, Stage stage ->
49+
"modules.module.${module.code}.stage.${stage.metricValue}.hook.${module.code}-${stage.value}-hook.success.no-invocation"
50+
}
51+
protected final static Closure<String> EXECUTION_ERROR_METRIC = { ModuleName module, Stage stage ->
52+
"modules.module.${module.code}.stage.${stage.metricValue}.hook.${module.code}-${stage.value}-hook.execution-error"
53+
}
54+
3655
protected static Map<String, String> getResponseCorrectionConfig(Endpoint endpoint = OPENRTB2_AUCTION) {
3756
["hooks.${PB_RESPONSE_CORRECTION.code}.enabled": true,
3857
"hooks.host-execution-plan" : encode(ExecutionPlan.getSingleEndpointExecutionPlan(endpoint, [(ALL_PROCESSED_BID_RESPONSES): [PB_RESPONSE_CORRECTION]]))]

src/test/groovy/org/prebid/server/functional/tests/module/analyticstag/AnalyticsTagsModuleSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
3636
pbsServiceFactory.removeContainer(getOrtb2BlockingSettings())
3737
}
3838

39-
def "PBS should include analytics tag for ortb2-blocking module in response when request and account allow client details"() {
39+
def "PBS should include analytics tag for pb-ortb2-blocking module in response when request and account allow client details"() {
4040
given: "Default account with module config"
4141
def bidRequest = BidRequest.defaultBidRequest.tap {
4242
it.ext.prebid.analytics = new PrebidAnalytics(options: new AnalyticsOptions(enableClientDetails: true))

0 commit comments

Comments
 (0)