Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- **`abap2ui5-unit --class` no longer misdiagnoses the classes it did not run.** Every other class with a test include had no `tests` in its result, and the summary read that as "a test include, but the runner found no test method - is the local class FOR TESTING?". `scripts/ci-unit.mjs` marks such a class `notSelected` and the summary lists it as not selected, the way the VS Code extension's results view already skips it.
- **`migrate_report` runs report2UI5.** abap-cloud-gui renamed its converter
report2cloud to report2UI5 (`tools/report2ui5`) and narrowed it to the user
interface of a report - the selection screen, the event blocks, the list,
Expand Down
10 changes: 9 additions & 1 deletion scripts/ci-unit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ export function renderSummary({ framework, mode, results }) {
lines.push(`- ${r.cls.toUpperCase()}: no test include (deployed for the classes that call it)`);
continue;
}
if (r.notSelected) {
lines.push(`- ${r.cls.toUpperCase()}: not selected (--class named others)`);
continue;
}
const tests = r.tests || [];
ran += tests.filter((t) => !t.skipped).length;
if (r.notRun) {
Expand Down Expand Up @@ -412,7 +416,11 @@ async function main(argv) {
return 2;
}
for (const r of results) {
if (!withTests.includes(r.cls)) continue;
if (!withTests.includes(r.cls)) {
// a class with tests that --class did not name: not part of this run
if (r.testclasses && !r.deployError) r.notSelected = true;
continue;
}
r.tests = run.tests.filter((t) => t.object === r.cls.toUpperCase());
r.failed = run.failed && run.failed.object === r.cls.toUpperCase() ? run.failed : null;
/* The generated runner stops at the first failure: a class it had
Expand Down
13 changes: 13 additions & 0 deletions test/sandbox.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,19 @@ test('the CI runner reads the project\'s framework pin, collects classes, interf
assert.match(stopped, /\*\*ZCL_F\*\*: not run - the runner stops at the first failure \(ZCL_E\)/);
assert.doesNotMatch(stopped, /found no test method/);
assert.match(stopped, /1 test method\(s\) ran, 1 class\(es\) failing/);
/* --class narrows the run: a class with a test include that was not named
* ran nothing on purpose, and is not "a class without test methods" */
const narrowed = renderSummary({
framework: '1.145.0',
mode: 'npm',
results: [
{ cls: 'zcl_g', testclasses: true, tests: [{ localClass: 'ltcl', method: 'ok_one' }], failed: null },
{ cls: 'zcl_h', testclasses: true, notSelected: true },
],
});
assert.match(narrowed, /- ZCL_H: not selected \(--class named others\)/);
assert.doesNotMatch(narrowed, /found no test method/);
assert.match(narrowed, /1 test method\(s\) ran, 0 class\(es\) failing/);
});

/* abap2ui5-unit runs on the npm package by default: a checkout somebody
Expand Down
Loading