Skip to content

Commit

Permalink
Merge pull request #105 from reportportal/develop
Browse files Browse the repository at this point in the history
5.0.4 Release
  • Loading branch information
AmsterGet authored Apr 29, 2021
2 parents 541bce8 + b2f5b8f commit f354502
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 24 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
### Added
- Timeout (default is 5000ms) on Axios Requests
### Fixed
- Security vulnerabilities ([axios](https://github.com/reportportal/client-javascript/issues/109))
- [Issue](https://github.com/reportportal/client-javascript/issues/94) with the finish of a non-existent test item

## [5.0.3] - 2020-11-09

### Added
- Environment variable

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Library is used only for implementors of custom listeners for ReportPortal.
* [Nightwatch integration](https://github.com/reportportal/agent-js-nightwatch)
* [Cucumber integration](https://github.com/reportportal/agent-js-cucumber)
* [Codecept integration](https://github.com/reportportal/agent-js-codecept)
* [Postman integration](https://github.com/reportportal/agent-js-postman)

Examples for test framework integrations from the list above described in [examples](https://github.com/reportportal/examples-js) repository.

Expand Down Expand Up @@ -78,6 +79,9 @@ rpClient.checkConnect().then((response) => {
});
```

### timeout (5000ms) on axios requests
There is a timeout on axios requests. If for instance the server your making a request to is taking too long to load, then axios timeout will work and you will see the error "Error: timeout of 5000ms exceeded".

### startLaunch
startLaunch - starts a new launch, return temp id that you want to use for all of the items within this launch.
```javascript
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.3
5.0.4-SNAPSHOT
2 changes: 1 addition & 1 deletion lib/report-portal-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ class RPClient {
}, itemObj.children.length ? {} : { status: RP_STATUSES.PASSED }, finishTestItemRQ);

itemObj.finishSend = true;
Promise.all(itemObj.children.map(itemId => this.map[itemId].promiseFinish))
Promise.all(itemObj.children.map(itemId => this.map[itemId] && this.map[itemId].promiseFinish))
.then(() => {
this.cleanMap(itemObj.children);
this.finishTestItemPromiseStart(itemObj,
Expand Down
5 changes: 4 additions & 1 deletion lib/rest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const axios = require('axios');
const axiosRetry = require('axios-retry');

const DEFAULT_MAX_CONNECTION_TIME_MS = 5000;

axiosRetry(axios, { retryDelay: () => 100, retries: 10, retryCondition: axiosRetry.isRetryableError });

class RestClient {
Expand All @@ -21,8 +23,9 @@ class RestClient {
return axios({
method,
url,
headers: options.headers,
data,
timeout: DEFAULT_MAX_CONNECTION_TIME_MS,
...options,
})
.then(response => response.data)
.catch((error) => {
Expand Down
29 changes: 10 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"node": ">= 8.0.x"
},
"dependencies": {
"axios": "^0.18.1",
"axios": "^0.21.1",
"axios-retry": "^3.1.2",
"glob": "^7.1.4",
"uniqid": "^5.0.3",
Expand Down

0 comments on commit f354502

Please sign in to comment.