@elisra-devops/docgen-data-provider 1.96.0 → 1.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/modules/ResultDataProvider.js +14 -2
- package/bin/modules/ResultDataProvider.js.map +1 -1
- package/bin/tests/modules/ResultDataProvider.test.js +8 -0
- package/bin/tests/modules/ResultDataProvider.test.js.map +1 -1
- package/package.json +1 -1
- package/src/modules/ResultDataProvider.ts +19 -4
- package/src/tests/modules/ResultDataProvider.test.ts +11 -0
package/package.json
CHANGED
|
@@ -4499,15 +4499,30 @@ export default class ResultDataProvider {
|
|
|
4499
4499
|
includeNotRunTestCases: boolean
|
|
4500
4500
|
): Record<string, any> {
|
|
4501
4501
|
return iterations.reduce((map, iterationItem) => {
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
iterationItem
|
|
4505
|
-
|
|
4502
|
+
const hasRunIdentifiers =
|
|
4503
|
+
iterationItem?.lastRunId !== undefined &&
|
|
4504
|
+
iterationItem?.lastRunId !== null &&
|
|
4505
|
+
String(iterationItem?.lastRunId).trim() !== '' &&
|
|
4506
|
+
iterationItem?.lastResultId !== undefined &&
|
|
4507
|
+
iterationItem?.lastResultId !== null &&
|
|
4508
|
+
String(iterationItem?.lastResultId).trim() !== '';
|
|
4509
|
+
|
|
4510
|
+
if (hasRunIdentifiers) {
|
|
4506
4511
|
const key = `${iterationItem.lastRunId}-${iterationItem.lastResultId}-${iterationItem.testCaseId}`;
|
|
4507
4512
|
map[key] = iterationItem;
|
|
4508
4513
|
} else if (includeNotRunTestCases) {
|
|
4509
4514
|
const key = `${iterationItem.testCaseId}`;
|
|
4510
4515
|
map[key] = iterationItem;
|
|
4516
|
+
if (isTestReporter && iterationItem?.iteration) {
|
|
4517
|
+
logger.debug(
|
|
4518
|
+
`[RunlessResolver] createIterationsMap: mapped runless testCaseId=${String(
|
|
4519
|
+
iterationItem?.testCaseId
|
|
4520
|
+
)} to case-only key`
|
|
4521
|
+
);
|
|
4522
|
+
}
|
|
4523
|
+
} else if (iterationItem?.iteration && !isTestReporter) {
|
|
4524
|
+
const key = `${iterationItem.lastRunId}-${iterationItem.lastResultId}-${iterationItem.testCaseId}`;
|
|
4525
|
+
map[key] = iterationItem;
|
|
4511
4526
|
}
|
|
4512
4527
|
return map;
|
|
4513
4528
|
}, {} as Record<string, any>);
|
|
@@ -5128,6 +5128,17 @@ describe('ResultDataProvider', () => {
|
|
|
5128
5128
|
// Assert
|
|
5129
5129
|
expect(result['1']).toBeDefined();
|
|
5130
5130
|
});
|
|
5131
|
+
|
|
5132
|
+
it('should map runless test reporter item with iteration by testCaseId key', () => {
|
|
5133
|
+
const iterations = [
|
|
5134
|
+
{ testCaseId: 217897, lastRunId: undefined, lastResultId: undefined, iteration: { actionResults: [] } },
|
|
5135
|
+
];
|
|
5136
|
+
|
|
5137
|
+
const result = (resultDataProvider as any).createIterationsMap(iterations, true, true);
|
|
5138
|
+
|
|
5139
|
+
expect(result['217897']).toBeDefined();
|
|
5140
|
+
expect(result['undefined-undefined-217897']).toBeUndefined();
|
|
5141
|
+
});
|
|
5131
5142
|
});
|
|
5132
5143
|
|
|
5133
5144
|
describe('alignStepsWithIterationsBase', () => {
|