From eea631e045c01a35ccbd598f5529df21570a9c5c Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Wed, 15 Nov 2023 20:38:05 +0300 Subject: [PATCH] Add documentation for mergeLaunches method --- CHANGELOG.md | 10 ++++---- README.md | 66 +++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 57 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dfa1e0..2f2a2d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,16 @@ ### Added -- Logging link to the launch on the launch finish +- Logging link to the launch on its finish. ## [5.0.14] - 2023-10-05 ### Added -- `Promise.allSettled` polyfill to support NodeJS 10 +- `Promise.allSettled` polyfill to support NodeJS 10. ### Fixed -- Reporting is down on error with collect request on reporting start -- Can not read property `realId` of undefined during reporting, resolves [#99](https://github.com/reportportal/agent-js-playwright/issues/99) +- Reporting is down on error with collect request on reporting start. +- Can not read property `realId` of undefined during reporting, resolves [#99](https://github.com/reportportal/agent-js-playwright/issues/99). ## [5.0.13] - 2023-08-28 ### Added -- `launchUuidPrint` and `launchUuidPrintOutput` configuration options to ease integration with CI tools, by @HardNorth +- `launchUuidPrint` and `launchUuidPrintOutput` configuration options to ease integration with CI tools, by @HardNorth. ## [5.0.12] - 2023-06-19 ### Changed diff --git a/README.md b/README.md index 2c59d52..b756314 100644 --- a/README.md +++ b/README.md @@ -52,19 +52,19 @@ rpClient.checkConnect().then((response) => { When creating a client instance, you need to specify the following options: -| Option | Necessity | Default | Description | -|-----------------------|------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| apiKey | Required | | User's reportportal token from which you want to send requests. It can be found on the profile page of this user. | -| endpoint | Required | | URL of your server. For example, if you visit the page at 'https://server:8080/ui', then endpoint will be equal to 'https://server:8080/api/v1'. | -| launch | Required | | Name of launch at creation. | -| project | Required | | The name of the project in which the launches will be created. | -| headers | Optional | {} | The object with custom headers for internal http client. | -| debug | Optional | false | This flag allows seeing the logs of the client. Useful for debugging. | -| isLaunchMergeRequired | Optional | false | Allows client to merge launches into one at the end of the run via saving their UUIDs to the file system. At the end of the run launches can be merged using `mergeLaunches` method. | -| restClientConfig | Optional | Not set | The object with `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, may contain other client options eg. `timeout`. | -| launchUuidPrint | Optional | false | Whether to print the current launch UUID. | -| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR'. Works only if `launchUuidPrint` set to `true`. | -| token | Deprecated | Not set | Use `apiKey` instead. | +| Option | Necessity | Default | Description | +|-----------------------|------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| apiKey | Required | | User's reportportal token from which you want to send requests. It can be found on the profile page of this user. | +| endpoint | Required | | URL of your server. For example, if you visit the page at 'https://server:8080/ui', then endpoint will be equal to 'https://server:8080/api/v1'. | +| launch | Required | | Name of the launch at creation. | +| project | Required | | The name of the project in which the launches will be created. | +| headers | Optional | {} | The object with custom headers for internal http client. | +| debug | Optional | false | This flag allows seeing the logs of the client. Useful for debugging. | +| isLaunchMergeRequired | Optional | false | Allows client to merge launches into one at the end of the run via saving their UUIDs to the temp files at filesystem . At the end of the run launches can be merged using `mergeLaunches` method. Temp file format: `rplaunch-${launch_uuid}.tmp`. | +| restClientConfig | Optional | Not set | The object with `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, may contain other client options eg. `timeout`. | +| launchUuidPrint | Optional | false | Whether to print the current launch UUID. | +| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR'. Works only if `launchUuidPrint` set to `true`. | +| token | Deprecated | Not set | Use `apiKey` instead. | ## Asynchronous reporting @@ -130,7 +130,7 @@ The method takes one argument: | Option | Necessity | Default | Description | |-------------|-----------|----------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------| -| startTime | Optional | rpClient.helpers.now() | (optional) start time launch(unix time). | +| startTime | Optional | rpClient.helpers.now() | Start time of the launch (unix time). | | name | Optional | parameter 'launch' specified when creating the client instance | Name of the launch. | | mode | Optional | 'DEFAULT' | 'DEFAULT' - results will be submitted to Launches page, 'DEBUG' - results will be submitted to Debug page. | | description | Optional | '' | Description of the launch (supports markdown syntax). | @@ -338,6 +338,44 @@ The method takes three arguments: | type | Required | | The file mimeType, example 'image/png' (support types: 'image/*', application/['xml', 'javascript', 'json', 'css', 'php'], other formats will be opened in reportportal in a new browser tab only). | | content | Required | | base64 encoded file content. | +### mergeLaunches + +`mergeLaunches` - merges already completed runs into one (useful when running tests in multiple threads on the same machine). + +**Note:** Works only if `isLaunchMergeRequired` option is set to `true`. + +```javascript +rpClient.mergeLaunches({ + description: 'Regression tests', + attributes: [ + { + key: 'build', + value: '1.0.0' + } + ], + endTime: rpClient.helpers.now(), + extendSuitesDescription: false, + launches: [1, 2, 3], + mergeType: 'BASIC', + mode: 'DEFAULT', + name: 'Launch name', +}) +``` +The method takes one argument: + +* merge options object (optional): + +| Option | Necessity | Default | Description | +|-------------------------|-----------|-----------------------------------------|------------------------------------------------------------------------------------------------------------| +| description | Optional | config.description or 'Merged launch' | Description of the launch (supports markdown syntax). | +| attributes | Optional | config.attributes or [] | Array of launch attributes (tags). | +| endTime | Optional | rpClient.helpers.now() | End time of the launch (unix time) | +| extendSuitesDescription | Optional | true | Whether to extend suites description or not. | +| launches | Optional | ids of the launches saved to filesystem | The array of the real launch ids, not UUIDs | +| mergeType | Optional | 'BASIC' | The type of the merge operation. Possible values are 'BASIC' or 'DEEP'. | +| mode | Optional | config.mode or 'DEFAULT' | 'DEFAULT' - results will be submitted to Launches page, 'DEBUG' - results will be submitted to Debug page. | +| name | Optional | config.launch or 'Test launch name' | Name of the launch after merge. | + # Copyright Notice Licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.html)