Skip to content

Commit

Permalink
Merge pull request #588 from OlesGalatsan/features/add-links-to-report
Browse files Browse the repository at this point in the history
  • Loading branch information
Jozef Izso authored and GitHub committed Jun 8, 2025
2 parents d56352b + 223c6cd commit a6b3e93
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion __tests__/__outputs__/dart-json.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-1%20passed%2C%204%20failed%2C%201%20skipped-critical)
|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>
**6** tests were completed in **4s** with **1** passed, **4** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/dotnet-nunit.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-3%20passed%2C%205%20failed%2C%201%20skipped-critical)
|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>
**9** tests were completed in **230ms** with **3** passed, **5** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/dotnet-trx.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-5%20passed%2C%205%20failed%2C%201%20skipped-critical)
|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>
**11** tests were completed in **1s** with **5** passed, **5** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/fluent-validation-test-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

|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>
**804** tests were completed in **4s** with **803** passed, **0** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/golang-json.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-5%20passed%2C%206%20failed%2C%201%20skipped-critical)
|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>
**12** tests were completed in **6s** with **5** passed, **6** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/jest-junit-eslint.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

|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>
**1** tests were completed in **0ms** with **1** passed, **0** failed and **0** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/jest-junit.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-1%20passed%2C%204%20failed%2C%201%20skipped-critical)
|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>
**6** tests were completed in **1s** with **1** passed, **4** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/jest-react-component-test-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

|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>
**1** tests were completed in **1000ms** with **1** passed, **0** failed and **0** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/jest-test-results.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-4207%20passed%2C%202%20failed%2C%2030%20skipped-critical)
|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>
**4239** tests were completed in **166s** with **4207** passed, **2** failed and **30** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/junit-with-message.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-1%20failed-critical)
|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>
**1** tests were completed in **1ms** with **0** passed, **1** failed and **0** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/mocha-json.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-1%20passed%2C%204%20failed%2C%201%20skipped-critical)
|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>
**6** tests were completed in **12ms** with **1** passed, **4** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/mocha-test-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

|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>
**839** tests were completed in **6s** with **833** passed, **0** failed and **6** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/provider-test-results.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-268%20passed%2C%201%20failed-critical)
|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>
**269** tests were completed in **0ms** with **268** passed, **1** failed and **0** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/pulsar-test-results-no-merge.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-1%20failed%2C%201%20skipped-critical)
|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>
**2** tests were completed in **116ms** with **0** passed, **1** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/pulsar-test-results.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-793%20passed%2C%201%20failed%2C%2014%20skipped-critical)
|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>
**808** tests were completed in **2127s** with **793** passed, **1** failed and **14** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/rspec-json.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-1%20passed%2C%201%20failed%2C%201%20skipped-critical)
|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>
**3** tests were completed in **0ms** with **1** passed, **1** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/silent-notes-test-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

|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>
**79** tests were completed in **1s** with **67** passed, **0** failed and **12** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__outputs__/swift-xunit.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Tests failed](https://img.shields.io/badge/tests-2%20passed%2C%201%20failed-critical)
|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>
**3** tests were completed in **220ms** with **2** passed, **1** failed and **0** skipped.
|Test suite|Passed|Failed|Skipped|Time|
Expand Down
9 changes: 6 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/report/get-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,17 @@ function getTestRunsReport(testRuns: TestRunResult[], options: ReportOptions): s

if (testRuns.length > 0 || options.onlySummary) {
const tableData = testRuns
.filter(tr => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)
.map(tr => {
.map((tr, originalIndex) => ({tr, originalIndex}))
.filter(({tr}) => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)
.map(({tr, originalIndex}) => {
const time = formatTime(tr.time)
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 failed = tr.failed > 0 ? `${tr.failed} ${Icon.fail}` : ''
const skipped = tr.skipped > 0 ? `${tr.skipped} ${Icon.skip}` : ''
return [name, passed, failed, skipped, time]
return [nameLink, passed, failed, skipped, time]
})

const resultsTable = table(
Expand Down

0 comments on commit a6b3e93

Please sign in to comment.