Add createCheck to display test results in GitHub UI

pull/97/head
David Finol 2021-02-21 19:03:06 -06:00
parent 160e6265d0
commit 68336896a2
4 changed files with 42 additions and 41 deletions

View File

@ -16,6 +16,7 @@
"settings": { "react": { "version": "latest" } },
"rules": {
"prettier/prettier": "error",
"import/no-extraneous-dependencies": 0
"import/no-extraneous-dependencies": 0,
"no-underscore-dangle": 0
}
}

File diff suppressed because one or more lines are too long

View File

@ -8,11 +8,11 @@ class ReportConverter {
const run = report['test-run'];
const meta = new RunMeta(filename);
meta.total = Number(run.attributes.total);
meta.failed = Number(run.attributes.failed);
meta.skipped = Number(run.attributes.skipped);
meta.passed = Number(run.attributes.passed);
meta.duration = Number(run.attributes.duration);
meta.total = Number(run._attributes.total);
meta.failed = Number(run._attributes.failed);
meta.skipped = Number(run._attributes.skipped);
meta.passed = Number(run._attributes.passed);
meta.duration = Number(run._attributes.duration);
meta.addTests(ReportConverter.convertSuite(run['test-suite']));
@ -28,7 +28,7 @@ class ReportConverter {
return result;
}
core.debug(`Analyze suite ${suites.attributes.type} / ${suites.attributes.fullname}`);
core.debug(`Analyze suite ${suites._attributes.type} / ${suites._attributes.fullname}`);
const result = [];
const innerSuite = suites['test-suite'];
if (innerSuite) {
@ -37,7 +37,7 @@ class ReportConverter {
const tests = suites['test-case'];
if (tests) {
result.push(...ReportConverter.convertTests(suites.attributes.fullname, tests));
result.push(...ReportConverter.convertTests(suites._attributes.fullname, tests));
}
return result;
@ -56,7 +56,7 @@ class ReportConverter {
}
static convertTestCase(suite, testCase) {
const { name, fullname, result, failure, duration } = testCase.attributes;
const { name, fullname, result, failure, duration } = testCase._attributes;
const meta = new TestMeta(suite, name);
meta.result = result;
meta.duration = Number(duration);

View File

@ -16,7 +16,7 @@ interface CommonSuiteAttributes extends CommonAttributes {
}
export interface TestRun {
attributes: TestRunAttributes;
_attributes: TestRunAttributes;
'test-suite': TestSuite | TestSuite[];
}
@ -26,7 +26,7 @@ export interface TestRunAttributes extends CommonSuiteAttributes {
}
export interface TestSuite {
attributes: TestSuiteAttributes;
_attributes: TestSuiteAttributes;
'test-suite': TestSuite | TestSuite[];
'test-case': TestCase | TestCase[];
failure?: FailureMessage;
@ -39,7 +39,7 @@ export interface TestSuiteAttributes extends CommonSuiteAttributes {
}
export interface TestCase {
attributes: TestCaseAttributes;
_attributes: TestCaseAttributes;
failure?: FailureMessage;
}
@ -53,6 +53,6 @@ export interface TestCaseAttributes extends CommonAttributes {
}
export interface FailureMessage {
message: {cdata: string};
'stack-trace'?: {cdata: string};
message: { cdata: string };
'stack-trace'?: { cdata: string };
}