Skip to content

Commit c619611

Browse files
authored
Merge pull request #1289 from mikepenz/feature/add_verbose_summary_flag
Add new config to disable the verbose summary
2 parents 3eb7372 + 4c1397a commit c619611

File tree

8 files changed

+23
-10
lines changed

8 files changed

+23
-10
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ jobs:
9595
| `transformers` | Optional. Array of `Transformer`s offering the ability to adjust the fileName. Defaults to: `[{"searchValue":"::","replaceValue":"/"}]` |
9696
| `job_summary` | Optional. Enables the publishing of the job summary for the results. Defaults to `true`. May be required to disable [Enterprise Server](https://github.com/mikepenz/action-junit-report/issues/637) |
9797
| `detailed_summary` | Optional. Include table with all test results in the summary. Defaults to `false`. |
98-
| `flaky_summary` | Optional. Include table with all falky results in the summary. Defaults to `false`. |
98+
| `flaky_summary` | Optional. Include table with all flaky results in the summary. Defaults to `false`. |
99+
| `verbose_summary` | Optional. Detail table will note if there were no test annotations for a test suite. Defaults to `true`. |
99100
| `group_suite` | Optional. If enabled, will group the testcases by test suite in the `detailed_summary`. Defaults to `false`. |
100101
| `comment` | Optional. Enables a comment being added to the PR with the summary tables (Respects the summary configuration flags). Defaults to `false`. |
101102
| `updateComment` | Optional. If a prior action run comment exists, it is updated. If disabled, new comments are creted for each run. Defaults to `true`. |

__tests__/table.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('buildSummaryTables', () => {
5959
'/'
6060
)
6161

62-
const [table, detailTable, flakyTable] = buildSummaryTables([testResult], true, true, true)
62+
const [table, detailTable, flakyTable] = buildSummaryTables([testResult], true, true, true, true)
6363

6464
expect(table).toStrictEqual(NORMAL_TABLE)
6565
expect(detailTable).toStrictEqual([
@@ -100,7 +100,7 @@ describe('buildSummaryTables', () => {
100100
'/'
101101
)
102102

103-
const [table, detailTable, flakyTable] = buildSummaryTables([testResult], true, true, true, true)
103+
const [table, detailTable, flakyTable] = buildSummaryTables([testResult], true, true, true, true, true)
104104

105105
expect(table).toStrictEqual(NORMAL_TABLE)
106106
expect(detailTable).toStrictEqual([

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ inputs:
9494
description: 'Include table with all flaky results in summary'
9595
required: false
9696
default: 'false'
97+
verbose_summary:
98+
description: 'Include note of missing test annotations in summary.'
99+
required: false
100+
default: 'true'
97101
group_suite:
98102
description: 'If enabled, will group the testcases by test suite in the `detailed_summary`'
99103
required: false

dist/index.js

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/annotator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export async function attachComment(
160160
const identifier = buildCommentIdentifier(checkName)
161161

162162
let comment = buildTable(table)
163-
if (detailsTable.length > 0) {
163+
if (detailsTable.length > 1) {
164164
comment += '\n\n'
165165
comment += buildTable(detailsTable)
166166
}

src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export async function run(): Promise<void> {
3131
const jobSummary = core.getInput('job_summary') === 'true'
3232
const detailedSummary = core.getInput('detailed_summary') === 'true'
3333
const flakySummary = core.getInput('flaky_summary') === 'true'
34+
const verboseSummary = core.getInput('verbose_summary') === 'true'
3435
const groupSuite = core.getInput('group_suite') === 'true'
3536
const comment = core.getInput('comment') === 'true'
3637
const updateComment = core.getInput('updateComment') === 'true'
@@ -155,6 +156,7 @@ export async function run(): Promise<void> {
155156
includePassed,
156157
detailedSummary,
157158
flakySummary,
159+
verboseSummary,
158160
groupSuite
159161
)
160162
if (jobSummary && supportsJobSummary) {

src/table.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export function buildSummaryTables(
88
includePassed: boolean,
99
detailedSummary: boolean,
1010
flakySummary: boolean,
11+
verboseSummary: boolean,
1112
groupSuite = false
1213
): [SummaryTableRow[], SummaryTableRow[], SummaryTableRow[]] {
1314
// only include a warning icon if there are skipped tests
@@ -67,7 +68,9 @@ export function buildSummaryTables(
6768
`⚠️ No annotations found for ${testResult.checkName}. If you want to include passed results in this table please configure 'include_passed' as 'true'`
6869
)
6970
}
70-
detailsTable.push([{data: `No test annotations available`, colspan: '2'}])
71+
if (verboseSummary) {
72+
detailsTable.push([{data: `No test annotations available`, colspan: '2'}])
73+
}
7174
} else {
7275
if (detailedSummary) {
7376
detailsTable.push([{data: `<strong>${testResult.checkName}</strong>`, colspan: '2'}])

0 commit comments

Comments
 (0)