Skip to content

Commit

Permalink
fix type for SystemOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwliu committed Jun 8, 2023
1 parent ddfebb3 commit e7ee489
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
8 changes: 1 addition & 7 deletions pipelines.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,12 @@ type PipelineTestCases struct {
Classname string `json:"classname"`
File string `json:"file"`
ExecutionTime float64 `json:"execution_time"`
SystemOutput *SystemOutput `json:"system_output"`
SystemOutput string `json:"system_output"`
StackTrace string `json:"stack_trace"`
AttachmentURL string `json:"attachment_url"`
RecentFailures *RecentFailures `json:"recent_failures"`
}

// SystemOutput contains information about test cases when it fails.
type SystemOutput struct {
Type string `json:"type"`
Message string `json:"message"`
}

// RecentFailures contains failures count for the project's default branch.
type RecentFailures struct {
Count int `json:"count"`
Expand Down
16 changes: 5 additions & 11 deletions pipelines_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ func TestGetPipelineTestReport(t *testing.T) {
Classname: "MyClassOne",
File: "/path/file.ext",
ExecutionTime: 19.987,
SystemOutput: &SystemOutput{
Type: "failure",
Message: "Failed test",
},
SystemOutput: "Failed test",
StackTrace: "java.lang.Exception: Stack trace\nat java.base/java.lang.Thread.dumpStack(Thread.java:1383)",
AttachmentURL: "http://foo.bar",
RecentFailures: &RecentFailures{
Expand All @@ -133,13 +130,10 @@ func TestGetPipelineTestReport(t *testing.T) {
ExecutionTime: 19.984,
},
{
Status: "error",
Name: "Error testcase 3",
Classname: "MyClass",
SystemOutput: &SystemOutput{
Type: "failure",
Message: "Failed test",
},
Status: "error",
Name: "Error testcase 3",
Classname: "MyClass",
SystemOutput: "Failed test",
},
{
Status: "success",
Expand Down
10 changes: 2 additions & 8 deletions testdata/get_pipeline_testreport.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
"classname": "MyClassOne",
"file": "/path/file.ext",
"execution_time": 19.987,
"system_output": {
"type": "failure",
"message": "Failed test"
},
"system_output": "Failed test",
"stack_trace": "java.lang.Exception: Stack trace\nat java.base/java.lang.Thread.dumpStack(Thread.java:1383)",
"attachment_url": "http://foo.bar",
"recent_failures": {
Expand All @@ -50,10 +47,7 @@
"classname": "MyClass",
"file": null,
"execution_time": 0.0,
"system_output": {
"type": "failure",
"message": "Failed test"
}
"system_output": "Failed test"
},
{
"status": "success",
Expand Down

0 comments on commit e7ee489

Please sign in to comment.