From a155a343fc624d473fba60d051f13cfcebe118eb Mon Sep 17 00:00:00 2001 From: "reportportal.io" Date: Tue, 19 Dec 2023 16:24:48 +0000 Subject: [PATCH 1/3] 5.1.5 -> 5.1.6-SNAPSHOT --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 220d8e0..c76456b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.1.5 +5.1.6-SNAPSHOT From a445dc8b3eb6afdb8ae9b9e379cde57ca2e2ef83 Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Tue, 19 Dec 2023 20:06:29 +0300 Subject: [PATCH 2/3] EPMRPP-88772 || Serial mode. Fix invocations calculation for indirect test parents --- src/__tests__/reporter/finishSuiteReporting.spec.ts | 2 -- src/__tests__/reporter/finishTestItemReporting.spec.ts | 2 -- src/__tests__/reporter/startSuiteTestReporting.spec.ts | 2 -- src/reporter.ts | 10 +++++----- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/__tests__/reporter/finishSuiteReporting.spec.ts b/src/__tests__/reporter/finishSuiteReporting.spec.ts index 0bfc941..bdcf61b 100644 --- a/src/__tests__/reporter/finishSuiteReporting.spec.ts +++ b/src/__tests__/reporter/finishSuiteReporting.spec.ts @@ -76,7 +76,6 @@ describe('finish suites on finish all of their children', () => { name: rootSuite, testInvocationsLeft: 1, descendants: ['testItemId'], - isSerialMode: false, }, ], [ @@ -86,7 +85,6 @@ describe('finish suites on finish all of their children', () => { name: suiteName, testInvocationsLeft: 1, descendants: ['testItemId'], - isSerialMode: false, }, ], ]); diff --git a/src/__tests__/reporter/finishTestItemReporting.spec.ts b/src/__tests__/reporter/finishTestItemReporting.spec.ts index 9704064..51067b6 100644 --- a/src/__tests__/reporter/finishTestItemReporting.spec.ts +++ b/src/__tests__/reporter/finishTestItemReporting.spec.ts @@ -68,7 +68,6 @@ describe('finish test reporting', () => { name: rootSuite, testInvocationsLeft: 1, descendants: ['testItemId'], - isSerialMode: false, }, ], [ @@ -78,7 +77,6 @@ describe('finish test reporting', () => { name: suiteName, testInvocationsLeft: 1, descendants: ['testItemId'], - isSerialMode: false, }, ], ]); diff --git a/src/__tests__/reporter/startSuiteTestReporting.spec.ts b/src/__tests__/reporter/startSuiteTestReporting.spec.ts index 0f9e0d9..76d02bb 100644 --- a/src/__tests__/reporter/startSuiteTestReporting.spec.ts +++ b/src/__tests__/reporter/startSuiteTestReporting.spec.ts @@ -83,7 +83,6 @@ describe('start reporting suite/test', () => { id: 'tempTestItemId', name: rootSuite, testInvocationsLeft: 1, - isSerialMode: false, descendants: ['testItemId'], }, ], @@ -94,7 +93,6 @@ describe('start reporting suite/test', () => { name: suiteName, descendants: ['testItemId'], testInvocationsLeft: 1, - isSerialMode: false, }, ], ]); diff --git a/src/reporter.ts b/src/reporter.ts index 3e0f517..463be74 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -61,7 +61,6 @@ interface Suite extends TestItem { logs?: LogRQ[]; testInvocationsLeft?: number; descendants?: string[]; - isSerialMode?: boolean; executedTestCount?: number; } @@ -332,7 +331,6 @@ export class RPReporter implements Reporter { this.addRequestToPromisesQueue(suiteObj.promise, 'Failed to start suite.'); // @ts-ignore access to private property _parallelMode - const isSerialMode = currentSuite._parallelMode === 'serial'; const allSuiteTests = currentSuite.allTests(); const descendants = allSuiteTests.map((testCase) => testCase.id); const testCount = allSuiteTests.length; @@ -349,7 +347,6 @@ export class RPReporter implements Reporter { name: currentSuiteTitle, testInvocationsLeft, descendants, - isSerialMode, ...(status && { status }), ...(logs && { logs }), // TODO: may be send it on suite start }); @@ -584,14 +581,17 @@ export class RPReporter implements Reporter { decreaseIndex = decreaseIndex + possibleInvocationsLeft; } + // @ts-ignore access to private property _parallelMode + const isSerialMode = test.parent._parallelMode === 'serial'; // is test run with "serial" mode + this.suites.forEach((value, key) => { - const { descendants, testInvocationsLeft, isSerialMode, executedTestCount } = value; + const { descendants, testInvocationsLeft, executedTestCount } = value; if (descendants.length && descendants.includes(test.id)) { // if test will not be retried anymore, we consider it as finally executed const newExecutedTestCount = executedTestCount + (nonRetriedResult ? 1 : 0); /* In case one test from serial group will fail, all tests from this group will be retried, - so we need to increase _testInvocationsLeft_ by already finished test amount, see https://playwright.dev/docs/test-retries#serial-mode + so we need to increase _testInvocationsLeft_ of all its ancestors by already finished test amount, see https://playwright.dev/docs/test-retries#serial-mode */ const serialModeIncrement = isSerialMode ? executedTestCount : 0; const newTestInvocationsLeft = testInvocationsLeft - decreaseIndex + serialModeIncrement; From 5151fbd9475e0ed2c63772bec348e45b2342926d Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Tue, 19 Dec 2023 20:07:46 +0300 Subject: [PATCH 3/3] EPMRPP-88772 || Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ede63d6..0d9d603 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +### Fixed +- Serial mode execution. Fix invocations calculation for indirect test parents. ## [5.1.5] - 2023-12-19 ### Added