From: Arpit Singh Date: Mon, 6 Oct 2025 13:29:31 +0000 (+0530) Subject: Update performance test parameters for the Query API X-Git-Tag: 3.7.2~13 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=11a5311796201fc174ee0c73a6addf0c8ddaa15f;p=cps.git Update performance test parameters for the Query API - Performance tests for Delta report needed addition of a new anchor to the test data. - This resulted in the failure of performance tests for Query across anchors API and slight increase in timings of respective test. - The task modifies the test parameters to ensure compatibility with new anchor configuration. Issue-ID: CPS-2997 Change-Id: I573f0f414dba6324e91b62bd9a06053bed406c13 Signed-off-by: Arpit Singh --- diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy index 86df2f1b9e..b133d22bba 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy @@ -33,6 +33,7 @@ class CpsPerfTestBase extends PerfTestBase { static final def CPS_PERFORMANCE_TEST_DATASPACE = 'cpsPerformanceDataspace' static final def OPENROADM_ANCHORS = 3 + static final def MODIFIED_OPENROADM_ANCHORS = 1 static final def OPENROADM_DEVICES_PER_ANCHOR = 1000 static final def OPENROADM_DATANODES_PER_DEVICE = 86 diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy index b4744e85e0..e0de3331ae 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy @@ -53,6 +53,8 @@ class QueryPerfTest extends CpsPerfTestBase { } def 'Query complete data trees across all anchors with #scenario.'() { + given: 'expected number of data nodes to be returned' + def expectedNumberOfDataNodes = (OPENROADM_ANCHORS + MODIFIED_OPENROADM_ANCHORS) * (OPENROADM_DEVICES_PER_ANCHOR * OPENROADM_DATANODES_PER_DEVICE + additionalDataNodesPerDevice) when: 'query data nodes across all anchors' resourceMeter.start() def result = objectUnderTest.queryDataNodesAcrossAnchors(CPS_PERFORMANCE_TEST_DATASPACE, cpspath, INCLUDE_ALL_DESCENDANTS, PaginationOption.NO_PAGINATION) @@ -63,28 +65,30 @@ class QueryPerfTest extends CpsPerfTestBase { and: 'all data is read #expectedDuration seconds with a margin of 100%' recordAndAssertResourceUsage("CPS:Query across anchors ${scenario}", expectedDuration, durationInSeconds, resourceMeter.getTotalMemoryUsageInMB(), REFERENCE_GRAPH) where: 'the following parameters are used' - scenario | cpspath || expectedDuration | expectedNumberOfDataNodes - 'top element' | '/openroadm-devices' || 3.0 | OPENROADM_ANCHORS * (OPENROADM_DEVICES_PER_ANCHOR * OPENROADM_DATANODES_PER_DEVICE + 1) - 'leaf condition' | '//openroadm-device[@ne-state="inservice"]' || 3.1 | OPENROADM_ANCHORS * (OPENROADM_DEVICES_PER_ANCHOR * OPENROADM_DATANODES_PER_DEVICE) - 'ancestors' | '//openroadm-device/ancestor::openroadm-devices' || 3.2 | OPENROADM_ANCHORS * (OPENROADM_DEVICES_PER_ANCHOR * OPENROADM_DATANODES_PER_DEVICE + 1) - 'leaf condition + ancestors' | '//openroadm-device[@status="success"]/ancestor::openroadm-devices' || 3.0 | OPENROADM_ANCHORS * (OPENROADM_DEVICES_PER_ANCHOR * OPENROADM_DATANODES_PER_DEVICE + 1) + scenario | cpspath | additionalDataNodesPerDevice || expectedDuration + 'top element' | '/openroadm-devices' | 1 || 3.0 + 'leaf condition' | '//openroadm-device[@ne-state="inservice"]' | 0 || 3.1 + 'ancestors' | '//openroadm-device/ancestor::openroadm-devices' | 1 || 3.2 + 'leaf condition + ancestors' | '//openroadm-device[@status="success"]/ancestor::openroadm-devices' | 1 || 3.0 } def 'Query with leaf condition and #scenario.'() { + given: 'expected number of data nodes to be returned' + def expectedTotalNumberOfDataNodes = OPENROADM_DEVICES_PER_ANCHOR * expectedDataNodesPerDevice when: 'query data nodes (using a fresh anchor with identical data for each test)' resourceMeter.start() def result = objectUnderTest.queryDataNodes(CPS_PERFORMANCE_TEST_DATASPACE, 'openroadm2', '//openroadm-device[@status="success"]', fetchDescendantsOption) resourceMeter.stop() def durationInSeconds = resourceMeter.getTotalTimeInSeconds() then: 'the expected number of nodes is returned' - assert countDataNodesInTree(result) == expectedNumberOfDataNodes + assert countDataNodesInTree(result) == expectedTotalNumberOfDataNodes and: 'all data is read #expectedDuration seconds with a margin of 100%' recordAndAssertResourceUsage("CPS:Query with ${scenario}", expectedDuration, durationInSeconds, resourceMeter.getTotalMemoryUsageInMB()) where: 'the following parameters are used' - scenario | fetchDescendantsOption || expectedDuration | expectedNumberOfDataNodes - 'no descendants' | OMIT_DESCENDANTS || 0.09 | OPENROADM_DEVICES_PER_ANCHOR - 'direct descendants' | DIRECT_CHILDREN_ONLY || 0.12 | OPENROADM_DEVICES_PER_ANCHOR * 2 - 'all descendants' | INCLUDE_ALL_DESCENDANTS || 1.05 | OPENROADM_DEVICES_PER_ANCHOR * OPENROADM_DATANODES_PER_DEVICE + scenario | fetchDescendantsOption || expectedDataNodesPerDevice | expectedDuration + 'no descendants' | OMIT_DESCENDANTS || 1 | 0.10 + 'direct descendants' | DIRECT_CHILDREN_ONLY || 2 | 0.15 + 'all descendants' | INCLUDE_ALL_DESCENDANTS || OPENROADM_DATANODES_PER_DEVICE | 1.10 } def 'Query ancestors with #scenario.'() {