From e7ee48984a59194e3ab65978e41e973cbc7a5a35 Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Thu, 8 Jun 2023 09:36:44 -0400 Subject: [PATCH] fix type for SystemOutput --- pipelines.go | 8 +------- pipelines_test.go | 16 +++++----------- testdata/get_pipeline_testreport.json | 10 ++-------- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/pipelines.go b/pipelines.go index 5b01e49ff..1bba71e00 100644 --- a/pipelines.go +++ b/pipelines.go @@ -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"` diff --git a/pipelines_test.go b/pipelines_test.go index 264e66fa4..0a4c2ad0e 100644 --- a/pipelines_test.go +++ b/pipelines_test.go @@ -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{ @@ -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", diff --git a/testdata/get_pipeline_testreport.json b/testdata/get_pipeline_testreport.json index ee70359ac..d9465697d 100644 --- a/testdata/get_pipeline_testreport.json +++ b/testdata/get_pipeline_testreport.json @@ -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": { @@ -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",