From e871c361bf3b135913e6818fdac4acff49708a25 Mon Sep 17 00:00:00 2001 From: "halil.cakal" Date: Thu, 27 Mar 2025 11:13:03 +0000 Subject: [PATCH] Update batch id searches to return alternate ids - 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 --- k6-tests/ncmp/common/search-base.js | 4 ++-- k6-tests/ncmp/ncmp-test-runner.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/k6-tests/ncmp/common/search-base.js b/k6-tests/ncmp/common/search-base.js index af7d153416..91369e818f 100644 --- a/k6-tests/ncmp/common/search-base.js +++ b/k6-tests/ncmp/common/search-base.js @@ -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); } diff --git a/k6-tests/ncmp/ncmp-test-runner.js b/k6-tests/ncmp/ncmp-test-runner.js index b8fccdd69c..1104b14e4a 100644 --- a/k6-tests/ncmp/ncmp-test-runner.js +++ b/k6-tests/ncmp/ncmp-test-runner.js @@ -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); } } -- 2.16.6