From: Arpit Singh Date: Wed, 10 Dec 2025 05:13:38 +0000 (+0530) Subject: Isolate Delta Report performance test data X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=3552a78f707abf65958dc69f9985d03b938d603e;p=cps.git Isolate Delta Report performance test data - Delta report performance tests shared openroadm anchor with other performance tests in CPS. - The patch removes the use of openroadm anchors for Delta Report performance tests. - Delta Report performance tests now use two independent anchors as source and target: delta-report-anchor and openroadm-modified. - Both the anchors are deleted once the Delta Report tests finish executing. - Removed @Ignore from first Delta Report test to check if there is any impact on other CPS performance tests. Issue-ID: CPS-3092 Change-Id: Ib1107329973d58cb4b90091f4983d3f42e07a3d7 Signed-off-by: Arpit Singh --- diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeltaPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeltaPerfTest.groovy index bba7027b86..5a2555285a 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeltaPerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeltaPerfTest.groovy @@ -38,23 +38,33 @@ class DeltaPerfTest extends CpsPerfTestBase{ def jsonPayload = generateModifiedOpenRoadData(1000, 200, 200, 200) - def 'Setup test anchor (please note, subsequent tests depend on this running first).'() { + def 'Setup source anchor (please note, subsequent tests depend on this running first).'() { + when: 'anchor is created' + resourceMeter.start() + def data = generateOpenRoadData(300) + addAnchorsWithData(1, CPS_PERFORMANCE_TEST_DATASPACE, LARGE_SCHEMA_SET, 'source-anchor', data, ContentType.JSON) + resourceMeter.stop() + def durationInSeconds = resourceMeter.getTotalTimeInSeconds() + then: 'setup duration is below accepted margin of the expected average' + recordAndAssertResourceUsage('CPS: Delta test setup', 20, durationInSeconds, resourceMeter.getTotalMemoryUsageInMB(), false) + } + + def 'Setup target anchor (please note, subsequent tests depend on this running first).'() { when: 'anchor with modified node data is created' resourceMeter.start() def data = generateModifiedOpenRoadData(OPENROADM_DEVICES_PER_ANCHOR, 200, 200, 200) - addAnchorsWithData(1, CPS_PERFORMANCE_TEST_DATASPACE, LARGE_SCHEMA_SET, 'openroadm-modified', data, ContentType.JSON) + addAnchorsWithData(1, CPS_PERFORMANCE_TEST_DATASPACE, LARGE_SCHEMA_SET, 'target-anchor', data, ContentType.JSON) resourceMeter.stop() def durationInSeconds = resourceMeter.getTotalTimeInSeconds() then: 'the anchor is created within expected time' recordAndAssertResourceUsage('CPS: Creating modified openroadm anchor', 25, durationInSeconds, resourceMeter.getTotalMemoryUsageInMB(), false) } - @Ignore def 'Get delta between 2 anchors with grouping enabled and #scenario'() { when: 'attempt to get delta between two 2 anchors' resourceMeter.start() 10.times { - objectUnderTest.getDeltaByDataspaceAndAnchors(CPS_PERFORMANCE_TEST_DATASPACE, 'openroadm1', 'openroadm-modified1', xpath, fetchDescendantsOption, true) + objectUnderTest.getDeltaByDataspaceAndAnchors(CPS_PERFORMANCE_TEST_DATASPACE, 'source-anchor1', 'target-anchor1', xpath, fetchDescendantsOption, true) } resourceMeter.stop() def durationInSeconds = resourceMeter.getTotalTimeInSeconds() @@ -72,7 +82,7 @@ class DeltaPerfTest extends CpsPerfTestBase{ when: 'attempt to get delta between two 2 anchors' resourceMeter.start() 10.times { - objectUnderTest.getDeltaByDataspaceAndAnchors(CPS_PERFORMANCE_TEST_DATASPACE, 'openroadm1', 'openroadm-modified1', xpath, fetchDescendantsOption, false) + objectUnderTest.getDeltaByDataspaceAndAnchors(CPS_PERFORMANCE_TEST_DATASPACE, 'source-anchor1', 'target-anchor1', xpath, fetchDescendantsOption, false) } resourceMeter.stop() def durationInSeconds = resourceMeter.getTotalTimeInSeconds() @@ -89,7 +99,7 @@ class DeltaPerfTest extends CpsPerfTestBase{ def 'Get delta between an anchor and JSON payload with grouping enabled and #scenario'() { when: 'attempt to get delta between an anchor and JSON payload' resourceMeter.start() - objectUnderTest.getDeltaByDataspaceAnchorAndPayload(CPS_PERFORMANCE_TEST_DATASPACE, 'openroadm1', '/openroadm-devices', Collections.emptyMap(), jsonPayload, fetchDescendantsOption, true) + objectUnderTest.getDeltaByDataspaceAnchorAndPayload(CPS_PERFORMANCE_TEST_DATASPACE, 'source-anchor1', '/openroadm-devices', Collections.emptyMap(), jsonPayload, fetchDescendantsOption, true) resourceMeter.stop() def durationInSeconds = resourceMeter.getTotalTimeInSeconds() then: 'the delta is returned and operation completes within expected time' @@ -105,7 +115,7 @@ class DeltaPerfTest extends CpsPerfTestBase{ def 'Get delta between an anchor and JSON payload with grouping disabled and #scenario'() { when: 'attempt to get delta between an anchor and JSON payload' resourceMeter.start() - objectUnderTest.getDeltaByDataspaceAnchorAndPayload(CPS_PERFORMANCE_TEST_DATASPACE, 'openroadm1', '/openroadm-devices', Collections.emptyMap(), jsonPayload, INCLUDE_ALL_DESCENDANTS, false) + objectUnderTest.getDeltaByDataspaceAnchorAndPayload(CPS_PERFORMANCE_TEST_DATASPACE, 'source-anchor1', '/openroadm-devices', Collections.emptyMap(), jsonPayload, INCLUDE_ALL_DESCENDANTS, false) resourceMeter.stop() def durationInSeconds = resourceMeter.getTotalTimeInSeconds() then: 'the delta is returned and operation completes within expected time' @@ -120,11 +130,11 @@ class DeltaPerfTest extends CpsPerfTestBase{ @Ignore def 'Apply delta report to an anchor'() { given: 'a delta report between 2 anchors' - def deltaReport = objectUnderTest.getDeltaByDataspaceAndAnchors(CPS_PERFORMANCE_TEST_DATASPACE, 'openroadm-modified1', 'openroadm1', '/openroadm-devices', INCLUDE_ALL_DESCENDANTS, true) + def deltaReport = objectUnderTest.getDeltaByDataspaceAndAnchors(CPS_PERFORMANCE_TEST_DATASPACE, 'target-anchor1', 'source-anchor1', '/openroadm-devices', INCLUDE_ALL_DESCENDANTS, true) def deltaReportAsJson = jsonObjectMapper.asJsonString(deltaReport) when: 'attempt to apply the delta report to an anchor' resourceMeter.start() - objectUnderTest.applyChangesInDeltaReport(CPS_PERFORMANCE_TEST_DATASPACE, 'openroadm-modified1', deltaReportAsJson) + objectUnderTest.applyChangesInDeltaReport(CPS_PERFORMANCE_TEST_DATASPACE, 'target-anchor1', deltaReportAsJson) resourceMeter.stop() def durationInSeconds = resourceMeter.getTotalTimeInSeconds() then: 'the delta is applied and operation completes within expected time' @@ -133,8 +143,9 @@ class DeltaPerfTest extends CpsPerfTestBase{ def 'Clean up test data'() { when: 'anchor is deleted' + def anchorNames = ['source-anchor1', 'target-anchor1'] resourceMeter.start() - cpsAnchorService.deleteAnchor(CPS_PERFORMANCE_TEST_DATASPACE, 'openroadm-modified1') + cpsAnchorService.deleteAnchors(CPS_PERFORMANCE_TEST_DATASPACE, anchorNames) resourceMeter.stop() def durationInSeconds = resourceMeter.getTotalTimeInSeconds() then: 'delete duration is below accepted margin of the expected average'