From af17fe915db8c955960ea0ac175c200d17366eda Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Thu, 8 Oct 2026 23:37:48 +0300 Subject: [PATCH] Get rid of reportportal code --- tests/e2e/configs/reporters.config.js | 38 --- .../sh-scripts/runDevfileAcceptanceTests.sh | 1 - .../configs/sh-scripts/runFunctionalTests.sh | 3 - tests/e2e/constants/REPORTER_CONSTANTS.ts | 79 ------ tests/e2e/package-lock.json | 233 ------------------ tests/e2e/package.json | 1 - tests/e2e/specs/MochaHooks.ts | 20 -- tests/e2e/utils/Logger.ts | 28 --- 8 files changed, 403 deletions(-) diff --git a/tests/e2e/configs/reporters.config.js b/tests/e2e/configs/reporters.config.js index 2f0edd427c7..8ee91a75b51 100644 --- a/tests/e2e/configs/reporters.config.js +++ b/tests/e2e/configs/reporters.config.js @@ -8,7 +8,6 @@ * SPDX-License-Identifier: EPL-2.0 **********************************************************************/ const { REPORTER_CONSTANTS } = require('../constants/REPORTER_CONSTANTS'); -const { BASE_TEST_CONSTANTS } = require('../constants/BASE_TEST_CONSTANTS'); module.exports = { reporterEnabled: REPORTER_CONSTANTS.REPORTERS_ENABLED(), @@ -18,42 +17,5 @@ module.exports = { reporterOptions: { mochaFile: `${REPORTER_CONSTANTS.TS_SELENIUM_REPORT_FOLDER}/junit/test-results.xml` - }, - - reportportalAgentJsMochaReporterOptions: { - apiKey: REPORTER_CONSTANTS.RP_API_KEY, - endpoint: REPORTER_CONSTANTS.RP_ENDPOINT(), - project: REPORTER_CONSTANTS.RP_PROJECT(), - launch: `${REPORTER_CONSTANTS.RP_LAUNCH_NAME}`, - attributes: [ - { - key: 'build', - value: `${BASE_TEST_CONSTANTS.TESTING_APPLICATION_VERSION}` - }, - { - key: 'ocp version', - value: `${BASE_TEST_CONSTANTS.OCP_VERSION}` - }, - { - key: 'ocp infra', - value: `${BASE_TEST_CONSTANTS.OCP_INFRA}` - }, - { - key: 'application', - value: BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME() - }, - { - key: 'url', - value: BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL - }, - { - value: REPORTER_CONSTANTS.TEST_RUN_URL - } - ], - rerun: REPORTER_CONSTANTS.RP_RERUN(), - rerunOf: REPORTER_CONSTANTS.RP_RERUN_UUID, - restClientConfig: { - timeout: 1200000 - } } }; diff --git a/tests/e2e/configs/sh-scripts/runDevfileAcceptanceTests.sh b/tests/e2e/configs/sh-scripts/runDevfileAcceptanceTests.sh index 572f5667696..ba81eb9b7e1 100755 --- a/tests/e2e/configs/sh-scripts/runDevfileAcceptanceTests.sh +++ b/tests/e2e/configs/sh-scripts/runDevfileAcceptanceTests.sh @@ -16,7 +16,6 @@ validateParameters(){ launchDynamicallyGeneratingAPITests() { export MOCHA_SUITE="DynamicallyGeneratingAPITest" - export RP_LAUNCH_NAME="Devfile Acceptance tests suite" echo "MOCHA_SUITE = ${MOCHA_SUITE}" echo "suites/$MOCHA_DIRECTORY/$MOCHA_SUITE" npm run delayed-test diff --git a/tests/e2e/configs/sh-scripts/runFunctionalTests.sh b/tests/e2e/configs/sh-scripts/runFunctionalTests.sh index b46583410c5..31f8b5e6c35 100755 --- a/tests/e2e/configs/sh-scripts/runFunctionalTests.sh +++ b/tests/e2e/configs/sh-scripts/runFunctionalTests.sh @@ -17,14 +17,12 @@ validateParameters(){ launchAPITests() { export MOCHA_SUITE="APITest" echo "MOCHA_SUITE = ${MOCHA_SUITE}" - export RP_LAUNCH_NAME="API tests suite $TEST_ENVIRONMENT" echo "suites/$MOCHA_DIRECTORY/$MOCHA_SUITE" npm run driver-less-test } launchDynamicallyGeneratingAPITests() { export MOCHA_SUITE="DynamicallyGeneratingAPITest" - export RP_LAUNCH_NAME="Application inbuilt DevWorkspaces API tests suite $TEST_ENVIRONMENT" echo "MOCHA_SUITE = ${MOCHA_SUITE}" echo "suites/$MOCHA_DIRECTORY/$MOCHA_SUITE" npm run delayed-test @@ -32,7 +30,6 @@ launchDynamicallyGeneratingAPITests() { launchUITests() { export MOCHA_SUITE="UITest" - export RP_LAUNCH_NAME="UI tests suite $TEST_ENVIRONMENT" echo "MOCHA_SUITE = ${MOCHA_SUITE}" echo "suites/$MOCHA_DIRECTORY/$MOCHA_SUITE" npm run test diff --git a/tests/e2e/constants/REPORTER_CONSTANTS.ts b/tests/e2e/constants/REPORTER_CONSTANTS.ts index 601242f2183..bb3dfebae50 100644 --- a/tests/e2e/constants/REPORTER_CONSTANTS.ts +++ b/tests/e2e/constants/REPORTER_CONSTANTS.ts @@ -7,23 +7,10 @@ * * SPDX-License-Identifier: EPL-2.0 **********************************************************************/ -import { BASE_TEST_CONSTANTS } from './BASE_TEST_CONSTANTS'; -import { MOCHA_CONSTANTS } from './MOCHA_CONSTANTS'; - export const REPORTER_CONSTANTS: { DELETE_SCREENCAST_IF_TEST_PASS: boolean; - RP_ENDPOINT(): string | undefined; - RP_IS_LOCAL_SERVER: boolean; REPORTERS_ENABLED(): string; - RP_API_KEY: string; - RP_PROJECT(): string; - RP_RERUN(): boolean; - RP_RERUN_UUID: string | undefined; - RP_LAUNCH_NAME: string; - RP_USER: string; - RP_USE_PERSONAL: boolean; SAVE_ALLURE_REPORT_DATA: boolean; - SAVE_RP_REPORT_DATA: boolean; SAVE_JUNIT_DATA: boolean; TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS: number; TS_SELENIUM_REPORT_FOLDER: string; @@ -73,11 +60,6 @@ export const REPORTER_CONSTANTS: { */ SAVE_ALLURE_REPORT_DATA: process.env.SAVE_ALLURE_REPORT_DATA === 'true', - /** - * use ReportPortal reporter, default to false - */ - SAVE_RP_REPORT_DATA: process.env.SAVE_RP_REPORT_DATA === 'true', - /** * use MochaJunit reporter, default to false */ @@ -94,69 +76,8 @@ export const REPORTER_CONSTANTS: { if (REPORTER_CONSTANTS.SAVE_ALLURE_REPORT_DATA) { reporters += ',allure-mocha'; } - if (REPORTER_CONSTANTS.SAVE_RP_REPORT_DATA) { - reporters += ',@reportportal/agent-js-mocha'; - } return reporters; }, - /** - * reportPortal app key or user token - */ - RP_API_KEY: process.env.RP_API_KEY || '', - - /** - * user name on ReportPortal - */ - RP_USER: process.env.RP_USER || process.env.USER || process.env.BUILD_USER_ID || '', - - /** - * launch name to save report - */ - RP_LAUNCH_NAME: process.env.RP_LAUNCH_NAME || `Test run ${MOCHA_CONSTANTS.MOCHA_USERSTORY}`, - - /** - * launch name to save report - */ - RP_RERUN_UUID: process.env.RP_RERUN_UUID || undefined, - - /** - * is launch rerun - */ - RP_RERUN: (): boolean => !!REPORTER_CONSTANTS.RP_RERUN_UUID, - - /** - * is local or online server to use - */ - RP_IS_LOCAL_SERVER: process.env.RP_IS_LOCAL_SERVER !== 'false', - - /** - * url with endpoints where ReportPortal is - */ - RP_ENDPOINT: (): string | undefined => { - if (process.env.RP_ENDPOINTRP_IS_LOCAL_SERVER) { - return 'http://localhost:8080/api/v1'; - } - if (process.env.RP_ENDPOINT !== '') { - return process.env.RP_ENDPOINT; - } - return 'https://reportportal-crw.apps.dno.ocp-hub.prod.psi.redhat.com/api/v1'; - }, - - /** - * use personal project to save launch, if false launch will be sent to devspaces or che project, true by default - */ - RP_USE_PERSONAL: process.env.RP_USE_PERSONAL !== 'false', - - /** - * project name to save launch - */ - RP_PROJECT: (): string => { - const project: string = REPORTER_CONSTANTS.RP_USE_PERSONAL - ? `${REPORTER_CONSTANTS.RP_USER}_personal` - : BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME(); - return process.env.RP_PROJECT || project; - }, - TEST_RUN_URL: process.env.TEST_RUN_URL || 'Test run url not set' }; diff --git a/tests/e2e/package-lock.json b/tests/e2e/package-lock.json index 4f9c64a63ea..9679f60bd35 100644 --- a/tests/e2e/package-lock.json +++ b/tests/e2e/package-lock.json @@ -15,7 +15,6 @@ }, "devDependencies": { "@eclipse-che/che-devworkspace-generator": "next", - "@reportportal/agent-js-mocha": "^5.0.3", "@types/chai": "^4.3.4", "@types/clone-deep": "^4.0.1", "@types/mocha": "5.2.6", @@ -185,19 +184,6 @@ "node": ">=4" } }, - "node_modules/@babel/runtime": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", - "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -524,163 +510,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/@reportportal/agent-js-mocha": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@reportportal/agent-js-mocha/-/agent-js-mocha-5.0.4.tgz", - "integrity": "sha512-MPO5WeTMjBicu378Hp6tyq2OlNK9EL/WDHBvQodcfn1XX5fRlRSk1M6JqBsdn308O95UmECeqQ7VmRa9SpZdkw==", - "dev": true, - "license": "Apache 2.0", - "dependencies": { - "@reportportal/client-javascript": "~5.0.15", - "mocha": "^10.2.0" - }, - "engines": { - "node": ">=10.x" - } - }, - "node_modules/@reportportal/agent-js-mocha/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "license": "ISC", - "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/agent-js-mocha/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@reportportal/agent-js-mocha/node_modules/mocha": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz", - "integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "8.1.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@reportportal/agent-js-mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@reportportal/agent-js-mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/@reportportal/agent-js-mocha/node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/@reportportal/client-javascript": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/@reportportal/client-javascript/-/client-javascript-5.0.15.tgz", - "integrity": "sha512-ry6euqCOoJLXCUuBhlRMjCYKhbgU+9EYdZ8jpTuagoBVxS8V8nJed9ODnS4bXX61g+pJm+NP/0DrN2Ptq+DgQQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "axios": "^0.27.2", - "axios-retry": "^3.4.0", - "glob": "^7.2.3", - "ini": "^2.0.0", - "uniqid": "^5.4.0", - "uuid": "^9.0.0" - }, - "engines": { - "node": ">=10.x" - } - }, - "node_modules/@reportportal/client-javascript/node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" - } - }, - "node_modules/@reportportal/client-javascript/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/@testim/chrome-version": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.4.tgz", @@ -1339,17 +1168,6 @@ "follow-redirects": "^1.14.7" } }, - "node_modules/axios-retry": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/axios-retry/-/axios-retry-3.9.1.tgz", - "integrity": "sha512-8PJDLJv7qTTMMwdnbMvrLYuvB47M81wRtxQmEdV5w4rgbTXTt+vtPkXwajOfOdSyv/wZICJOC+/UhXH4aQ/R+w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@babel/runtime": "^7.15.4", - "is-retry-allowed": "^2.2.0" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -3106,16 +2924,6 @@ "dev": true, "license": "ISC" }, - "node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, "node_modules/interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", @@ -3323,19 +3131,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-retry-allowed": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz", - "integrity": "sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -4669,13 +4464,6 @@ "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", "license": "Apache-2.0" }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true, - "license": "MIT" - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -5582,13 +5370,6 @@ "node": ">=4.2.0" } }, - "node_modules/uniqid": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-5.4.0.tgz", - "integrity": "sha512-38JRbJ4Fj94VmnC7G/J/5n5SC7Ab46OM5iNtSstB/ko3l1b5g7ALt4qzHFgGciFkyiRNtDXtLNb+VsxtMSE77A==", - "dev": true, - "license": "MIT" - }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -5627,20 +5408,6 @@ "dev": true, "license": "MIT" }, - "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", diff --git a/tests/e2e/package.json b/tests/e2e/package.json index 0166659ed9b..2b5e2695ae6 100644 --- a/tests/e2e/package.json +++ b/tests/e2e/package.json @@ -22,7 +22,6 @@ "license": "ISC", "devDependencies": { "@eclipse-che/che-devworkspace-generator": "next", - "@reportportal/agent-js-mocha": "^5.0.3", "@types/chai": "^4.3.4", "@types/clone-deep": "^4.0.1", "@types/mocha": "5.2.6", diff --git a/tests/e2e/specs/MochaHooks.ts b/tests/e2e/specs/MochaHooks.ts index a005fd5cefc..cafc4586c7f 100644 --- a/tests/e2e/specs/MochaHooks.ts +++ b/tests/e2e/specs/MochaHooks.ts @@ -30,7 +30,6 @@ import { WorkspaceHandlingTests } from '../tests-library/WorkspaceHandlingTests' const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper); let latestWorkspace: string = ''; -export let rpApi: any = undefined; export function registerRunningWorkspace(workspaceName: string): void { workspaceName !== '' @@ -45,10 +44,6 @@ export function registerRunningWorkspace(workspaceName: string): void { exports.mochaHooks = { beforeAll: [ - function initRPApi(): any { - rpApi = require('@reportportal/agent-js-mocha/lib/publicReportingAPI.js'); - }, - function decorateExternalClasses(): void { decorate(injectable(), Main); decorate(injectable(), LocatorLoader); @@ -98,21 +93,6 @@ exports.mochaHooks = { } } }, - async function saveReportportalAttachments(this: Mocha.Context): Promise { - if (REPORTER_CONSTANTS.SAVE_RP_REPORT_DATA && this.currentTest?.state === 'failed') { - try { - const screenshot: string = await driverHelper.getDriver().takeScreenshot(); - const attachment: { name: string; type: string; content: string } = { - name: 'screenshot.png', - type: 'image/png', - content: screenshot - }; - rpApi.error('Screenshot on fail: ', attachment); - } catch (e) { - rpApi.error('Could not attach the screenshot'); - } - } - }, // stop and remove running workspace async function deleteWorkspaceOnFailedTest(this: Mocha.Context): Promise { if (this.currentTest?.state === 'failed') { diff --git a/tests/e2e/utils/Logger.ts b/tests/e2e/utils/Logger.ts index d67c6cc8583..3e0a67c066b 100644 --- a/tests/e2e/utils/Logger.ts +++ b/tests/e2e/utils/Logger.ts @@ -8,7 +8,6 @@ * SPDX-License-Identifier: EPL-2.0 **********************************************************************/ import { REPORTER_CONSTANTS } from '../constants/REPORTER_CONSTANTS'; -import { rpApi } from '../specs/MochaHooks'; export class Logger { /** @@ -22,9 +21,6 @@ export class Logger { const logLevelSymbol: string = '[ERROR] '; const message: string = this.getFullMessage(callerInfo, text); this.logText(indentLevel, logLevelSymbol, message); - if (this.sendLogMessageIntoReportPortal()) { - rpApi.error(message); - } } /** @@ -40,9 +36,6 @@ export class Logger { const logLevelSymbol: string = '[WARN] '; const message: string = this.getFullMessage(callerInfo, text); this.logText(indentLevel, logLevelSymbol, message); - if (this.sendLogMessageIntoReportPortal()) { - rpApi.warn(message); - } } /** @@ -58,9 +51,6 @@ export class Logger { const logLevelSymbol: string = '• '; const message: string = this.getFullMessage(callerInfo, text); this.logText(indentLevel, logLevelSymbol, message); - if (this.sendLogMessageIntoReportPortal()) { - rpApi.info(message); - } } /** @@ -80,9 +70,6 @@ export class Logger { const logLevelSymbol: string = '▼ '; const message: string = this.getFullMessage(callerInfo, text); this.logText(indentLevel, logLevelSymbol, message); - if (this.sendLogMessageIntoReportPortal()) { - rpApi.debug(message); - } } /** @@ -104,9 +91,6 @@ export class Logger { const logLevelSymbol: string = '‣ '; const message: string = this.getFullMessage(callerInfo, text); this.logText(indentLevel, logLevelSymbol, message); - if (this.sendLogMessageIntoReportPortal()) { - rpApi.trace(message); - } } private static getFullMessage(callerInfo: string, text: string): string { @@ -143,16 +127,4 @@ export class Logger { const e: Error = new Error(); return e.stack ? e.stack.split('\n') : []; } - - private static sendLogMessageIntoReportPortal(): boolean { - return REPORTER_CONSTANTS.SAVE_RP_REPORT_DATA && !this.isRootCaller(); - } - - private static isRootCaller(traceLevel: number = 6): boolean { - return this.getCallStackArray() - .slice(traceLevel, traceLevel + 4) - .reduce((acc, e): boolean => { - return acc || /MochaHooks|CheReporter/.test(e); - }, false); - } }