From d128a9209ef5e0b5dbe4d4d9c5d1c467a37a6595 Mon Sep 17 00:00:00 2001 From: "reportportal.io" Date: Thu, 15 Feb 2024 14:43:09 +0000 Subject: [PATCH 01/12] 5.0.0 -> 5.0.1-SNAPSHOT --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0062ac9..4f76215 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.0.0 +5.0.1-SNAPSHOT From 648abf9d8a4c9f5ad068958d12a8969493ff1cb3 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 16 Feb 2024 13:39:07 +0100 Subject: [PATCH 02/12] Update package.json --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index fe886a9..e1ac6c4 100644 --- a/package.json +++ b/package.json @@ -57,5 +57,11 @@ "reports", "portal", "epam" + ], + "contributors": [ + { + "name": "Ilya Hancharyk", + "email": "amsterget@gmail.com" + } ] } From 944e183dc7217079e7cd62f85effa0ede4d3d902 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 16 Feb 2024 18:51:10 +0100 Subject: [PATCH 03/12] Mention api/v2 in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68b446f..542dfcc 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ The full list of available options presented below. | 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 'https://server:8080/api/v1'. | +| endpoint | Required | | URL of your server. For example 'https://server:8080/api/v2'. | | launch | Required | | Name of launch at creation. | | project | Required | | The name of the project in which the launches will be created. | | attributes | Optional | [] | Launch attributes. | From 2b0e273eb098d409f6983d00887fb835ae0359ab Mon Sep 17 00:00:00 2001 From: AliakseiLiasnitski <40150869+AliakseiLiasnitski@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:40:34 +0300 Subject: [PATCH 04/12] EPMRPP-89644 || Implement attachments support (#14) * EPMRPP-89644 || Implement attachments support * EPMRPP-89644 || Update changelog * EPMRPP-89644 || Fix lint errors * EPMRPP-89644 || Fix lint errors * EPMRPP-89644 || Add description support for attach log * EPMRPP-89644 || Fix lint errors * EPMRPP-89644 || Code Review fixes - 1 * EPMRPP-89644 || Code Review fixes - 1 (fix lint errors) * EPMRPP-89644 || Code Review fixes - 2 --- CHANGELOG.md | 2 ++ README.md | 35 +++++++++++++++++++++++++++++++++++ src/index.ts | 4 ++-- src/models/index.ts | 4 ++++ src/models/reporting.ts | 15 ++++++++++++++- src/reporter.ts | 9 ++++++++- src/reportingApi.ts | 31 +++++++++++++++++++++++++++++++ src/types/interfaces.d.ts | 5 +++++ src/utils.ts | 6 +++++- 9 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 src/reportingApi.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 69fc153..e421edf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +### Added +- ReportingApi with attachment support ## [5.0.0] - 2024-02-15 ### Added diff --git a/README.md b/README.md index 542dfcc..5069fb0 100644 --- a/README.md +++ b/README.md @@ -94,3 +94,38 @@ console.error(); console's `log`, `info`,`dubug` reports as info log. console's `error`, `warn` reports as error log if message contains _error_ mention, otherwise as warn log. + +### Reporting API + +This reporter provides Reporting API to use it directly in tests to send some additional data to the report. + +To start using the `ReportingApi` in tests, just import it from `'@reportportal/agent-js-vitest'`: +```javascript +import { ReportingApi } from '@reportportal/agent-js-vitest'; +``` + +#### Reporting API methods + +The API provide methods for attaching data.
+ +##### attachment +Send file to ReportPortal for the current test. Should be called inside of corresponding test.
+`ReportingApi.attachment(task: vitest.Task, data: Attachment, description?: string);`
+**required**: `task`, `data`
+**optional**: `description`
+where `Attachment` type is `{name: string; type: string; content: string | Buffer;}`
+Example: +```javascript +test('should contain logs with attachments',({ task }) => { + const fileName = 'test.jpg'; + const fileContent = fs.readFileSync(path.resolve(__dirname, './attachments', fileName)); + + ReportingApi.attachment(task, { + name: fileName, + type: 'image/png', + content: fileContent.toString('base64'), + }, 'Description'); + + expect(true).toBe(true); +}); +``` diff --git a/src/index.ts b/src/index.ts index 7654653..f607a2a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,7 +16,7 @@ */ import { RPReporter } from './reporter'; +import { ReportingApi } from './reportingApi'; -export { RPReporter }; - +export { RPReporter, ReportingApi }; export default RPReporter; diff --git a/src/models/index.ts b/src/models/index.ts index 9ca6df5..f5d4968 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -21,6 +21,8 @@ import { FinishTestItemObjType, LogRQ, Attachment, + RPTaskMeta, + ReportingApi, } from './reporting'; import { ReportPortalConfig } from './configs'; import { Attribute } from './common'; @@ -32,5 +34,7 @@ export { ReportPortalConfig, Attachment, Attribute, + RPTaskMeta, + ReportingApi, LogRQ, }; diff --git a/src/models/reporting.ts b/src/models/reporting.ts index 0f4de28..b0fd747 100644 --- a/src/models/reporting.ts +++ b/src/models/reporting.ts @@ -14,7 +14,8 @@ * limitations under the License. * */ - +// eslint-disable-next-line import/named +import { Task, TaskMeta } from 'vitest'; import { Attribute, Issue } from './common'; import { TEST_ITEM_TYPES, LOG_LEVELS, LAUNCH_MODES } from '../constants'; @@ -61,3 +62,15 @@ export interface LogRQ { time?: number; file?: Attachment; } + +export interface RPTaskMeta extends TaskMeta { + rpMeta: { + test: { + logs: LogRQ[]; + }; + }; +} + +export interface ReportingApi { + attachment: (context: Task, data: Attachment, description?: string) => void; +} diff --git a/src/reporter.ts b/src/reporter.ts index e02fc46..d4de89e 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -33,6 +33,7 @@ import { getCodeRef, getBasePath, isErrorLog, + isRPTaskMeta, } from './utils'; import { LAUNCH_MODES, @@ -165,13 +166,19 @@ export class RPReporter implements Reporter { const packsReversed = [...packs]; packsReversed.reverse(); - for (const [id, taskResult] of packsReversed) { + for (const [id, taskResult, meta] of packsReversed) { const testItem = this.testItems.get(id); const { id: testItemId, finishSend } = testItem || {}; if (!testItemId || finishSend || !FINISHED_STATES.includes(taskResult?.state)) { continue; } + if (isRPTaskMeta(meta)) { + meta.rpMeta.test.logs.forEach((logRq) => { + this.sendLog(testItemId, logRq); + }); + } + const finishTestItemObj = this.getFinishTestItemObj(taskResult); if (taskResult?.errors?.length) { diff --git a/src/reportingApi.ts b/src/reportingApi.ts new file mode 100644 index 0000000..ea1d5e5 --- /dev/null +++ b/src/reportingApi.ts @@ -0,0 +1,31 @@ +import * as vitest from 'vitest'; +import * as Models from './models'; +import { isRPTaskMeta } from './utils'; + +const injectRPTaskMeta = (task: vitest.Task) => { + if (isRPTaskMeta(task.meta)) { + return; + } + + (task.meta as Models.RPTaskMeta) = { + ...task.meta, + rpMeta: { + test: { + logs: [], + }, + }, + }; +}; + +const attachment = (task: vitest.Task, data: Models.Attachment, description?: string) => { + injectRPTaskMeta(task); + (task.meta as Models.RPTaskMeta).rpMeta.test.logs.push({ + file: data, + time: Date.now(), + message: description || data.name, + }); +}; + +export const ReportingApi: Models.ReportingApi = { + attachment, +}; diff --git a/src/types/interfaces.d.ts b/src/types/interfaces.d.ts index a13f5e0..998d2b3 100644 --- a/src/types/interfaces.d.ts +++ b/src/types/interfaces.d.ts @@ -14,6 +14,7 @@ * limitations under the License. * */ +import * as vitest from 'vitest'; declare namespace Interfaces { interface Attribute { @@ -38,4 +39,8 @@ declare namespace Interfaces { interface ObjUniversal { [name: string]: string; } + + interface ReportingApi { + attachment: (task: vitest.Task, data: Attachment, description?: string) => void; + } } diff --git a/src/utils.ts b/src/utils.ts index 9976f47..c186bd9 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -16,9 +16,10 @@ */ import { normalize, sep } from 'node:path'; +import * as vitest from 'vitest'; // @ts-ignore import { name as pjsonName, version as pjsonVersion } from '../package.json'; -import { Attribute } from './models'; +import { Attribute, RPTaskMeta } from './models'; export const isFalse = (value: string | boolean | undefined): boolean => [false, 'false'].includes(value); @@ -63,3 +64,6 @@ export const getCodeRef = (basePath: string, itemTitle: string): string => export const isErrorLog = (message: string): boolean => { return message.toLowerCase().includes('error'); }; + +export const isRPTaskMeta = (meta: vitest.TaskMeta | RPTaskMeta): meta is RPTaskMeta => + 'rpMeta' in meta; From a6c7ce4d26334f5cfb8958e3cdc12f4cc06cbb65 Mon Sep 17 00:00:00 2001 From: AliakseiLiasnitski <40150869+AliakseiLiasnitski@users.noreply.github.com> Date: Fri, 22 Mar 2024 12:17:08 +0300 Subject: [PATCH 05/12] EPMRPP-89644 || Add setup file to add ReportingApi to the global variable (#15) --- README.md | 39 +++++++++++++++++++++++++++++++++++---- package.json | 11 +++++++++++ src/index.ts | 5 +++++ src/models/index.ts | 2 ++ src/models/reporting.ts | 4 ++++ src/reportingApi.ts | 5 +++++ src/scripts/setup.js | 12 ++++++++++++ src/types/interfaces.d.ts | 4 ++++ tsconfig.json | 2 +- 9 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 src/scripts/setup.js diff --git a/README.md b/README.md index 5069fb0..baa131b 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ npm install --save-dev @reportportal/agent-js-vitest export default defineConfig({ test: { + //add setup file to be able to use ReportingApi via `this.ReportingApi` in your tests and to get test plan support + setupFiles: ["@reportportal/agent-js-vitest/setup"], reporters: ['default', new RPReporter(rpConfig)], }, }); @@ -99,10 +101,39 @@ console's `error`, `warn` reports as error log if message contains _error_ menti This reporter provides Reporting API to use it directly in tests to send some additional data to the report. -To start using the `ReportingApi` in tests, just import it from `'@reportportal/agent-js-vitest'`: -```javascript -import { ReportingApi } from '@reportportal/agent-js-vitest'; -``` +To start using the `ReportingApi` in tests, you can: +- Add setup file in `vitest.config.ts` + ```javascript + import { defineConfig } from 'vitest/config'; + + export default defineConfig({ + test: { + ... + setupFiles: ["@reportportal/agent-js-vitest/setup"], + }, + }); + ``` + `ReportingApi` will be available in global variables and supports receiving `task` from the `setup` file. + ```javascript + test('should contain logs with attachments',() => { + ... + ReportingApi.attachment({ name, type, content }, 'Description'); + ... + }); + ``` + +- Import `ReportingApi` from `'@reportportal/agent-js-vitest'`: + ```javascript + import { ReportingApi } from '@reportportal/agent-js-vitest'; + ``` + In this case you are required to pass `task` as the first argument to the `ReportingApi` methods. + ```javascript + test('should contain logs with attachments',({ task }) => { + ... + ReportingApi.attachment(task, { name, type, content }, 'Description'); + ... + }); + ``` #### Reporting API methods diff --git a/package.json b/package.json index e1ac6c4..22298e3 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,22 @@ "description": "Agent to integrate Vitest with ReportPortal.", "main": "build/index.js", "types": "build/index.d.ts", + "exports": { + ".": { + "import": "./build/index.js", + "require": "./build/index.js" + }, + "./setup": { + "import": "./build/scripts/setup.js", + "require": "./build/scripts/setup.js" + } + }, "scripts": { "build": "npm run clean && tsc", "clean": "rimraf ./build", "lint": "eslint \"src/**/*.ts\"", "format": "npm run lint -- --fix", + "postbuild": "mkdir -p build && cp -R src/scripts build/", "test": "jest", "test:coverage": "jest --coverage" }, diff --git a/src/index.ts b/src/index.ts index f607a2a..812f3ad 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,6 +17,11 @@ import { RPReporter } from './reporter'; import { ReportingApi } from './reportingApi'; +import { GlobalReportingApi } from './models'; + +declare global { + const ReportingApi: GlobalReportingApi; +} export { RPReporter, ReportingApi }; export default RPReporter; diff --git a/src/models/index.ts b/src/models/index.ts index f5d4968..516d5aa 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -23,6 +23,7 @@ import { Attachment, RPTaskMeta, ReportingApi, + GlobalReportingApi, } from './reporting'; import { ReportPortalConfig } from './configs'; import { Attribute } from './common'; @@ -36,5 +37,6 @@ export { Attribute, RPTaskMeta, ReportingApi, + GlobalReportingApi, LogRQ, }; diff --git a/src/models/reporting.ts b/src/models/reporting.ts index b0fd747..c9ea153 100644 --- a/src/models/reporting.ts +++ b/src/models/reporting.ts @@ -74,3 +74,7 @@ export interface RPTaskMeta extends TaskMeta { export interface ReportingApi { attachment: (context: Task, data: Attachment, description?: string) => void; } + +export interface GlobalReportingApi { + attachment: (data: Attachment, description?: string) => void; +} diff --git a/src/reportingApi.ts b/src/reportingApi.ts index ea1d5e5..992679a 100644 --- a/src/reportingApi.ts +++ b/src/reportingApi.ts @@ -29,3 +29,8 @@ const attachment = (task: vitest.Task, data: Models.Attachment, description?: st export const ReportingApi: Models.ReportingApi = { attachment, }; + +export const bindReportingApi = (task: vitest.Task): Models.GlobalReportingApi => ({ + attachment: (data: Models.Attachment, description?: string) => + attachment(task, data, description), +}); diff --git a/src/scripts/setup.js b/src/scripts/setup.js new file mode 100644 index 0000000..4c50e99 --- /dev/null +++ b/src/scripts/setup.js @@ -0,0 +1,12 @@ +import { afterEach, beforeEach } from 'vitest'; +import { bindReportingApi } from '../reportingApi'; + +beforeEach(async (ctx) => { + // @ts-ignore + global.ReportingApi = bindReportingApi(ctx.task); +}); + +afterEach(() => { + // @ts-ignore + global.ReportingApi = undefined; +}); diff --git a/src/types/interfaces.d.ts b/src/types/interfaces.d.ts index 998d2b3..e2ef1b1 100644 --- a/src/types/interfaces.d.ts +++ b/src/types/interfaces.d.ts @@ -43,4 +43,8 @@ declare namespace Interfaces { interface ReportingApi { attachment: (task: vitest.Task, data: Attachment, description?: string) => void; } + + interface GlobalReportingApi { + attachment: (data: Attachment, description?: string) => void; + } } diff --git a/tsconfig.json b/tsconfig.json index f6bec20..8dd3ba3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,5 +18,5 @@ "outDir": "./build" }, "include": ["./src/**/*"], - "exclude": ["node_modules", "src/__tests__"] + "exclude": ["node_modules", "src/__tests__", "src/scripts"] } From a3f314af06d1ed28bba792566f79e574928ed132 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 28 Mar 2024 18:32:14 +0100 Subject: [PATCH 06/12] Update CI-pipeline.yml --- .github/workflows/CI-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI-pipeline.yml b/.github/workflows/CI-pipeline.yml index 1d16d38..c4621ac 100644 --- a/.github/workflows/CI-pipeline.yml +++ b/.github/workflows/CI-pipeline.yml @@ -28,9 +28,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: 20 - name: Install of node dependencies From b9d6d09ded98a86022a94c9064f6f382ef575b48 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 28 Mar 2024 18:32:44 +0100 Subject: [PATCH 07/12] Update publish.yml --- .github/workflows/publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 27a2400..adda934 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: 20 - name: Install of node dependencies @@ -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: 20 registry-url: 'https://registry.npmjs.org' @@ -59,7 +59,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: 20 registry-url: 'https://npm.pkg.github.com' From f1d025a20940160a9eb39ac360f3a7318a7ddc06 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 28 Mar 2024 18:33:09 +0100 Subject: [PATCH 08/12] Update release.yml --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6ab6b0..2cb58f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: releaseVersion: ${{ steps.exposeVersion.outputs.releaseVersion }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Read version id: readVersion run: | @@ -78,9 +78,9 @@ jobs: versionInfo: ${{ steps.readChangelogEntry.outputs.log_entry }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup NodeJS - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: '12' - name: Configure git @@ -139,7 +139,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create Release id: createRelease uses: actions/create-release@v1 From 783e54cd8b85e73ea4c765f617c23b0d7ca88263 Mon Sep 17 00:00:00 2001 From: Ilya Date: Mon, 1 Apr 2024 23:03:23 +0200 Subject: [PATCH 09/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index baa131b..cb6d8e7 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ npm install --save-dev @reportportal/agent-js-vitest export default defineConfig({ test: { - //add setup file to be able to use ReportingApi via `this.ReportingApi` in your tests and to get test plan support + // add setup file to be able to use ReportingApi via `this.ReportingApi` in your tests setupFiles: ["@reportportal/agent-js-vitest/setup"], reporters: ['default', new RPReporter(rpConfig)], }, From f5000504ba22abe35ea0faffd150b6644ff57d99 Mon Sep 17 00:00:00 2001 From: AliakseiLiasnitski <40150869+AliakseiLiasnitski@users.noreply.github.com> Date: Mon, 29 Apr 2024 11:55:11 +0300 Subject: [PATCH 10/12] EPMRPP-89652 || Report the last error log to the test description for Vitest agent (#16) --- CHANGELOG.md | 1 + README.md | 1 + src/models/configs.ts | 1 + src/reporter.ts | 8 ++++++++ 4 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e421edf..bd31837 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### Added - ReportingApi with attachment support +- `extendTestDescriptionWithLastError` option to the RP config to be able to toggle the last error log attaching to the test description. ## [5.0.0] - 2024-02-15 ### Added diff --git a/README.md b/README.md index cb6d8e7..9930975 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ The full list of available options presented below. | 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`](https://github.com/reportportal/client-javascript#timeout-30000ms-on-axios-requests).
Visit [client-javascript](https://github.com/reportportal/client-javascript) for more details. | | 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`. | +| extendTestDescriptionWithLastError | Optional | true | If set to `true` the latest error log will be attached to the test case description. | The following options can be overridden using ENVIRONMENT variables: diff --git a/src/models/configs.ts b/src/models/configs.ts index 2e37334..c1c4301 100644 --- a/src/models/configs.ts +++ b/src/models/configs.ts @@ -48,4 +48,5 @@ export interface ReportPortalConfig extends ClientConfig { // agent specific options skippedIssue?: boolean; + extendTestDescriptionWithLastError?: boolean; } diff --git a/src/reporter.ts b/src/reporter.ts index d4de89e..0545a11 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -70,6 +70,7 @@ export class RPReporter implements Reporter { constructor(config: ReportPortalConfig) { this.config = { + extendTestDescriptionWithLastError: true, ...config, launchId: process.env.RP_LAUNCH_ID || config.launchId, }; @@ -183,6 +184,13 @@ export class RPReporter implements Reporter { if (taskResult?.errors?.length) { const error = taskResult.errors[0]; + + if (this.config.extendTestDescriptionWithLastError) { + finishTestItemObj.description = (finishTestItemObj.description || '').concat( + `\n\`\`\`error\n${error.stack}\n\`\`\``, + ); + } + const logRq: LogRQ = { time: finishTestItemObj.endTime, level: LOG_LEVELS.ERROR, From 5e29fb5399d81010dd6686404e7421949a1d22df Mon Sep 17 00:00:00 2001 From: AliakseiLiasnitski <40150869+AliakseiLiasnitski@users.noreply.github.com> Date: Thu, 2 May 2024 11:14:44 +0300 Subject: [PATCH 11/12] EPMRPP-90293 || Bump @reportportal/client-javascript version to the latest (#17) --- CHANGELOG.md | 2 ++ package-lock.json | 82 +++++++++++++++++++++++++++++++++++------------ package.json | 4 +-- 3 files changed, 66 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd31837..779c2f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ### Added - ReportingApi with attachment support - `extendTestDescriptionWithLastError` option to the RP config to be able to toggle the last error log attaching to the test description. +### Changed +- `@reportportal/client-javascript` bumped to version `5.1.3`. ## [5.0.0] - 2024-02-15 ### Added diff --git a/package-lock.json b/package-lock.json index 9ae3b8d..0a717a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,10 +6,10 @@ "packages": { "": { "name": "@reportportal/agent-js-vitest", - "version": "4.0.0", + "version": "5.0.0", "license": "Apache-2.0", "dependencies": { - "@reportportal/client-javascript": "^5.1.1" + "@reportportal/client-javascript": "^5.1.3" }, "devDependencies": { "@types/jest": "^29.5.12", @@ -31,7 +31,7 @@ "vitest": "^1.2.2" }, "engines": { - "node": ">=14.x" + "node": ">=16.x" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1765,13 +1765,13 @@ } }, "node_modules/@reportportal/client-javascript": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@reportportal/client-javascript/-/client-javascript-5.1.1.tgz", - "integrity": "sha512-GgWRODR4twqFkBMSDhsck4JZVeIJPRLMuNjbypnCJXbvZ8JYMJoMk30Mw5M9QGByAFFrpZZ7Ih9pXCsccxscSA==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@reportportal/client-javascript/-/client-javascript-5.1.3.tgz", + "integrity": "sha512-1/utoKnHUgiilR6Ep8pHvuNZGv5oDeI+x1/aJNu8IADoVG1U0Q4tB2trWHDIY07T/PCzrnzp6dVcCu/wLsdVRA==", "dependencies": { - "axios": "^1.6.5", - "axios-retry": "^4.0.0", - "glob": "^7.2.3", + "axios": "^1.6.8", + "axios-retry": "^4.1.0", + "glob": "^8.1.0", "ini": "^2.0.0", "uniqid": "^5.4.0", "uuid": "^9.0.1" @@ -1780,6 +1780,43 @@ "node": ">=12.x" } }, + "node_modules/@reportportal/client-javascript/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@reportportal/client-javascript/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@reportportal/client-javascript/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.10.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.10.0.tgz", @@ -2713,19 +2750,19 @@ } }, "node_modules/axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", "dependencies": { - "follow-redirects": "^1.15.4", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, "node_modules/axios-retry": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/axios-retry/-/axios-retry-4.0.0.tgz", - "integrity": "sha512-F6P4HVGITD/v4z9Lw2mIA24IabTajvpDZmKa6zq/gGwn57wN5j1P3uWrAV0+diqnW6kTM2fTqmWNfgYWGmMuiA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axios-retry/-/axios-retry-4.1.0.tgz", + "integrity": "sha512-svdth4H00yhlsjBbjfLQ/sMLkXqeLxhiFC1nE1JtkN/CIssGxqk0UwTEdrVjwA2gr3yJkAulwvDSIm4z4HyPvg==", "dependencies": { "is-retry-allowed": "^2.2.0" }, @@ -2858,6 +2895,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3137,7 +3175,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/confusing-browser-globals": { "version": "1.0.11", @@ -4218,9 +4257,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -4401,6 +4440,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5964,6 +6004,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6286,6 +6327,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } diff --git a/package.json b/package.json index 22298e3..e20167b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test:coverage": "jest --coverage" }, "dependencies": { - "@reportportal/client-javascript": "^5.1.1" + "@reportportal/client-javascript": "^5.1.3" }, "files": [ "/build" @@ -69,7 +69,7 @@ "portal", "epam" ], - "contributors": [ + "contributors": [ { "name": "Ilya Hancharyk", "email": "amsterget@gmail.com" From 96723b932ebf3d62adf23b289048f51066a91cbe Mon Sep 17 00:00:00 2001 From: AliakseiLiasnitski <40150869+AliakseiLiasnitski@users.noreply.github.com> Date: Fri, 3 May 2024 12:00:12 +0300 Subject: [PATCH 12/12] change version_fragment from patch to minor --- version_fragment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_fragment b/version_fragment index 9eb7b90..acb503f 100644 --- a/version_fragment +++ b/version_fragment @@ -1 +1 @@ -patch +minor