Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for mergeLaunches method #181

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
66 changes: 52 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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). |
Expand Down Expand Up @@ -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)
Expand Down
Loading