Add createCheck to display test results in GitHub UI
parent
31641a173a
commit
27094d760c
File diff suppressed because one or more lines are too long
|
|
@ -4,7 +4,7 @@ import { RunMeta, TestMeta } from './ts/meta.ts';
|
||||||
class ReportConverter {
|
class ReportConverter {
|
||||||
static convertReport(filename, report) {
|
static convertReport(filename, report) {
|
||||||
core.info(`Start analyzing report: ${filename}`);
|
core.info(`Start analyzing report: ${filename}`);
|
||||||
core.info(JSON.stringify(report));
|
core.debug(JSON.stringify(report));
|
||||||
const run = report['test-run'];
|
const run = report['test-run'];
|
||||||
const meta = new RunMeta(filename);
|
const meta = new RunMeta(filename);
|
||||||
|
|
||||||
|
|
@ -14,9 +14,9 @@ class ReportConverter {
|
||||||
meta.passed = Number(run._attributes.passed);
|
meta.passed = Number(run._attributes.passed);
|
||||||
meta.duration = Number(run._attributes.duration);
|
meta.duration = Number(run._attributes.duration);
|
||||||
|
|
||||||
core.info(`test-suite length ${run['test-suite'].length} and value ${run['test-suite']}`);
|
core.debug(`test-suite length ${run['test-suite'].length} and value ${run['test-suite']}`);
|
||||||
meta.addTests(ReportConverter.convertSuite(run['test-suite']));
|
meta.addTests(ReportConverter.convertSuite(run['test-suite']));
|
||||||
core.info(`meta length ${meta.suites.length}`);
|
core.debug(`meta length ${meta.suites.length}`);
|
||||||
|
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
@ -27,25 +27,25 @@ class ReportConverter {
|
||||||
suites.forEach(suite => {
|
suites.forEach(suite => {
|
||||||
innerResult.concat(ReportConverter.convertSuite(suite));
|
innerResult.concat(ReportConverter.convertSuite(suite));
|
||||||
});
|
});
|
||||||
core.info(`innerResult length ${innerResult.length}`);
|
core.debug(`innerResult length ${innerResult.length}`);
|
||||||
return innerResult;
|
return innerResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info(`Analyze suite ${suites._attributes.type} / ${suites._attributes.fullname}`);
|
core.debug(`Analyze suite ${suites._attributes.type} / ${suites._attributes.fullname}`);
|
||||||
const result = [];
|
const result = [];
|
||||||
const innerSuite = suites['test-suite'];
|
const innerSuite = suites['test-suite'];
|
||||||
if (innerSuite) {
|
if (innerSuite) {
|
||||||
|
core.debug(`pushing suite ${innerSuite._attributes.id}`);
|
||||||
result.push(...ReportConverter.convertSuite(innerSuite));
|
result.push(...ReportConverter.convertSuite(innerSuite));
|
||||||
core.info(`pushed suite ${innerSuite._attributes.id}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests = suites['test-case'];
|
const tests = suites['test-case'];
|
||||||
if (tests) {
|
if (tests) {
|
||||||
core.info(`tests length ${tests.length}`);
|
core.debug(`tests length ${tests.length}`);
|
||||||
result.push(...ReportConverter.convertTests(suites._attributes.fullname, tests));
|
result.push(...ReportConverter.convertTests(suites._attributes.fullname, tests));
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info(`result length ${result.length}`);
|
core.infdebugo(`result length ${result.length}`);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,7 +53,8 @@ class ReportConverter {
|
||||||
if (Array.isArray(tests)) {
|
if (Array.isArray(tests)) {
|
||||||
const result = [];
|
const result = [];
|
||||||
tests.forEach(test => {
|
tests.forEach(test => {
|
||||||
result.concat(ReportConverter.convertTests(suite, test));
|
core.debug(`pushing test ${test._attributes.name}`);
|
||||||
|
result.concat(ReportConverter.convertTestCase(suite, test));
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -68,7 +69,7 @@ class ReportConverter {
|
||||||
meta.duration = Number(duration);
|
meta.duration = Number(duration);
|
||||||
|
|
||||||
if (!failure) {
|
if (!failure) {
|
||||||
core.info(`Skip test ${fullname} without failure data`);
|
core.debug(`Skip test ${fullname} without failure data`);
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue