Skip to content

Commit

Permalink
Switch to full html output for comment and remove summary generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Crabtree committed Oct 16, 2024
1 parent 9581d6d commit e5b7746
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
6 changes: 1 addition & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,12 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
try {
const { token, title, resultsPath, coveragePath, coverageType, coverageThreshold, postNewComment, allowFailedTests, showFailedTestsOnly, showTestOutput } = (0, utils_1.getInputs)();
let comment = '';
let summary = (0, html_1.formatTitleHtml)(title);
const testResult = yield (0, results_1.processTestResults)(resultsPath, allowFailedTests);
comment += (0, markdown_1.formatResultMarkdown)(testResult) + "<br><br><br><br><br>" + (0, html_1.formatResultHtml)(testResult, showFailedTestsOnly, showTestOutput);
summary += (0, html_1.formatResultHtml)(testResult, showFailedTestsOnly, showTestOutput);
comment += (0, html_1.formatResultHtml)(testResult, showFailedTestsOnly, showTestOutput);
if (coveragePath) {
const testCoverage = yield (0, coverage_1.processTestCoverage)(coveragePath, coverageType, coverageThreshold);
comment += testCoverage ? (0, markdown_1.formatCoverageMarkdown)(testCoverage, coverageThreshold) : '';
summary += testCoverage ? (0, html_1.formatCoverageHtml)(testCoverage) : '';
}
yield (0, utils_1.setSummary)(summary);
yield (0, utils_1.publishComment)(token, title, comment, postNewComment);
}
catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { processTestResults } from './results';
import { processTestCoverage } from './coverage';
import { getInputs, publishComment, setFailed, setSummary } from './utils';
import { formatCoverageMarkdown, formatResultMarkdown } from './formatting/markdown';
import { formatCoverageHtml, formatResultHtml, formatTitleHtml } from './formatting/html';
import { getInputs, publishComment, setFailed } from './utils';
import { formatCoverageMarkdown } from './formatting/markdown';
import { formatResultHtml } from './formatting/html';

const run = async (): Promise<void> => {
try {
Expand All @@ -20,19 +20,15 @@ const run = async (): Promise<void> => {
} = getInputs();

let comment = '';
let summary = formatTitleHtml(title);

const testResult = await processTestResults(resultsPath, allowFailedTests);
comment += formatResultMarkdown(testResult) + "<br><br><br><br><br>" + formatResultHtml(testResult, showFailedTestsOnly, showTestOutput);
summary += formatResultHtml(testResult, showFailedTestsOnly, showTestOutput);
comment += formatResultHtml(testResult, showFailedTestsOnly, showTestOutput);

if (coveragePath) {
const testCoverage = await processTestCoverage(coveragePath, coverageType, coverageThreshold);
comment += testCoverage ? formatCoverageMarkdown(testCoverage, coverageThreshold) : '';
summary += testCoverage ? formatCoverageHtml(testCoverage) : '';
}

await setSummary(summary);
await publishComment(token, title, comment, postNewComment);
} catch (error) {
setFailed((error as Error).message);
Expand Down

0 comments on commit e5b7746

Please sign in to comment.