From 01ec3df9a99721dd8576cfbf90e97d0cd3480e68 Mon Sep 17 00:00:00 2001 From: Tri Hoang Date: Fri, 17 May 2024 11:07:18 +0700 Subject: [PATCH 1/2] chore: Update launch search URL based on config mode --- lib/report-portal-client.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/report-portal-client.js b/lib/report-portal-client.js index be95cee..00826bc 100644 --- a/lib/report-portal-client.js +++ b/lib/report-portal-client.js @@ -319,6 +319,7 @@ class RPClient { * "description": string, * "mergeType": 'BASIC' | 'DEEP', * "name": string + * "mode": 'DEBUG' || 'DEFAULT', * } * Please, keep in mind that this method is work only in case * the option isLaunchMergeRequired is true. @@ -332,7 +333,16 @@ class RPClient { 'filter.in.uuid': launchUUIds, 'page.size': launchUUIds.length, }); - const launchSearchUrl = `launch?${params.toString()}`; + let launchSearchUrl + switch (this.config.mode) { + case 'DEBUG': + launchSearchUrl = `launch/mode?${params.toString()}`; + break; + default: + launchSearchUrl = `launch?${params.toString()}`; + } + + this.logDebug(`Find launches with UUIDs to merge: ${launchUUIds}`); return this.restClient .retrieveSyncAPI(launchSearchUrl, { headers: this.headers }) From e605842c290f63702eface97dc3383b42a30364c Mon Sep 17 00:00:00 2001 From: Tri Hoang Date: Fri, 17 May 2024 21:11:04 +0700 Subject: [PATCH 2/2] Update launch search URL based on config mode --- lib/report-portal-client.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/report-portal-client.js b/lib/report-portal-client.js index 00826bc..813225a 100644 --- a/lib/report-portal-client.js +++ b/lib/report-portal-client.js @@ -333,16 +333,8 @@ class RPClient { 'filter.in.uuid': launchUUIds, 'page.size': launchUUIds.length, }); - let launchSearchUrl - switch (this.config.mode) { - case 'DEBUG': - launchSearchUrl = `launch/mode?${params.toString()}`; - break; - default: - launchSearchUrl = `launch?${params.toString()}`; - } - - + const launchSearchUrl = mergeOptions.mode === 'DEBUG' || this.config.mode === 'DEBUG' ? + `launch/mode?${params.toString()}` : `launch?${params.toString()}`; this.logDebug(`Find launches with UUIDs to merge: ${launchUUIds}`); return this.restClient .retrieveSyncAPI(launchSearchUrl, { headers: this.headers })