diff options
Diffstat (limited to 'integration-test/src/test')
-rw-r--r-- | integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsAdminServiceLimitsPerfTest.groovy (renamed from integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsAdminServiceLimits.groovy) | 2 | ||||
-rw-r--r-- | integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimitsPerfTest.groovy (renamed from integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimits.groovy) | 2 | ||||
-rw-r--r-- | integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeletePerfTest.groovy | 20 | ||||
-rw-r--r-- | integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/GetPerfTest.groovy | 21 | ||||
-rw-r--r-- | integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy | 1 |
5 files changed, 39 insertions, 7 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsAdminServiceLimits.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsAdminServiceLimitsPerfTest.groovy index 0034af453b..9ea7a7b53a 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsAdminServiceLimits.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsAdminServiceLimitsPerfTest.groovy @@ -23,7 +23,7 @@ package org.onap.cps.integration.performance.cps import org.onap.cps.api.CpsAdminService import org.onap.cps.integration.performance.base.CpsPerfTestBase -class CpsAdminServiceLimits extends CpsPerfTestBase { +class CpsAdminServiceLimitsPerfTest extends CpsPerfTestBase { CpsAdminService objectUnderTest diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimits.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimitsPerfTest.groovy index 1579470eab..e0df2fee77 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimits.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimitsPerfTest.groovy @@ -27,7 +27,7 @@ import org.onap.cps.spi.exceptions.DataNodeNotFoundException import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS -class CpsDataServiceLimits extends CpsPerfTestBase { +class CpsDataServiceLimitsPerfTest extends CpsPerfTestBase { CpsDataService objectUnderTest diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeletePerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeletePerfTest.groovy index db36b8809b..e80a87d509 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeletePerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeletePerfTest.groovy @@ -20,6 +20,8 @@ package org.onap.cps.integration.performance.cps +import org.onap.cps.spi.exceptions.DataNodeNotFoundException + import java.time.OffsetDateTime import org.onap.cps.api.CpsDataService import org.onap.cps.integration.performance.base.CpsPerfTestBase @@ -34,7 +36,7 @@ class DeletePerfTest extends CpsPerfTestBase { when: 'multiple anchors with a node with a large number of descendants is created' stopWatch.start() def data = generateOpenRoadData(50) - addAnchorsWithData(9, CPS_PERFORMANCE_TEST_DATASPACE, LARGE_SCHEMA_SET, 'delete', data) + addAnchorsWithData(10, CPS_PERFORMANCE_TEST_DATASPACE, LARGE_SCHEMA_SET, 'delete', data) stopWatch.stop() def setupDurationInMillis = stopWatch.getTotalTimeMillis() then: 'setup duration is under 40 seconds' @@ -155,9 +157,23 @@ class DeletePerfTest extends CpsPerfTestBase { recordAndAssertPerformance('Delete data nodes for anchor', 300, deleteDurationInMillis) } + def 'Batch delete 100 non-existing nodes'() { + given: 'a list of xpaths to delete' + def xpathsToDelete = (1..100).collect { "/path/to/non-existing/node[@id='" + it + "']" } + when: 'child nodes are deleted' + stopWatch.start() + try { + objectUnderTest.deleteDataNodes(CPS_PERFORMANCE_TEST_DATASPACE, 'delete10', xpathsToDelete, OffsetDateTime.now()) + } catch (DataNodeNotFoundException ignored) {} + stopWatch.stop() + def deleteDurationInMillis = stopWatch.getTotalTimeMillis() + then: 'delete duration is under 300 milliseconds' + recordAndAssertPerformance('Batch delete 100 non-existing', 300, deleteDurationInMillis) + } + def 'Clean up test data'() { given: 'a list of anchors to delete' - def anchorNames = (1..9).collect {'delete' + it} + def anchorNames = (1..10).collect {'delete' + it} when: 'data nodes are deleted' stopWatch.start() cpsAdminService.deleteAnchors(CPS_PERFORMANCE_TEST_DATASPACE, anchorNames) diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/GetPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/GetPerfTest.groovy index 8323ef9f84..f6ca5fcc1e 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/GetPerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/GetPerfTest.groovy @@ -44,7 +44,7 @@ class GetPerfTest extends CpsPerfTestBase { recordAndAssertPerformance("Read datatrees with ${scenario}", durationLimit, durationInMillis) where: 'the following parameters are used' scenario | fetchDescendantsOption | anchor || durationLimit | expectedNumberOfDataNodes - 'no descendants' | OMIT_DESCENDANTS | 'openroadm1' || 50 | 1 + 'no descendants' | OMIT_DESCENDANTS | 'openroadm1' || 20 | 1 'direct descendants' | DIRECT_CHILDREN_ONLY | 'openroadm2' || 100 | 1 + 50 'all descendants' | INCLUDE_ALL_DESCENDANTS | 'openroadm3' || 200 | 1 + 50 * 86 } @@ -56,12 +56,27 @@ class GetPerfTest extends CpsPerfTestBase { stopWatch.start() def result = objectUnderTest.getDataNodesForMultipleXpaths(CPS_PERFORMANCE_TEST_DATASPACE, 'openroadm4', xpaths, INCLUDE_ALL_DESCENDANTS) stopWatch.stop() - assert countDataNodesInTree(result) == 50 * 86 def durationInMillis = stopWatch.getTotalTimeMillis() - then: 'all data is read within 500 ms' + then: 'requested nodes and their descendants are returned' + assert countDataNodesInTree(result) == 50 * 86 + and: 'all data is read within 200 ms' recordAndAssertPerformance("Read datatrees for multiple xpaths", 200, durationInMillis) } + def 'Read for multiple xpaths to non-existing datanodes'() { + given: 'a collection of xpaths to get' + def xpaths = (1..50).collect { "/path/to/non-existing/node[@id='" + it + "']" } + when: 'get data nodes from 1 anchor' + stopWatch.start() + def result = objectUnderTest.getDataNodesForMultipleXpaths(CPS_PERFORMANCE_TEST_DATASPACE, 'openroadm4', xpaths, INCLUDE_ALL_DESCENDANTS) + stopWatch.stop() + def durationInMillis = stopWatch.getTotalTimeMillis() + then: 'no data is returned' + assert result.isEmpty() + and: 'the operation completes within within 20 ms' + recordAndAssertPerformance("Read non-existing xpaths", 20, durationInMillis) + } + def 'Read complete data trees using #scenario.'() { when: 'get data nodes for 5 anchors' stopWatch.start() 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 bad3f8afd2..78e0d01bca 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 @@ -49,6 +49,7 @@ class QueryPerfTest extends CpsPerfTestBase { 'leaf condition' | 'openroadm2' | '//openroadm-device[@ne-state="inservice"]' || 200 | 50 * 86 'ancestors' | 'openroadm3' | '//openroadm-device/ancestor::openroadm-devices' || 120 | 50 * 86 + 1 'leaf condition + ancestors' | 'openroadm4' | '//openroadm-device[@status="success"]/ancestor::openroadm-devices' || 120 | 50 * 86 + 1 + 'non-existing data' | 'openroadm1' | '/path/to/non-existing/node[@id="1"]' || 10 | 0 } def 'Query complete data trees across all anchors with #scenario.'() { |