@elisra-devops/docgen-data-provider 1.89.0 → 1.90.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/models/mewp-reporting.d.ts +0 -4
- package/bin/modules/ResultDataProvider.d.ts +2 -3
- package/bin/modules/ResultDataProvider.js +11 -90
- package/bin/modules/ResultDataProvider.js.map +1 -1
- package/package.json +1 -1
- package/src/models/mewp-reporting.ts +0 -5
- package/src/modules/ResultDataProvider.ts +4 -100
package/package.json
CHANGED
|
@@ -15,11 +15,6 @@ export interface MewpExternalFileRef {
|
|
|
15
15
|
export interface MewpCoverageRequestOptions {
|
|
16
16
|
externalBugsFile?: MewpExternalFileRef | null;
|
|
17
17
|
externalL3L4File?: MewpExternalFileRef | null;
|
|
18
|
-
debugMode?: boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface MewpInternalValidationRequestOptions {
|
|
22
|
-
debugMode?: boolean;
|
|
23
18
|
}
|
|
24
19
|
|
|
25
20
|
export interface MewpRequirementStepSummary {
|
|
@@ -13,7 +13,6 @@ import type {
|
|
|
13
13
|
MewpExternalTableValidationResult,
|
|
14
14
|
MewpCoverageRow,
|
|
15
15
|
MewpInternalValidationFlatPayload,
|
|
16
|
-
MewpInternalValidationRequestOptions,
|
|
17
16
|
MewpInternalValidationRow,
|
|
18
17
|
MewpL2RequirementFamily,
|
|
19
18
|
MewpL2RequirementWorkItem,
|
|
@@ -548,9 +547,6 @@ export default class ResultDataProvider {
|
|
|
548
547
|
const parsedDefinitionStepsByTestCase = new Map<number, TestSteps[]>();
|
|
549
548
|
const testCaseStepsXmlMap = this.buildTestCaseStepsXmlMap(testData);
|
|
550
549
|
const runResults = await this.fetchAllResultDataTestReporter(testData, projectName, [], false, false);
|
|
551
|
-
if (options?.debugMode) {
|
|
552
|
-
this.logMewpRunScenarioDebugMatrix(runResults, `coverage plan=${testPlanId}`);
|
|
553
|
-
}
|
|
554
550
|
for (const runResult of runResults) {
|
|
555
551
|
const testCaseId = this.extractMewpTestCaseId(runResult);
|
|
556
552
|
const rawActionResults = Array.isArray(runResult?.iteration?.actionResults)
|
|
@@ -736,8 +732,7 @@ export default class ResultDataProvider {
|
|
|
736
732
|
testPlanId: string,
|
|
737
733
|
projectName: string,
|
|
738
734
|
selectedSuiteIds: number[] | undefined,
|
|
739
|
-
linkedQueryRequest?: any
|
|
740
|
-
options?: MewpInternalValidationRequestOptions
|
|
735
|
+
linkedQueryRequest?: any
|
|
741
736
|
): Promise<MewpInternalValidationFlatPayload> {
|
|
742
737
|
const defaultPayload: MewpInternalValidationFlatPayload = {
|
|
743
738
|
sheetName: `MEWP Internal Validation - Plan ${testPlanId}`,
|
|
@@ -796,16 +791,6 @@ export default class ResultDataProvider {
|
|
|
796
791
|
`fromSuitePayload=${preloadedStepXmlCount} fromWorkItemFallback=${fallbackStepLoadStats.loadedFromFallback} ` +
|
|
797
792
|
`stepsXmlAvailable=${stepsXmlByTestCase.size} unresolved=${fallbackStepLoadStats.unresolvedCount}`
|
|
798
793
|
);
|
|
799
|
-
if (options?.debugMode) {
|
|
800
|
-
const debugRunResults = await this.fetchAllResultDataTestReporter(
|
|
801
|
-
testData,
|
|
802
|
-
projectName,
|
|
803
|
-
[],
|
|
804
|
-
false,
|
|
805
|
-
false
|
|
806
|
-
);
|
|
807
|
-
this.logMewpRunScenarioDebugMatrix(debugRunResults, `internal-validation plan=${testPlanId}`);
|
|
808
|
-
}
|
|
809
794
|
|
|
810
795
|
const validL2BaseKeys = new Set<string>([...requirementFamilies.keys()]);
|
|
811
796
|
const diagnostics = {
|
|
@@ -3873,79 +3858,6 @@ export default class ResultDataProvider {
|
|
|
3873
3858
|
return this.fetchResultDataBasedOnWiBase(projectName, runId, resultId);
|
|
3874
3859
|
}
|
|
3875
3860
|
|
|
3876
|
-
private logMewpRunScenarioDebugMatrix(runResults: any[], contextLabel: string): void {
|
|
3877
|
-
const results = Array.isArray(runResults) ? runResults : [];
|
|
3878
|
-
const matrix = {
|
|
3879
|
-
total: results.length,
|
|
3880
|
-
passOrFailWithActionResults: 0,
|
|
3881
|
-
runWithNoActionResults: 0,
|
|
3882
|
-
notApplicable: 0,
|
|
3883
|
-
noRunHistoryActive: 0,
|
|
3884
|
-
other: 0,
|
|
3885
|
-
};
|
|
3886
|
-
const samples = {
|
|
3887
|
-
passOrFailWithActionResults: [] as number[],
|
|
3888
|
-
runWithNoActionResults: [] as number[],
|
|
3889
|
-
notApplicable: [] as number[],
|
|
3890
|
-
noRunHistoryActive: [] as number[],
|
|
3891
|
-
other: [] as number[],
|
|
3892
|
-
};
|
|
3893
|
-
|
|
3894
|
-
const pushSample = (bucket: keyof typeof samples, id: number) => {
|
|
3895
|
-
if (!Number.isFinite(id) || id <= 0) return;
|
|
3896
|
-
if (samples[bucket].length >= 5) return;
|
|
3897
|
-
samples[bucket].push(id);
|
|
3898
|
-
};
|
|
3899
|
-
|
|
3900
|
-
for (const item of results) {
|
|
3901
|
-
const testCaseId = Number(item?.testCaseId || item?.testCase?.id || 0);
|
|
3902
|
-
const hasRun = Number(item?.lastRunId || 0) > 0 && Number(item?.lastResultId || 0) > 0;
|
|
3903
|
-
const rawOutcome = String(item?._debugTestOutcome || '').trim().toLowerCase();
|
|
3904
|
-
const rawState = String(item?._debugTestCaseState || '').trim().toLowerCase();
|
|
3905
|
-
const originalActionResultsCount = Number(item?._debugOriginalActionResultsCount ?? -1);
|
|
3906
|
-
|
|
3907
|
-
if (rawOutcome === 'notapplicable' || rawOutcome === 'not applicable') {
|
|
3908
|
-
matrix.notApplicable += 1;
|
|
3909
|
-
pushSample('notApplicable', testCaseId);
|
|
3910
|
-
continue;
|
|
3911
|
-
}
|
|
3912
|
-
|
|
3913
|
-
if (hasRun && (rawOutcome === 'passed' || rawOutcome === 'failed') && originalActionResultsCount > 0) {
|
|
3914
|
-
matrix.passOrFailWithActionResults += 1;
|
|
3915
|
-
pushSample('passOrFailWithActionResults', testCaseId);
|
|
3916
|
-
continue;
|
|
3917
|
-
}
|
|
3918
|
-
|
|
3919
|
-
if (hasRun && originalActionResultsCount === 0) {
|
|
3920
|
-
matrix.runWithNoActionResults += 1;
|
|
3921
|
-
pushSample('runWithNoActionResults', testCaseId);
|
|
3922
|
-
continue;
|
|
3923
|
-
}
|
|
3924
|
-
|
|
3925
|
-
if (!hasRun && rawState === 'active') {
|
|
3926
|
-
matrix.noRunHistoryActive += 1;
|
|
3927
|
-
pushSample('noRunHistoryActive', testCaseId);
|
|
3928
|
-
continue;
|
|
3929
|
-
}
|
|
3930
|
-
|
|
3931
|
-
matrix.other += 1;
|
|
3932
|
-
pushSample('other', testCaseId);
|
|
3933
|
-
}
|
|
3934
|
-
|
|
3935
|
-
logger.info(
|
|
3936
|
-
`MEWP run debug matrix (${contextLabel}): total=${matrix.total}; ` +
|
|
3937
|
-
`passOrFailWithActionResults=${matrix.passOrFailWithActionResults}; ` +
|
|
3938
|
-
`runWithNoActionResults=${matrix.runWithNoActionResults}; ` +
|
|
3939
|
-
`notApplicable=${matrix.notApplicable}; ` +
|
|
3940
|
-
`noRunHistoryActive=${matrix.noRunHistoryActive}; other=${matrix.other}; ` +
|
|
3941
|
-
`samplePassFail=${samples.passOrFailWithActionResults.join(',') || '-'}; ` +
|
|
3942
|
-
`sampleNoAction=${samples.runWithNoActionResults.join(',') || '-'}; ` +
|
|
3943
|
-
`sampleNA=${samples.notApplicable.join(',') || '-'}; ` +
|
|
3944
|
-
`sampleNoRunActive=${samples.noRunHistoryActive.join(',') || '-'}; ` +
|
|
3945
|
-
`sampleOther=${samples.other.join(',') || '-'}`
|
|
3946
|
-
);
|
|
3947
|
-
}
|
|
3948
|
-
|
|
3949
3861
|
/**
|
|
3950
3862
|
* Converts a run status string into a human-readable format.
|
|
3951
3863
|
*
|
|
@@ -4381,11 +4293,6 @@ export default class ResultDataProvider {
|
|
|
4381
4293
|
resultData.iterationDetails.push(iteration);
|
|
4382
4294
|
}
|
|
4383
4295
|
|
|
4384
|
-
const originalActionResultsCount = Array.isArray(iteration?.actionResults)
|
|
4385
|
-
? iteration.actionResults.length
|
|
4386
|
-
: 0;
|
|
4387
|
-
resultData._debugOriginalActionResultsCount = originalActionResultsCount;
|
|
4388
|
-
|
|
4389
4296
|
if (resultData.stepsResultXml && iteration) {
|
|
4390
4297
|
const actionResults = Array.isArray(iteration.actionResults) ? iteration.actionResults : [];
|
|
4391
4298
|
const actionResultsWithSharedModels = actionResults.filter(
|
|
@@ -5098,7 +5005,7 @@ export default class ResultDataProvider {
|
|
|
5098
5005
|
resultData.iterationDetails?.length > 0
|
|
5099
5006
|
? resultData.iterationDetails[resultData.iterationDetails?.length - 1]
|
|
5100
5007
|
: undefined;
|
|
5101
|
-
const
|
|
5008
|
+
const testOutcome = this.getTestOutcome(resultData);
|
|
5102
5009
|
|
|
5103
5010
|
if (!resultData?.testCase || !resultData?.testSuite) {
|
|
5104
5011
|
logger.debug(
|
|
@@ -5132,9 +5039,6 @@ export default class ResultDataProvider {
|
|
|
5132
5039
|
relatedCRs: resultData.relatedCRs || undefined,
|
|
5133
5040
|
lastRunResult: undefined as any,
|
|
5134
5041
|
customFields: {}, // Create an object to store custom fields
|
|
5135
|
-
_debugTestOutcome: debugOutcome,
|
|
5136
|
-
_debugTestCaseState: String(resultData?.state || ''),
|
|
5137
|
-
_debugOriginalActionResultsCount: Number(resultData?._debugOriginalActionResultsCount ?? -1),
|
|
5138
5042
|
};
|
|
5139
5043
|
|
|
5140
5044
|
// Process all custom fields from resultData.filteredFields
|
|
@@ -5156,12 +5060,12 @@ export default class ResultDataProvider {
|
|
|
5156
5060
|
case 'testCaseResult':
|
|
5157
5061
|
if (lastRunId === undefined || lastResultId === undefined) {
|
|
5158
5062
|
resultDataResponse.testCaseResult = {
|
|
5159
|
-
resultMessage: `${this.convertRunStatus(
|
|
5063
|
+
resultMessage: `${this.convertRunStatus(testOutcome)}`,
|
|
5160
5064
|
url: '',
|
|
5161
5065
|
};
|
|
5162
5066
|
} else {
|
|
5163
5067
|
resultDataResponse.testCaseResult = {
|
|
5164
|
-
resultMessage: `${this.convertRunStatus(
|
|
5068
|
+
resultMessage: `${this.convertRunStatus(testOutcome)} in Run ${lastRunId}`,
|
|
5165
5069
|
url: `${this.orgUrl}${projectName}/_testManagement/runs?runId=${lastRunId}&_a=resultSummary&resultId=${lastResultId}`,
|
|
5166
5070
|
};
|
|
5167
5071
|
}
|