X-Git-Url: https://gerrit.onap.org/r/gitweb?p=cps.git;a=blobdiff_plain;f=integration-test%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fintegration%2Fperformance%2Fcps%2FModuleQueryPerfTest.groovy;h=add931a1ad427bd7c624f4859a997f6a78e91d82;hp=6efebd4eaff11d43a32f8fa66251be3939eb65dd;hb=refs%2Fheads%2Fmaster;hpb=2b979f63a4020b65a2a85ecdb2bfa2b970eb9f76 diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/ModuleQueryPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/ModuleQueryPerfTest.groovy index 6efebd4eaf..44bf812bb9 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/ModuleQueryPerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/ModuleQueryPerfTest.groovy @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ package org.onap.cps.integration.performance.cps import org.onap.cps.integration.performance.base.CpsPerfTestBase -import org.onap.cps.spi.model.ModuleReference +import org.onap.cps.api.model.ModuleReference class ModuleQueryPerfTest extends CpsPerfTestBase { @@ -70,10 +70,7 @@ class ModuleQueryPerfTest extends CpsPerfTestBase { } resourceMeter.stop() then: 'operation takes less than expected duration' - recordAndAssertResourceUsage('Module query test setup', - 45, resourceMeter.totalTimeInSeconds, - 500, resourceMeter.totalMemoryUsageInMB - ) + recordAndAssertResourceUsage('CPS:Module query test setup', 150, resourceMeter.totalTimeInSeconds, resourceMeter.totalMemoryUsageInMB) } def 'Querying anchors by module name is NOT dependant on the file size of the module.'() { @@ -84,13 +81,11 @@ class ModuleQueryPerfTest extends CpsPerfTestBase { then: 'expected number of anchors is returned' assert result.size() == TOTAL_TEST_ANCHORS and: 'operation completes with expected resource usage' - recordAndAssertResourceUsage("Query for anchors with ${scenario}", - expectedTimeInSeconds, resourceMeter.totalTimeInSeconds, - 150, resourceMeter.totalMemoryUsageInMB) + recordAndAssertResourceUsage("CPS:Query for anchors with ${scenario}", 0.1, resourceMeter.totalTimeInSeconds, resourceMeter.totalMemoryUsageInMB, REFERENCE_GRAPH) where: 'the following parameters are used' - scenario | yangModuleName || expectedTimeInSeconds - '1 KB module' | 'module0' || 3 - '1000 KB module' | 'module1' || 3 + scenario | yangModuleName + '1 KB module' | 'module0' + '1000 KB module' | 'module1' } def 'Module query - Clean up test data.'() { @@ -100,6 +95,7 @@ class ModuleQueryPerfTest extends CpsPerfTestBase { cpsModuleService.deleteSchemaSetsWithCascade(CPS_PERFORMANCE_TEST_DATASPACE, (i..i+100).collect {SCHEMA_SET_PREFIX + it}) } cpsModuleService.deleteSchemaSetsWithCascade(CPS_PERFORMANCE_TEST_DATASPACE, [SCHEMA_SET_PREFIX + '0']) + cpsModuleService.deleteAllUnusedYangModuleData(CPS_PERFORMANCE_TEST_DATASPACE) } // This makes a Yang module of approximately target length in bytes by padding the description field with many '*'