abapgit-agent 1.19.0 → 1.19.1
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/package.json +1 -1
- package/src/commands/inspect.js +7 -5
- package/src/commands/unit.js +8 -6
package/package.json
CHANGED
package/src/commands/inspect.js
CHANGED
|
@@ -48,8 +48,10 @@ function buildInspectJUnit(results) {
|
|
|
48
48
|
|
|
49
49
|
const testcases = [];
|
|
50
50
|
|
|
51
|
+
const inspectClass = `${escapeXml(objectName)}.Inspect`;
|
|
52
|
+
|
|
51
53
|
if (errorCount === 0 && warnCount === 0) {
|
|
52
|
-
testcases.push(` <testcase name="
|
|
54
|
+
testcases.push(` <testcase name="Syntax check" classname="${inspectClass}"/>`);
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
for (const err of errors) {
|
|
@@ -67,9 +69,9 @@ function buildInspectJUnit(results) {
|
|
|
67
69
|
text
|
|
68
70
|
].filter(Boolean).join('\n');
|
|
69
71
|
const checkId = checkClass && checkCode ? `${checkClass}/${checkCode}` : null;
|
|
70
|
-
const caseName = checkId ?
|
|
72
|
+
const caseName = checkId ? checkId : (methodName ? `${methodName} line ${line}` : `Line ${line}`);
|
|
71
73
|
testcases.push(
|
|
72
|
-
` <testcase name="${escapeXml(caseName)}" classname="${
|
|
74
|
+
` <testcase name="${escapeXml(caseName)}" classname="${inspectClass}">\n` +
|
|
73
75
|
` <failure type="SyntaxError" message="${escapeXml(text)}">${escapeXml(detail)}</failure>\n` +
|
|
74
76
|
` </testcase>`
|
|
75
77
|
);
|
|
@@ -89,9 +91,9 @@ function buildInspectJUnit(results) {
|
|
|
89
91
|
text
|
|
90
92
|
].filter(Boolean).join('\n');
|
|
91
93
|
const checkId = checkClass && checkCode ? `${checkClass}/${checkCode}` : null;
|
|
92
|
-
const caseName = checkId ?
|
|
94
|
+
const caseName = checkId ? checkId : (methodName ? `${methodName} line ${line}` : `Line ${line}`);
|
|
93
95
|
testcases.push(
|
|
94
|
-
` <testcase name="${escapeXml(caseName)}" classname="${
|
|
96
|
+
` <testcase name="${escapeXml(caseName)}" classname="${inspectClass}">\n` +
|
|
95
97
|
` <failure type="Warning" message="${escapeXml(text)}">${escapeXml(detail)}</failure>\n` +
|
|
96
98
|
` </testcase>`
|
|
97
99
|
);
|
package/src/commands/unit.js
CHANGED
|
@@ -158,6 +158,9 @@ function buildUnitJUnit(results) {
|
|
|
158
158
|
const failedMethods = methods.filter(m => !m.passed);
|
|
159
159
|
const syntheticFailures = thresholdFailure ? 1 : 0;
|
|
160
160
|
const totalFailures = failedMethods.length + syntheticFailures;
|
|
161
|
+
// classname "ZCL_MY_TEST.LTCL_UNIT_TEST" groups under the same ABAP class node
|
|
162
|
+
// as "ZCL_MY_TEST.Inspect" from the inspect report — one node per ABAP class.
|
|
163
|
+
const suiteLabel = className;
|
|
161
164
|
|
|
162
165
|
const lines = [];
|
|
163
166
|
|
|
@@ -170,13 +173,12 @@ function buildUnitJUnit(results) {
|
|
|
170
173
|
}
|
|
171
174
|
|
|
172
175
|
if (testCount === 0) {
|
|
173
|
-
lines.push(` <testcase name="(no tests)" classname="${escapeXml(
|
|
176
|
+
lines.push(` <testcase name="(no tests)" classname="${escapeXml(suiteLabel)}"/>`);
|
|
174
177
|
} else {
|
|
175
178
|
for (const m of methods) {
|
|
176
179
|
const timeAttr = m.executionTime != null ? ` time="${m.executionTime}"` : '';
|
|
177
|
-
//
|
|
178
|
-
|
|
179
|
-
const testClass = m.testClassName ? `${className}.${m.testClassName}` : className;
|
|
180
|
+
// "Unit Tests / ZCL_MY_TEST.LTCL_UNIT_TEST" groups by namespace → class → local test class.
|
|
181
|
+
const testClass = m.testClassName ? `${suiteLabel}.${m.testClassName}` : suiteLabel;
|
|
180
182
|
if (m.passed) {
|
|
181
183
|
lines.push(` <testcase name="${escapeXml(m.name)}" classname="${escapeXml(testClass)}"${timeAttr}/>`);
|
|
182
184
|
} else {
|
|
@@ -195,14 +197,14 @@ function buildUnitJUnit(results) {
|
|
|
195
197
|
|
|
196
198
|
if (thresholdFailure) {
|
|
197
199
|
lines.push(
|
|
198
|
-
` <testcase name="coverage_threshold" classname="${escapeXml(
|
|
200
|
+
` <testcase name="coverage_threshold" classname="${escapeXml(suiteLabel)}">\n` +
|
|
199
201
|
` <failure type="FAILURE" message="${escapeXml(thresholdFailure)}">${escapeXml(thresholdFailure)}</failure>\n` +
|
|
200
202
|
` </testcase>`
|
|
201
203
|
);
|
|
202
204
|
}
|
|
203
205
|
|
|
204
206
|
return (
|
|
205
|
-
` <testsuite name="${escapeXml(
|
|
207
|
+
` <testsuite name="${escapeXml(suiteLabel)}" ` +
|
|
206
208
|
`tests="${Math.max(testCount + syntheticFailures, 1)}" failures="${totalFailures}" errors="0">\n` +
|
|
207
209
|
lines.join('\n') + '\n' +
|
|
208
210
|
` </testsuite>`
|