Skip to content

Commit

Permalink
Print UUID after merging launches. Update launch search URL based on …
Browse files Browse the repository at this point in the history
…config mode (#203)

* chore: Update launch search URL based on config mode

* feat: Add launch UUID print functionality

The code changes in `report-portal-client.js` add functionality to print the UUID of the merged launches if the `launchUuidPrint` configuration option is enabled. This is achieved by calling the `launchUuidPrintOutput` function with the UUID as an argument.

* Update launch search URL based on config mode

* Update launch search URL based on config mode and fix type error

* Remove unused "mode" property of mergeLaunch method
  • Loading branch information
hoangthanhtri authored May 22, 2024
1 parent df9b00f commit ded610f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/report-portal-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ class RPClient {
'filter.in.uuid': launchUUIds,
'page.size': launchUUIds.length,
});
const launchSearchUrl = `launch?${params.toString()}`;
const launchSearchUrl = 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 })
Expand All @@ -353,8 +354,11 @@ class RPClient {
const mergeURL = 'launch/merge';
return this.restClient.create(mergeURL, request, { headers: this.headers });
})
.then(() => {
.then((response) => {
this.logDebug(`Launches with UUIDs: ${launchUUIds} were successfully merged!`);
if (this.config.launchUuidPrint) {
this.config.launchUuidPrintOutput(response.uuid);
}
})
.catch((error) => {
this.logDebug(`Error merging launches with UUIDs: ${launchUUIds}`, error);
Expand Down

0 comments on commit ded610f

Please sign in to comment.