Update batch id searches to return alternate ids 12/140612/3
authorhalil.cakal <halil.cakal@est.tech>
Thu, 27 Mar 2025 11:13:03 +0000 (11:13 +0000)
committerhalil.cakal <halil.cakal@est.tech>
Tue, 1 Apr 2025 09:58:36 +0000 (10:58 +0100)
- keep the query parameter (?outputAlternateId=true) common for id-searches and searches
  since it does not have any negative impact for the searches when provided this way the code
  is more simple and readable
- function names kept the same to comply with the response messages
- the plot names kept the same to maintain the history in local storage of kpi plot job

Issue-ID: CPS-2715

Change-Id: I8146e7ecb04ddd4b907fae94e91fd78bd535b58c
Signed-off-by: halil.cakal <halil.cakal@est.tech>
k6-tests/ncmp/common/search-base.js
k6-tests/ncmp/ncmp-test-runner.js

index af7d153..91369e8 100644 (file)
@@ -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.
@@ -31,7 +31,7 @@ export function executeCmHandleIdSearch(scenario) {
 function executeSearchRequest(searchType, scenario) {
     const searchParameters = SEARCH_PARAMETERS_PER_SCENARIO[scenario];
     const payload = JSON.stringify(searchParameters);
-    const url = `${NCMP_BASE_URL}/ncmp/v1/ch/${searchType}`;
+    const url = `${NCMP_BASE_URL}/ncmp/v1/ch/${searchType}?outputAlternateId=true`;
     return performPostRequest(url, payload, searchType);
 }
 
index b8fccdd..1104b14 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024-2025 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.
@@ -119,7 +119,7 @@ export function passthroughWriteAltIdScenario() {
 export function cmHandleIdSearchNoFilterScenario() {
     const response = executeCmHandleIdSearch('no-filter');
     if (check(response, { 'CM handle ID no-filter search status equals 200': (r) => r.status === 200 })
-     && check(response, { 'CM handle ID no-filter search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
+     && check(response, { 'CM handle ID no-filter search returned the correct number of ids': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
         idSearchNoFilterDurationTrend.add(response.timings.duration);
     }
 }
@@ -135,7 +135,7 @@ export function cmHandleSearchNoFilterScenario() {
 export function cmHandleIdSearchModuleScenario() {
     const response = executeCmHandleIdSearch('module');
     if (check(response, { 'CM handle ID module search status equals 200': (r) => r.status === 200 })
-     && check(response, { 'CM handle ID module search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
+     && check(response, { 'CM handle ID module search returned the correct number of ids': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
         idSearchModuleDurationTrend.add(response.timings.duration);
     }
 }
@@ -151,7 +151,7 @@ export function cmHandleSearchModuleScenario() {
 export function cmHandleIdSearchPropertyScenario() {
     const response = executeCmHandleIdSearch('property');
     if (check(response, { 'CM handle ID property search status equals 200': (r) => r.status === 200 })
-     && check(response, { 'CM handle ID property search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
+     && check(response, { 'CM handle ID property search returned the correct number of ids': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
         idSearchPropertyDurationTrend.add(response.timings.duration);
     }
 }
@@ -167,7 +167,7 @@ export function cmHandleSearchPropertyScenario() {
 export function cmHandleIdSearchCpsPathScenario() {
     const response = executeCmHandleIdSearch('cps-path-for-ready-cm-handles');
     if (check(response, { 'CM handle ID cps path search status equals 200': (r) => r.status === 200 })
-     && check(response, { 'CM handle ID cps path search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
+     && check(response, { 'CM handle ID cps path search returned the correct number of ids': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
         idSearchCpsPathDurationTrend.add(response.timings.duration);
     }
 }
@@ -183,7 +183,7 @@ export function cmHandleSearchCpsPathScenario() {
 export function cmHandleIdSearchTrustLevelScenario() {
     const response = executeCmHandleIdSearch('trust-level');
     if (check(response, { 'CM handle ID trust level search status equals 200': (r) => r.status === 200 })
-     && check(response, { 'CM handle ID trust level search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
+     && check(response, { 'CM handle ID trust level search returned the correct number of ids': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
         idSearchTrustLevelDurationTrend.add(response.timings.duration);
     }
 }