Add createCheck to display test results in GitHub UI
parent
a28a333d0b
commit
160e6265d0
File diff suppressed because one or more lines are too long
|
|
@ -8,11 +8,11 @@ class ReportConverter {
|
||||||
const run = report['test-run'];
|
const run = report['test-run'];
|
||||||
const meta = new RunMeta(filename);
|
const meta = new RunMeta(filename);
|
||||||
|
|
||||||
meta.total = Number(run.total);
|
meta.total = Number(run.attributes.total);
|
||||||
meta.failed = Number(run.failed);
|
meta.failed = Number(run.attributes.failed);
|
||||||
meta.skipped = Number(run.skipped);
|
meta.skipped = Number(run.attributes.skipped);
|
||||||
meta.passed = Number(run.passed);
|
meta.passed = Number(run.attributes.passed);
|
||||||
meta.duration = Number(run.duration);
|
meta.duration = Number(run.attributes.duration);
|
||||||
|
|
||||||
meta.addTests(ReportConverter.convertSuite(run['test-suite']));
|
meta.addTests(ReportConverter.convertSuite(run['test-suite']));
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ class ReportConverter {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
core.debug(`Analyze suite ${suites.type} / ${suites.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) {
|
||||||
|
|
@ -37,7 +37,7 @@ class ReportConverter {
|
||||||
|
|
||||||
const tests = suites['test-case'];
|
const tests = suites['test-case'];
|
||||||
if (tests) {
|
if (tests) {
|
||||||
result.push(...ReportConverter.convertTests(suites.fullname, tests));
|
result.push(...ReportConverter.convertTests(suites.attributes.fullname, tests));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -56,7 +56,7 @@ class ReportConverter {
|
||||||
}
|
}
|
||||||
|
|
||||||
static convertTestCase(suite, testCase) {
|
static convertTestCase(suite, testCase) {
|
||||||
const { name, fullname, result, failure, duration } = testCase;
|
const { name, fullname, result, failure, duration } = testCase.attributes;
|
||||||
const meta = new TestMeta(suite, name);
|
const meta = new TestMeta(suite, name);
|
||||||
meta.result = result;
|
meta.result = result;
|
||||||
meta.duration = Number(duration);
|
meta.duration = Number(duration);
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,10 @@ class ResultsCheck {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
files.map(async filepath => {
|
files.map(async filepath => {
|
||||||
if (!filepath.endsWith('.xml')) return;
|
if (!filepath.endsWith('.xml')) return;
|
||||||
core.startGroup(`Processing file ${filepath}...`);
|
core.info(`Processing file ${filepath}...`);
|
||||||
const fileData = await ResultsCheck.parseReport(path.join(artifactsPath, filepath));
|
const fileData = await ResultsCheck.parseReport(path.join(artifactsPath, filepath));
|
||||||
core.info(fileData.summary);
|
core.info(fileData.summary);
|
||||||
runs.push(fileData);
|
runs.push(fileData);
|
||||||
core.endGroup();
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue