Skip to content

Commit

Permalink
Merge pull request #199 from reportportal/develop
Browse files Browse the repository at this point in the history
Release 5.1.3
  • Loading branch information
AmsterGet authored Apr 11, 2024
2 parents 02b7d16 + fd27525 commit f6ec78b
Show file tree
Hide file tree
Showing 14 changed files with 219 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @AmsterGet
* @AmsterGet @AliakseiLiasnitski
6 changes: 3 additions & 3 deletions .github/workflows/CI-pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 EPAM Systems
# Copyright 2024 EPAM Systems
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -34,10 +34,10 @@ jobs:
node: [12, 14, 16, 18, 20]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 EPAM Systems
# Copyright 2024 EPAM Systems
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -22,9 +22,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install of node dependencies
Expand All @@ -41,9 +41,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
Expand All @@ -57,7 +57,7 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Added
- Output launch UUID to file and ENV variable, thanks to [artsiomBandarenka](https://github.com/artsiomBandarenka). Addressed [#195](https://github.com/reportportal/client-javascript/issues/195), [#50](https://github.com/reportportal/agent-js-webdriverio/issues/50).
### Security
- Updated versions of vulnerable packages (follow-redirects).

## [5.1.2] - 2024-02-20
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ When creating a client instance, you need to specify the following options:
| 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 | `axios` like http client [config](https://github.com/axios/axios#request-config). May contain `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, and other client options eg. `timeout`. For debugging and displaying logs you can set `debug: true`. |
| 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`. |
| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR', 'FILE', 'ENVIRONMENT'. Works only if `launchUuidPrint` set to `true`. File format: `rp-launch-uuid-${launch_uuid}.tmp`. Env variable: `RP_LAUNCH_UUID`. |
| token | Deprecated | Not set | Use `apiKey` instead. |

## Asynchronous reporting
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.2
5.1.3-SNAPSHOT
9 changes: 7 additions & 2 deletions lib/constants/outputs.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
const helpers = require('../helpers');

const OUTPUT_TYPES = {
// eslint-disable-next-line no-console
STDOUT: console.log,
STDOUT: (launchUuid) => console.log(`Report Portal Launch UUID: ${launchUuid}`),
// eslint-disable-next-line no-console
STDERR: console.error,
STDERR: (launchUuid) => console.error(`Report Portal Launch UUID: ${launchUuid}`),
// eslint-disable-next-line no-return-assign
ENVIRONMENT: (launchUuid) => (process.env.RP_LAUNCH_UUID = launchUuid),
FILE: helpers.saveLaunchUuidToFile,
};

module.exports = { OUTPUT_TYPES };
9 changes: 9 additions & 0 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,13 @@ module.exports = {

return `${codeRef}[${parameters}]`;
},

saveLaunchUuidToFile(launchUuid) {
const filename = `rp-launch-uuid-${launchUuid}.tmp`;
fs.open(filename, 'w', (err) => {
if (err) {
throw err;
}
});
},
};
19 changes: 0 additions & 19 deletions lib/polyfills.js

This file was deleted.

3 changes: 1 addition & 2 deletions lib/report-portal-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const { getClientConfig } = require('./commons/config');
const Statistics = require('../statistics/statistics');
const { EVENT_NAME } = require('../statistics/constants');
const { RP_STATUSES } = require('./constants/statuses');
require('./polyfills');

const MULTIPART_BOUNDARY = Math.floor(Math.random() * 10000000000).toString();

Expand Down Expand Up @@ -207,7 +206,7 @@ class RPClient {
this.map[tempId].realId = response.id;
this.launchUuid = response.id;
if (this.config.launchUuidPrint) {
this.config.launchUuidPrintOutput(`Report Portal Launch UUID: ${this.launchUuid}`);
this.config.launchUuidPrintOutput(this.launchUuid);
}

if (this.isLaunchMergeRequired) {
Expand Down
146 changes: 124 additions & 22 deletions package-lock.json

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

Loading

0 comments on commit f6ec78b

Please sign in to comment.