mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 13:57:09 +01:00
Rebuild index.js after rebase from main
This commit is contained in:
parent
6617053f9c
commit
6b64465c34
1 changed files with 9 additions and 7 deletions
16
dist/index.js
generated
vendored
16
dist/index.js
generated
vendored
|
|
@ -413,6 +413,7 @@ class TestReporter {
|
||||||
const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `;
|
const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `;
|
||||||
let baseUrl = '';
|
let baseUrl = '';
|
||||||
if (this.useActionsSummary) {
|
if (this.useActionsSummary) {
|
||||||
|
core.info(`Creating action summary`);
|
||||||
const summary = (0, get_report_1.getReport)(results, {
|
const summary = (0, get_report_1.getReport)(results, {
|
||||||
listSuites,
|
listSuites,
|
||||||
listTests,
|
listTests,
|
||||||
|
|
@ -422,10 +423,9 @@ class TestReporter {
|
||||||
badgeTitle,
|
badgeTitle,
|
||||||
reportTitle,
|
reportTitle,
|
||||||
collapsed
|
collapsed
|
||||||
});
|
}, shortSummary);
|
||||||
core.info('Summary content:');
|
core.info('Summary content:');
|
||||||
core.info(summary);
|
core.info(summary);
|
||||||
core.summary.addRaw(`# ${shortSummary}`);
|
|
||||||
await core.summary.addRaw(summary).write();
|
await core.summary.addRaw(summary).write();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -1934,11 +1934,10 @@ exports.DEFAULT_OPTIONS = {
|
||||||
reportTitle: '',
|
reportTitle: '',
|
||||||
collapsed: 'auto'
|
collapsed: 'auto'
|
||||||
};
|
};
|
||||||
function getReport(results, options = exports.DEFAULT_OPTIONS) {
|
function getReport(results, options = exports.DEFAULT_OPTIONS, shortSummary = '') {
|
||||||
core.info('Generating check run summary');
|
|
||||||
applySort(results);
|
applySort(results);
|
||||||
const opts = { ...options };
|
const opts = { ...options };
|
||||||
let lines = renderReport(results, opts);
|
let lines = renderReport(results, opts, shortSummary);
|
||||||
let report = lines.join('\n');
|
let report = lines.join('\n');
|
||||||
if (getByteLength(report) <= getMaxReportLength(options)) {
|
if (getByteLength(report) <= getMaxReportLength(options)) {
|
||||||
return report;
|
return report;
|
||||||
|
|
@ -1946,7 +1945,7 @@ function getReport(results, options = exports.DEFAULT_OPTIONS) {
|
||||||
if (opts.listTests === 'all') {
|
if (opts.listTests === 'all') {
|
||||||
core.info("Test report summary is too big - setting 'listTests' to 'failed'");
|
core.info("Test report summary is too big - setting 'listTests' to 'failed'");
|
||||||
opts.listTests = 'failed';
|
opts.listTests = 'failed';
|
||||||
lines = renderReport(results, opts);
|
lines = renderReport(results, opts, shortSummary);
|
||||||
report = lines.join('\n');
|
report = lines.join('\n');
|
||||||
if (getByteLength(report) <= getMaxReportLength(options)) {
|
if (getByteLength(report) <= getMaxReportLength(options)) {
|
||||||
return report;
|
return report;
|
||||||
|
|
@ -1993,12 +1992,15 @@ function applySort(results) {
|
||||||
function getByteLength(text) {
|
function getByteLength(text) {
|
||||||
return Buffer.byteLength(text, 'utf8');
|
return Buffer.byteLength(text, 'utf8');
|
||||||
}
|
}
|
||||||
function renderReport(results, options) {
|
function renderReport(results, options, shortSummary) {
|
||||||
const sections = [];
|
const sections = [];
|
||||||
const reportTitle = options.reportTitle.trim();
|
const reportTitle = options.reportTitle.trim();
|
||||||
if (reportTitle) {
|
if (reportTitle) {
|
||||||
sections.push(`# ${reportTitle}`);
|
sections.push(`# ${reportTitle}`);
|
||||||
}
|
}
|
||||||
|
if (shortSummary) {
|
||||||
|
sections.push(`## ${shortSummary}`);
|
||||||
|
}
|
||||||
const badge = getReportBadge(results, options);
|
const badge = getReportBadge(results, options);
|
||||||
sections.push(badge);
|
sections.push(badge);
|
||||||
const runs = getTestRunsReport(results, options);
|
const runs = getTestRunsReport(results, options);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue