From 408f55cb67a924aa7fae3da1c0570883d2f758be Mon Sep 17 00:00:00 2001 From: epam-avramenko Date: Wed, 19 Jun 2024 14:03:39 +0300 Subject: [PATCH 1/6] #192. The code stopper for killing the processes after completing the test suite when launchId is defined has been removed. --- lib/cypressReporter.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/cypressReporter.js b/lib/cypressReporter.js index 796f50d..5eda258 100644 --- a/lib/cypressReporter.js +++ b/lib/cypressReporter.js @@ -160,9 +160,6 @@ class CypressReporter extends Mocha.reporters.Base { }); this.runner.on(EVENT_RUN_END, () => { - if (CypressReporter.reporterOptions.launchId) { - return; - } CypressReporter.calcTotalLaunches(); if (CypressReporter.shouldStopLaunch()) { this.worker.send({ event: EVENT_RUN_END, launch: getLaunchStartObject(config) }); From 769c9dcf473ac8341a73c6a319cc8ce77f7ba14f Mon Sep 17 00:00:00 2001 From: epam-avramenko Date: Wed, 19 Jun 2024 14:14:49 +0300 Subject: [PATCH 2/6] #192. The process for completing launches has been altered for both cases with and without specifying launchId. In the case of specifying launchId, the launch should not be terminated. --- lib/reporter.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/reporter.js b/lib/reporter.js index c1cf8ee..a3de899 100644 --- a/lib/reporter.js +++ b/lib/reporter.js @@ -74,16 +74,20 @@ class Reporter { } runEnd() { - const finishLaunchPromise = this.client - .finishLaunch( - this.tempLaunchId, - Object.assign( - { - endTime: new Date().valueOf(), - }, - this.launchStatus && { status: this.launchStatus }, - ), - ) + const basePromise = + !this.config.reporterOptions.launchId + ? this.client.getPromiseFinishAllItems(this.tempLaunchId) + : this.client.finishLaunch( + this.tempLaunchId, + Object.assign( + { + endTime: new Date().valueOf(), + }, + this.launchStatus && { status: this.launchStatus }, + ), + ); + + const finishLaunchPromise = basePromise .promise.then(() => { const { launch, isLaunchMergeRequired } = this.config.reporterOptions; if (isLaunchMergeRequired) { From 9623cfa779a1cfa0a62e8e62daacd08d56b9d1dd Mon Sep 17 00:00:00 2001 From: epam-avramenko Date: Wed, 19 Jun 2024 23:51:31 +0300 Subject: [PATCH 3/6] #192. The process for completing launches has been altered for both cases with and without specifying launchId. In the case of specifying launchId, the launch should not be terminated.Fixed. --- lib/reporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reporter.js b/lib/reporter.js index a3de899..e9fbe42 100644 --- a/lib/reporter.js +++ b/lib/reporter.js @@ -75,7 +75,7 @@ class Reporter { runEnd() { const basePromise = - !this.config.reporterOptions.launchId + this.config.reporterOptions.launchId ? this.client.getPromiseFinishAllItems(this.tempLaunchId) : this.client.finishLaunch( this.tempLaunchId, From b99158ded8a8a9f3dc99a11ef10e8af3319b4fa1 Mon Sep 17 00:00:00 2001 From: epam-avramenko Date: Thu, 20 Jun 2024 12:12:10 +0300 Subject: [PATCH 4/6] #192. Eslint fix. --- lib/reporter.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/reporter.js b/lib/reporter.js index e9fbe42..a1b7eed 100644 --- a/lib/reporter.js +++ b/lib/reporter.js @@ -74,10 +74,9 @@ class Reporter { } runEnd() { - const basePromise = - this.config.reporterOptions.launchId - ? this.client.getPromiseFinishAllItems(this.tempLaunchId) - : this.client.finishLaunch( + const basePromise = this.config.reporterOptions.launchId + ? this.client.getPromiseFinishAllItems(this.tempLaunchId) + : this.client.finishLaunch( this.tempLaunchId, Object.assign( { @@ -87,8 +86,8 @@ class Reporter { ), ); - const finishLaunchPromise = basePromise - .promise.then(() => { + const finishLaunchPromise = basePromise.promise + .then(() => { const { launch, isLaunchMergeRequired } = this.config.reporterOptions; if (isLaunchMergeRequired) { deleteMergeLaunchLockFile(launch, this.tempLaunchId); From 639b831a4bd186dcd317368f9f4739818af48cf0 Mon Sep 17 00:00:00 2001 From: epam-avramenko Date: Thu, 20 Jun 2024 13:51:40 +0300 Subject: [PATCH 5/6] #192. The process for completing launches has been altered for both cases with and without specifying launchId. In the case of specifying launchId, the launch should not be terminated.Fixed.2 --- lib/reporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reporter.js b/lib/reporter.js index a1b7eed..bd1edde 100644 --- a/lib/reporter.js +++ b/lib/reporter.js @@ -84,7 +84,7 @@ class Reporter { }, this.launchStatus && { status: this.launchStatus }, ), - ); + ).promise; const finishLaunchPromise = basePromise.promise .then(() => { From 39f9af4b0b0eb3100bcfa346cde52878bafd2b69 Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Thu, 20 Jun 2024 18:12:23 +0300 Subject: [PATCH 6/6] #192. Fix basePromise usage --- lib/reporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reporter.js b/lib/reporter.js index bd1edde..ee1ff0b 100644 --- a/lib/reporter.js +++ b/lib/reporter.js @@ -86,7 +86,7 @@ class Reporter { ), ).promise; - const finishLaunchPromise = basePromise.promise + const finishLaunchPromise = basePromise .then(() => { const { launch, isLaunchMergeRequired } = this.config.reporterOptions; if (isLaunchMergeRequired) {