Skip to content

Commit cb37b5c

Browse files
authored
Merge pull request #157 from reportportal/develop
Release 5.1.2
2 parents b54b361 + 5c3517a commit cb37b5c

File tree

10 files changed

+257
-409
lines changed

10 files changed

+257
-409
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
### Fixed
2+
- Issues with duplication and finishing of suites while running tests in parallel. Resolves [#153](https://github.com/reportportal/agent-js-jest/issues/153), [#155](https://github.com/reportportal/agent-js-jest/issues/155), [#147](https://github.com/reportportal/agent-js-jest/issues/147).
13

24
## [5.1.1] - 2024-11-01
35
### Fixed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.1.1
1+
5.1.2-SNAPSHOT

__tests__/mocks/data.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,32 @@ const { TEST_ITEM_STATUSES } = require('../../src/constants');
33

44
const mockDate = 1712900000000;
55
const duration = 5;
6+
const testFilePath = `C:${path.sep}testProject${path.sep}example.js`;
67
const failedTestResult = {
78
title: 'failed title',
89
status: TEST_ITEM_STATUSES.FAILED,
910
ancestorTitles: ['Failed suite name', 'Failed test name'],
1011
failureMessages: ['error message'],
1112
invocations: 1,
12-
duration,
13+
startedAt: mockDate,
1314
};
1415
const skippedTestResult = {
1516
title: 'skipped title',
1617
status: TEST_ITEM_STATUSES.SKIPPED,
1718
ancestorTitles: ['Skipped suite name', 'Skipped test name'],
1819
failureMessages: [],
19-
invocations: 1,
20-
duration,
20+
invocations: 2,
2121
};
2222
const testResult = {
23+
testResults: [failedTestResult],
24+
testFilePath,
25+
};
26+
const testResultWithSkipped = {
2327
testResults: [failedTestResult, skippedTestResult],
28+
testFilePath,
2429
};
2530
const testObj = {
26-
path: `C:${path.sep}testProject${path.sep}example.js`,
31+
path: testFilePath,
2732
};
2833
const mockFile = { name: 'test_img_name', type: 'image/png', content: 'content' };
2934

@@ -33,6 +38,8 @@ module.exports = {
3338
failedTestResult,
3439
skippedTestResult,
3540
testResult,
41+
testResultWithSkipped,
3642
testObj,
3743
mockFile,
44+
testFilePath,
3845
};

__tests__/objectUtils.spec.js

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 EPAM Systems
2+
* Copyright 2025 EPAM Systems
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,12 +19,8 @@ const path = require('path');
1919
const {
2020
getAgentOptions,
2121
getStartLaunchObject,
22-
getSuiteStartObject,
23-
getTestStartObject,
24-
getStepStartObject,
2522
getAgentInfo,
2623
getCodeRef,
27-
getFullTestName,
2824
getFullStepName,
2925
getSystemAttributes,
3026
} = require('../src/utils/objectUtils');
@@ -117,52 +113,6 @@ describe('Object Utils script', () => {
117113
});
118114
});
119115

120-
describe('getStepStartObject', () => {
121-
test('should return step start object with correct values', () => {
122-
const expectedStepStartObject = {
123-
type: 'STEP',
124-
name: 'step title',
125-
retry: true,
126-
startTime: new Date().valueOf() - duration,
127-
};
128-
129-
const stepStartObject = getStepStartObject('step title', true, undefined, duration);
130-
131-
expect(stepStartObject).toBeDefined();
132-
expect(stepStartObject).toEqual(expectedStepStartObject);
133-
});
134-
});
135-
136-
describe('getTestStartObject', () => {
137-
test('should return test start object with correct values', () => {
138-
const expectedTestStartObject = {
139-
type: 'TEST',
140-
name: 'test title',
141-
startTime: new Date().valueOf() - duration,
142-
};
143-
144-
const testStartObject = getTestStartObject('test title', undefined, duration);
145-
146-
expect(testStartObject).toBeDefined();
147-
expect(testStartObject).toEqual(expectedTestStartObject);
148-
});
149-
});
150-
151-
describe('getSuiteStartObject', () => {
152-
test('should return suite start object with correct values', () => {
153-
const expectedSuiteStartObject = {
154-
type: 'SUITE',
155-
name: 'suite name',
156-
startTime: new Date().valueOf() - duration,
157-
};
158-
159-
const suiteStartObject = getSuiteStartObject('suite name', undefined, duration);
160-
161-
expect(suiteStartObject).toBeDefined();
162-
expect(suiteStartObject).toEqual(expectedSuiteStartObject);
163-
});
164-
});
165-
166116
describe('getAgentOptions', () => {
167117
test(
168118
'should return agent options object with correct values, some parameters taken from' +
@@ -301,19 +251,6 @@ describe('Object Utils script', () => {
301251
});
302252
});
303253

304-
describe('getFullTestName', () => {
305-
test('should return correct full test name', () => {
306-
const mockedTest = {
307-
ancestorTitles: ['rootDescribe', 'parentDescribe', 'testTitle'],
308-
};
309-
const expectedFullTestName = 'rootDescribe/parentDescribe/testTitle';
310-
311-
const fullTestName = getFullTestName(mockedTest);
312-
313-
expect(fullTestName).toEqual(expectedFullTestName);
314-
});
315-
});
316-
317254
describe('getFullStepName', () => {
318255
test('should return correct full step name', () => {
319256
const mockedTest = {

0 commit comments

Comments
 (0)