Skip to content

Commit 455a673

Browse files
committed
Set .suite property to the go package name
fixes #4
1 parent c886029 commit 455a673

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ The test object in the report includes the following [CTRF properties](https://c
126126

127127
| Name | Type | Required | Details |
128128
| ---------- | ------ | -------- | ----------------------------------------------------------------------------------- |
129+
| `suite` | String | Required | The name of go package containing the test. |
129130
| `name` | String | Required | The name of the test. |
130131
| `status` | String | Required | The outcome of the test. One of: `passed`, `failed`, `skipped`, `pending`, `other`. |
131132
| `duration` | Number | Required | The time taken for the test execution, in milliseconds. |

reporter/reporter.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func ParseTestResults(r io.Reader, verbose bool, env *ctrf.Environment) (*ctrf.R
4747
report.Results.Summary.Tests++
4848
report.Results.Summary.Passed++
4949
report.Results.Tests = append(report.Results.Tests, &ctrf.TestResult{
50+
Suite: event.Package,
5051
Name: event.Test,
5152
Status: ctrf.TestPassed,
5253
Duration: secondsToMillis(event.Elapsed),
@@ -55,6 +56,7 @@ func ParseTestResults(r io.Reader, verbose bool, env *ctrf.Environment) (*ctrf.R
5556
report.Results.Summary.Tests++
5657
report.Results.Summary.Failed++
5758
report.Results.Tests = append(report.Results.Tests, &ctrf.TestResult{
59+
Suite: event.Package,
5860
Name: event.Test,
5961
Status: ctrf.TestFailed,
6062
Duration: secondsToMillis(event.Elapsed),
@@ -63,6 +65,7 @@ func ParseTestResults(r io.Reader, verbose bool, env *ctrf.Environment) (*ctrf.R
6365
report.Results.Summary.Tests++
6466
report.Results.Summary.Skipped++
6567
report.Results.Tests = append(report.Results.Tests, &ctrf.TestResult{
68+
Suite: event.Package,
6669
Name: event.Test,
6770
Status: ctrf.TestSkipped,
6871
Duration: secondsToMillis(event.Elapsed),

0 commit comments

Comments
 (0)