mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-01 19:05:23 -08:00
Compare commits
12 Commits
esbuild
...
docs/markd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a1ec876a9 | ||
|
|
c4b9a11207 | ||
|
|
981f52cdc2 | ||
|
|
016f16f7b8 | ||
|
|
a6b3e93884 | ||
|
|
223c6cd55b | ||
|
|
b522d19cac | ||
|
|
d56352b96c | ||
|
|
9934a5fbd4 | ||
|
|
0f25185fa5 | ||
|
|
fb07f1b2a5 | ||
|
|
364887ed35 |
13
.markdownlint.json
Normal file
13
.markdownlint.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"blanks-around-headings": false,
|
||||||
|
"blanks-around-lists": false,
|
||||||
|
"blanks-around-tables": false,
|
||||||
|
"blanks-around-fences": false,
|
||||||
|
"no-bare-urls": false,
|
||||||
|
"line-length": false,
|
||||||
|
"ul-style": false,
|
||||||
|
"no-inline-html": false,
|
||||||
|
"no-multiple-blanks": {
|
||||||
|
"maximum": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ This [Github Action](https://github.com/features/actions) displays test results
|
|||||||
✔️ Provides final `conclusion` and counts of `passed`, `failed` and `skipped` tests as output parameters
|
✔️ Provides final `conclusion` and counts of `passed`, `failed` and `skipped` tests as output parameters
|
||||||
|
|
||||||
**How it looks:**
|
**How it looks:**
|
||||||
|||||
|
|||||
|
||||||
|:--:|:--:|:--:|:--:|
|
|:--:|:--:|:--:|:--:|
|
||||||
|
|
||||||
**Supported languages / frameworks:**
|
**Supported languages / frameworks:**
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/dart-json.json|1 ✅|4 ❌|1 ⚪|4s|
|
|[fixtures/dart-json.json](#user-content-r0)|1 ✅|4 ❌|1 ⚪|4s|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/dart-json.json</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/dart-json.json</a>
|
||||||
**6** tests were completed in **4s** with **1** passed, **4** failed and **1** skipped.
|
**6** tests were completed in **4s** with **1** passed, **4** failed and **1** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/dotnet-nunit.xml|3 ✅|5 ❌|1 ⚪|230ms|
|
|[fixtures/dotnet-nunit.xml](#user-content-r0)|3 ✅|5 ❌|1 ⚪|230ms|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/dotnet-nunit.xml</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/dotnet-nunit.xml</a>
|
||||||
**9** tests were completed in **230ms** with **3** passed, **5** failed and **1** skipped.
|
**9** tests were completed in **230ms** with **3** passed, **5** failed and **1** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/dotnet-trx.trx|5 ✅|5 ❌|1 ⚪|1s|
|
|[fixtures/dotnet-trx.trx](#user-content-r0)|5 ✅|5 ❌|1 ⚪|1s|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/dotnet-trx.trx</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/dotnet-trx.trx</a>
|
||||||
**11** tests were completed in **1s** with **5** passed, **5** failed and **1** skipped.
|
**11** tests were completed in **1s** with **5** passed, **5** failed and **1** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/external/FluentValidation.Tests.trx|803 ✅||1 ⚪|4s|
|
|[fixtures/external/FluentValidation.Tests.trx](#user-content-r0)|803 ✅||1 ⚪|4s|
|
||||||
## ✅ <a id="user-content-r0" href="#user-content-r0">fixtures/external/FluentValidation.Tests.trx</a>
|
## ✅ <a id="user-content-r0" href="#user-content-r0">fixtures/external/FluentValidation.Tests.trx</a>
|
||||||
**804** tests were completed in **4s** with **803** passed, **0** failed and **1** skipped.
|
**804** tests were completed in **4s** with **803** passed, **0** failed and **1** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/golang-json.json|5 ✅|6 ❌|1 ⚪|6s|
|
|[fixtures/golang-json.json](#user-content-r0)|5 ✅|6 ❌|1 ⚪|6s|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/golang-json.json</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/golang-json.json</a>
|
||||||
**12** tests were completed in **6s** with **5** passed, **6** failed and **1** skipped.
|
**12** tests were completed in **6s** with **5** passed, **6** failed and **1** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/jest-junit-eslint.xml|1 ✅|||0ms|
|
|[fixtures/jest-junit-eslint.xml](#user-content-r0)|1 ✅|||0ms|
|
||||||
## ✅ <a id="user-content-r0" href="#user-content-r0">fixtures/jest-junit-eslint.xml</a>
|
## ✅ <a id="user-content-r0" href="#user-content-r0">fixtures/jest-junit-eslint.xml</a>
|
||||||
**1** tests were completed in **0ms** with **1** passed, **0** failed and **0** skipped.
|
**1** tests were completed in **0ms** with **1** passed, **0** failed and **0** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/jest-junit.xml|1 ✅|4 ❌|1 ⚪|1s|
|
|[fixtures/jest-junit.xml](#user-content-r0)|1 ✅|4 ❌|1 ⚪|1s|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/jest-junit.xml</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/jest-junit.xml</a>
|
||||||
**6** tests were completed in **1s** with **1** passed, **4** failed and **1** skipped.
|
**6** tests were completed in **1s** with **1** passed, **4** failed and **1** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/external/jest/jest-react-component-test-results.xml|1 ✅|||1000ms|
|
|[fixtures/external/jest/jest-react-component-test-results.xml](#user-content-r0)|1 ✅|||1000ms|
|
||||||
## ✅ <a id="user-content-r0" href="#user-content-r0">fixtures/external/jest/jest-react-component-test-results.xml</a>
|
## ✅ <a id="user-content-r0" href="#user-content-r0">fixtures/external/jest/jest-react-component-test-results.xml</a>
|
||||||
**1** tests were completed in **1000ms** with **1** passed, **0** failed and **0** skipped.
|
**1** tests were completed in **1000ms** with **1** passed, **0** failed and **0** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/external/jest/jest-test-results.xml|4207 ✅|2 ❌|30 ⚪|166s|
|
|[fixtures/external/jest/jest-test-results.xml](#user-content-r0)|4207 ✅|2 ❌|30 ⚪|166s|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/external/jest/jest-test-results.xml</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/external/jest/jest-test-results.xml</a>
|
||||||
**4239** tests were completed in **166s** with **4207** passed, **2** failed and **30** skipped.
|
**4239** tests were completed in **166s** with **4207** passed, **2** failed and **30** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/junit-with-message.xml||1 ❌||1ms|
|
|[fixtures/junit-with-message.xml](#user-content-r0)||1 ❌||1ms|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/junit-with-message.xml</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/junit-with-message.xml</a>
|
||||||
**1** tests were completed in **1ms** with **0** passed, **1** failed and **0** skipped.
|
**1** tests were completed in **1ms** with **0** passed, **1** failed and **0** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/mocha-json.json|1 ✅|4 ❌|1 ⚪|12ms|
|
|[fixtures/mocha-json.json](#user-content-r0)|1 ✅|4 ❌|1 ⚪|12ms|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/mocha-json.json</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/mocha-json.json</a>
|
||||||
**6** tests were completed in **12ms** with **1** passed, **4** failed and **1** skipped.
|
**6** tests were completed in **12ms** with **1** passed, **4** failed and **1** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/external/mocha/mocha-test-results.json|833 ✅||6 ⚪|6s|
|
|[fixtures/external/mocha/mocha-test-results.json](#user-content-r0)|833 ✅||6 ⚪|6s|
|
||||||
## ✅ <a id="user-content-r0" href="#user-content-r0">fixtures/external/mocha/mocha-test-results.json</a>
|
## ✅ <a id="user-content-r0" href="#user-content-r0">fixtures/external/mocha/mocha-test-results.json</a>
|
||||||
**839** tests were completed in **6s** with **833** passed, **0** failed and **6** skipped.
|
**839** tests were completed in **6s** with **833** passed, **0** failed and **6** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/external/flutter/provider-test-results.json|268 ✅|1 ❌||0ms|
|
|[fixtures/external/flutter/provider-test-results.json](#user-content-r0)|268 ✅|1 ❌||0ms|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/external/flutter/provider-test-results.json</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/external/flutter/provider-test-results.json</a>
|
||||||
**269** tests were completed in **0ms** with **268** passed, **1** failed and **0** skipped.
|
**269** tests were completed in **0ms** with **268** passed, **1** failed and **0** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/external/java/TEST-org.apache.pulsar.AddMissingPatchVersionTest.xml||1 ❌|1 ⚪|116ms|
|
|[fixtures/external/java/TEST-org.apache.pulsar.AddMissingPatchVersionTest.xml](#user-content-r0)||1 ❌|1 ⚪|116ms|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/external/java/TEST-org.apache.pulsar.AddMissingPatchVersionTest.xml</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/external/java/TEST-org.apache.pulsar.AddMissingPatchVersionTest.xml</a>
|
||||||
**2** tests were completed in **116ms** with **0** passed, **1** failed and **1** skipped.
|
**2** tests were completed in **116ms** with **0** passed, **1** failed and **1** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/external/java/pulsar-test-report.xml|793 ✅|1 ❌|14 ⚪|2127s|
|
|[fixtures/external/java/pulsar-test-report.xml](#user-content-r0)|793 ✅|1 ❌|14 ⚪|2127s|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/external/java/pulsar-test-report.xml</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/external/java/pulsar-test-report.xml</a>
|
||||||
**808** tests were completed in **2127s** with **793** passed, **1** failed and **14** skipped.
|
**808** tests were completed in **2127s** with **793** passed, **1** failed and **14** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/rspec-json.json|1 ✅|1 ❌|1 ⚪|0ms|
|
|[fixtures/rspec-json.json](#user-content-r0)|1 ✅|1 ❌|1 ⚪|0ms|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/rspec-json.json</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/rspec-json.json</a>
|
||||||
**3** tests were completed in **0ms** with **1** passed, **1** failed and **1** skipped.
|
**3** tests were completed in **0ms** with **1** passed, **1** failed and **1** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/external/SilentNotes.trx|67 ✅||12 ⚪|1s|
|
|[fixtures/external/SilentNotes.trx](#user-content-r0)|67 ✅||12 ⚪|1s|
|
||||||
## ✅ <a id="user-content-r0" href="#user-content-r0">fixtures/external/SilentNotes.trx</a>
|
## ✅ <a id="user-content-r0" href="#user-content-r0">fixtures/external/SilentNotes.trx</a>
|
||||||
**79** tests were completed in **1s** with **67** passed, **0** failed and **12** skipped.
|
**79** tests were completed in **1s** with **67** passed, **0** failed and **12** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|fixtures/swift-xunit.xml|2 ✅|1 ❌||220ms|
|
|[fixtures/swift-xunit.xml](#user-content-r0)|2 ✅|1 ❌||220ms|
|
||||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/swift-xunit.xml</a>
|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/swift-xunit.xml</a>
|
||||||
**3** tests were completed in **220ms** with **2** passed, **1** failed and **0** skipped.
|
**3** tests were completed in **220ms** with **2** passed, **1** failed and **0** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|
|||||||
18
dist/index.js
generated
vendored
18
dist/index.js
generated
vendored
@@ -402,6 +402,10 @@ class TestReporter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const { listSuites, listTests, onlySummary, useActionsSummary, badgeTitle, reportTitle } = this;
|
const { listSuites, listTests, onlySummary, useActionsSummary, badgeTitle, reportTitle } = this;
|
||||||
|
const passed = results.reduce((sum, tr) => sum + tr.passed, 0);
|
||||||
|
const failed = results.reduce((sum, tr) => sum + tr.failed, 0);
|
||||||
|
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0);
|
||||||
|
const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `;
|
||||||
let baseUrl = '';
|
let baseUrl = '';
|
||||||
if (this.useActionsSummary) {
|
if (this.useActionsSummary) {
|
||||||
const summary = (0, get_report_1.getReport)(results, {
|
const summary = (0, get_report_1.getReport)(results, {
|
||||||
@@ -415,6 +419,7 @@ class TestReporter {
|
|||||||
});
|
});
|
||||||
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 {
|
||||||
@@ -444,10 +449,6 @@ class TestReporter {
|
|||||||
const annotations = (0, get_annotations_1.getAnnotations)(results, this.maxAnnotations);
|
const annotations = (0, get_annotations_1.getAnnotations)(results, this.maxAnnotations);
|
||||||
const isFailed = this.failOnError && results.some(tr => tr.result === 'failed');
|
const isFailed = this.failOnError && results.some(tr => tr.result === 'failed');
|
||||||
const conclusion = isFailed ? 'failure' : 'success';
|
const conclusion = isFailed ? 'failure' : 'success';
|
||||||
const passed = results.reduce((sum, tr) => sum + tr.passed, 0);
|
|
||||||
const failed = results.reduce((sum, tr) => sum + tr.failed, 0);
|
|
||||||
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0);
|
|
||||||
const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `;
|
|
||||||
core.info(`Updating check run conclusion (${conclusion}) and output`);
|
core.info(`Updating check run conclusion (${conclusion}) and output`);
|
||||||
const resp = await this.octokit.rest.checks.update({
|
const resp = await this.octokit.rest.checks.update({
|
||||||
check_run_id: createResp.data.id,
|
check_run_id: createResp.data.id,
|
||||||
@@ -2033,14 +2034,17 @@ function getTestRunsReport(testRuns, options) {
|
|||||||
}
|
}
|
||||||
if (testRuns.length > 0 || options.onlySummary) {
|
if (testRuns.length > 0 || options.onlySummary) {
|
||||||
const tableData = testRuns
|
const tableData = testRuns
|
||||||
.filter(tr => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)
|
.map((tr, originalIndex) => ({ tr, originalIndex }))
|
||||||
.map(tr => {
|
.filter(({ tr }) => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)
|
||||||
|
.map(({ tr, originalIndex }) => {
|
||||||
const time = (0, markdown_utils_1.formatTime)(tr.time);
|
const time = (0, markdown_utils_1.formatTime)(tr.time);
|
||||||
const name = tr.path;
|
const name = tr.path;
|
||||||
|
const addr = options.baseUrl + makeRunSlug(originalIndex, options).link;
|
||||||
|
const nameLink = (0, markdown_utils_1.link)(name, addr);
|
||||||
const passed = tr.passed > 0 ? `${tr.passed} ${markdown_utils_1.Icon.success}` : '';
|
const passed = tr.passed > 0 ? `${tr.passed} ${markdown_utils_1.Icon.success}` : '';
|
||||||
const failed = tr.failed > 0 ? `${tr.failed} ${markdown_utils_1.Icon.fail}` : '';
|
const failed = tr.failed > 0 ? `${tr.failed} ${markdown_utils_1.Icon.fail}` : '';
|
||||||
const skipped = tr.skipped > 0 ? `${tr.skipped} ${markdown_utils_1.Icon.skip}` : '';
|
const skipped = tr.skipped > 0 ? `${tr.skipped} ${markdown_utils_1.Icon.skip}` : '';
|
||||||
return [name, passed, failed, skipped, time];
|
return [nameLink, passed, failed, skipped, time];
|
||||||
});
|
});
|
||||||
const resultsTable = (0, markdown_utils_1.table)(['Report', 'Passed', 'Failed', 'Skipped', 'Time'], [markdown_utils_1.Align.Left, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right], ...tableData);
|
const resultsTable = (0, markdown_utils_1.table)(['Report', 'Passed', 'Failed', 'Skipped', 'Time'], [markdown_utils_1.Align.Left, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right], ...tableData);
|
||||||
sections.push(resultsTable);
|
sections.push(resultsTable);
|
||||||
|
|||||||
@@ -81,5 +81,10 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
|
},
|
||||||
|
"markdownlint-cli2": {
|
||||||
|
"ignores": [
|
||||||
|
"__tests__/**/*"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
src/main.ts
11
src/main.ts
@@ -168,6 +168,11 @@ class TestReporter {
|
|||||||
|
|
||||||
const {listSuites, listTests, onlySummary, useActionsSummary, badgeTitle, reportTitle} = this
|
const {listSuites, listTests, onlySummary, useActionsSummary, badgeTitle, reportTitle} = this
|
||||||
|
|
||||||
|
const passed = results.reduce((sum, tr) => sum + tr.passed, 0)
|
||||||
|
const failed = results.reduce((sum, tr) => sum + tr.failed, 0)
|
||||||
|
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0)
|
||||||
|
const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `
|
||||||
|
|
||||||
let baseUrl = ''
|
let baseUrl = ''
|
||||||
if (this.useActionsSummary) {
|
if (this.useActionsSummary) {
|
||||||
const summary = getReport(results, {
|
const summary = getReport(results, {
|
||||||
@@ -182,6 +187,7 @@ class TestReporter {
|
|||||||
|
|
||||||
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 {
|
||||||
core.info(`Creating check run ${name}`)
|
core.info(`Creating check run ${name}`)
|
||||||
@@ -214,11 +220,6 @@ class TestReporter {
|
|||||||
const isFailed = this.failOnError && results.some(tr => tr.result === 'failed')
|
const isFailed = this.failOnError && results.some(tr => tr.result === 'failed')
|
||||||
const conclusion = isFailed ? 'failure' : 'success'
|
const conclusion = isFailed ? 'failure' : 'success'
|
||||||
|
|
||||||
const passed = results.reduce((sum, tr) => sum + tr.passed, 0)
|
|
||||||
const failed = results.reduce((sum, tr) => sum + tr.failed, 0)
|
|
||||||
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0)
|
|
||||||
const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `
|
|
||||||
|
|
||||||
core.info(`Updating check run conclusion (${conclusion}) and output`)
|
core.info(`Updating check run conclusion (${conclusion}) and output`)
|
||||||
const resp = await this.octokit.rest.checks.update({
|
const resp = await this.octokit.rest.checks.update({
|
||||||
check_run_id: createResp.data.id,
|
check_run_id: createResp.data.id,
|
||||||
|
|||||||
@@ -159,14 +159,17 @@ function getTestRunsReport(testRuns: TestRunResult[], options: ReportOptions): s
|
|||||||
|
|
||||||
if (testRuns.length > 0 || options.onlySummary) {
|
if (testRuns.length > 0 || options.onlySummary) {
|
||||||
const tableData = testRuns
|
const tableData = testRuns
|
||||||
.filter(tr => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)
|
.map((tr, originalIndex) => ({tr, originalIndex}))
|
||||||
.map(tr => {
|
.filter(({tr}) => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)
|
||||||
|
.map(({tr, originalIndex}) => {
|
||||||
const time = formatTime(tr.time)
|
const time = formatTime(tr.time)
|
||||||
const name = tr.path
|
const name = tr.path
|
||||||
|
const addr = options.baseUrl + makeRunSlug(originalIndex, options).link
|
||||||
|
const nameLink = link(name, addr)
|
||||||
const passed = tr.passed > 0 ? `${tr.passed} ${Icon.success}` : ''
|
const passed = tr.passed > 0 ? `${tr.passed} ${Icon.success}` : ''
|
||||||
const failed = tr.failed > 0 ? `${tr.failed} ${Icon.fail}` : ''
|
const failed = tr.failed > 0 ? `${tr.failed} ${Icon.fail}` : ''
|
||||||
const skipped = tr.skipped > 0 ? `${tr.skipped} ${Icon.skip}` : ''
|
const skipped = tr.skipped > 0 ? `${tr.skipped} ${Icon.skip}` : ''
|
||||||
return [name, passed, failed, skipped, time]
|
return [nameLink, passed, failed, skipped, time]
|
||||||
})
|
})
|
||||||
|
|
||||||
const resultsTable = table(
|
const resultsTable = table(
|
||||||
|
|||||||
Reference in New Issue
Block a user