Skip to content

Commit a74a972

Browse files
authored
feat: add History api (#17)
1 parent 7ddd06c commit a74a972

File tree

7 files changed

+611
-31
lines changed

7 files changed

+611
-31
lines changed

go.mod

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
module github.com/linuxsuren/atest-ext-store-orm
22

3-
go 1.22.2
3+
go 1.22.4
44

5-
toolchain go1.22.4
5+
toolchain go1.22.6
66

77
require (
88
github.com/linuxsuren/api-testing v0.0.18-0.20240712143814-6ce9363d5a07
99
github.com/spf13/cobra v1.8.0
1010
github.com/stretchr/testify v1.9.0
11+
google.golang.org/protobuf v1.33.0
1112
gorm.io/driver/mysql v1.5.2
1213
gorm.io/driver/postgres v1.5.4
1314
gorm.io/driver/sqlite v1.5.6
@@ -53,6 +54,7 @@ require (
5354
github.com/jinzhu/now v1.1.5 // indirect
5455
github.com/josharian/intern v1.0.0 // indirect
5556
github.com/linuxsuren/go-fake-runtime v0.0.4 // indirect
57+
github.com/linuxsuren/oauth-hub v0.0.0-20240809060240-e78c21b5d8d4 // indirect
5658
github.com/linuxsuren/unstructured v0.0.1 // indirect
5759
github.com/mailru/easyjson v0.7.7 // indirect
5860
github.com/mattn/go-sqlite3 v1.14.22 // indirect
@@ -85,15 +87,17 @@ require (
8587
go.uber.org/zap v1.27.0 // indirect
8688
golang.org/x/crypto v0.21.0 // indirect
8789
golang.org/x/net v0.23.0 // indirect
88-
golang.org/x/oauth2 v0.18.0 // indirect
90+
golang.org/x/oauth2 v0.22.0 // indirect
8991
golang.org/x/sync v0.6.0 // indirect
9092
golang.org/x/sys v0.18.0 // indirect
9193
golang.org/x/text v0.14.0 // indirect
92-
google.golang.org/appengine v1.6.8 // indirect
9394
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
9495
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
9596
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
96-
google.golang.org/protobuf v1.33.0 // indirect
9797
gopkg.in/yaml.v2 v2.4.0 // indirect
9898
gopkg.in/yaml.v3 v3.0.1 // indirect
9999
)
100+
101+
replace github.com/linuxsuren/api-testing => github.com/SamYSF/api-testing v0.0.0-20240913070731-63814573b192
102+
103+
//replace github.com/linuxsuren/api-testing => /home/ysf/project/api-testing

go.sum

+6-13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0
55
github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
66
github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA=
77
github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM=
8+
github.com/SamYSF/api-testing v0.0.0-20240913070731-63814573b192 h1:hHFszkA9lWWQ0UmyE8/C8uXRP4hAyQHAXilVSg87e/w=
9+
github.com/SamYSF/api-testing v0.0.0-20240913070731-63814573b192/go.mod h1:uu0hyEYSgdSju31EugGwIGE2I/uv7VYNM/6ODPKKD7I=
810
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
911
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
1012
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
@@ -47,11 +49,8 @@ github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+Gr
4749
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
4850
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
4951
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
50-
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
51-
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
5252
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
5353
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
54-
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
5554
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
5655
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
5756
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -96,10 +95,10 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
9695
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
9796
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
9897
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
99-
github.com/linuxsuren/api-testing v0.0.18-0.20240712143814-6ce9363d5a07 h1:NmjqkiR+4KXjWs9H6wGmgQo7r7FJE+RED+E3EwAGsp4=
100-
github.com/linuxsuren/api-testing v0.0.18-0.20240712143814-6ce9363d5a07/go.mod h1:8G3GZtQmSUHyqA/gZlSdFaDIveHQYbFInTibD7g3hMs=
10198
github.com/linuxsuren/go-fake-runtime v0.0.4 h1:y+tvBuw6MKTCav8Bo5HWwaXhBx1Z//VAvqI3gpOWqvw=
10299
github.com/linuxsuren/go-fake-runtime v0.0.4/go.mod h1:zmh6J78hSnWZo68faMA2eKOdaEp8eFbERHi3ZB9xHCQ=
100+
github.com/linuxsuren/oauth-hub v0.0.0-20240809060240-e78c21b5d8d4 h1:muVmKxx+JneaVgUKHqLc+As5vpgKXZAfVu6h+iyb5LQ=
101+
github.com/linuxsuren/oauth-hub v0.0.0-20240809060240-e78c21b5d8d4/go.mod h1:6K1L5ajpFTNO8iJSsNrxMWAigAqczI0UPfEV9NSE0nc=
103102
github.com/linuxsuren/unstructured v0.0.1 h1:ilUA8MUYbR6l9ebo/YPV2bKqlf62bzQursDSE+j00iU=
104103
github.com/linuxsuren/unstructured v0.0.1/go.mod h1:KH6aTj+FegzGBzc1vS6mzZx3/duhTUTEVyW5sO7p4as=
105104
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
@@ -205,8 +204,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
205204
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
206205
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
207206
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
208-
golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI=
209-
golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8=
207+
golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
208+
golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
210209
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
211210
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
212211
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
@@ -225,17 +224,13 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
225224
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
226225
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
227226
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
228-
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
229227
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
230228
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
231229
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
232230
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
233231
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
234232
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
235233
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
236-
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
237-
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
238-
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
239234
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ=
240235
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro=
241236
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU=
@@ -244,8 +239,6 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:
244239
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
245240
google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
246241
google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
247-
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
248-
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
249242
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
250243
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
251244
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

pkg/convert.go

+152
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ package pkg
1717

1818
import (
1919
"encoding/json"
20+
"fmt"
21+
"time"
2022

2123
"github.com/linuxsuren/api-testing/pkg/server"
2224
"github.com/linuxsuren/api-testing/pkg/testing/remote"
25+
"google.golang.org/protobuf/types/known/timestamppb"
2326
)
2427

2528
func ConverToDBTestCase(testcase *server.TestCase) (result *TestCase) {
@@ -76,6 +79,33 @@ func ConvertToRemoteTestCase(testcase *TestCase) (result *server.TestCase) {
7679
return
7780
}
7881

82+
func ConvertHistoryToRemoteTestCase(historyTestcase *HistoryTestResult) (result *server.TestCase) {
83+
result = &server.TestCase{
84+
Name: historyTestcase.CaseName,
85+
SuiteName: historyTestcase.SuiteName,
86+
87+
Request: &server.Request{
88+
Api: historyTestcase.CaseAPI,
89+
Method: historyTestcase.Method,
90+
Body: historyTestcase.Body,
91+
Header: jsonToPair(historyTestcase.Header),
92+
Cookie: jsonToPair(historyTestcase.Cookie),
93+
Query: jsonToPair(historyTestcase.Query),
94+
Form: jsonToPair(historyTestcase.Form),
95+
},
96+
97+
Response: &server.Response{
98+
StatusCode: int32(historyTestcase.ExpectStatusCode),
99+
Body: historyTestcase.ExpectBody,
100+
Schema: historyTestcase.ExpectSchema,
101+
Verify: jsonToSlice(historyTestcase.ExpectVerify),
102+
BodyFieldsExpect: jsonToPair(historyTestcase.ExpectBodyFields),
103+
Header: jsonToPair(historyTestcase.ExpectHeader),
104+
},
105+
}
106+
return
107+
}
108+
79109
func ConvertToDBTestSuite(suite *remote.TestSuite) (result *TestSuite) {
80110
result = &TestSuite{
81111
Name: suite.Name,
@@ -91,6 +121,76 @@ func ConvertToDBTestSuite(suite *remote.TestSuite) (result *TestSuite) {
91121
return
92122
}
93123

124+
func ConvertToDBHistoryTestResult(historyTestResult *server.HistoryTestResult) (result *HistoryTestResult) {
125+
result = &HistoryTestResult{
126+
Message: historyTestResult.Message,
127+
Error: historyTestResult.Error,
128+
}
129+
if historyTestResult.CreateTime != nil {
130+
id := fmt.Sprintf("%s_%s_%s", historyTestResult.CreateTime.AsTime().Local().Format("2006-01-02T15:04:05.999999999"), historyTestResult.Data.SuiteName, historyTestResult.Data.CaseName)
131+
result.ID = id
132+
result.CreateTime = historyTestResult.CreateTime.AsTime().Local().Format("2006-01-02T15:04:05.999999999")
133+
result.HistorySuiteName = historyTestResult.CreateTime.AsTime().Local().Format("2006-1-2")
134+
}
135+
if historyTestResult.Data != nil {
136+
result.Param = pairToJSON(historyTestResult.Data.SuiteParam)
137+
result.CaseName = historyTestResult.Data.CaseName
138+
result.SuiteName = historyTestResult.Data.SuiteName
139+
result.SuiteAPI = historyTestResult.Data.SuiteApi
140+
result.HistoryHeader = pairToJSON(historyTestResult.Data.HistoryHeader)
141+
if historyTestResult.Data.Request != nil {
142+
request := historyTestResult.Data.Request
143+
result.CaseAPI = request.Api
144+
result.Method = request.Method
145+
result.Header = pairToJSON(request.Header)
146+
result.Cookie = pairToJSON(request.Cookie)
147+
result.Form = pairToJSON(request.Form)
148+
result.Query = pairToJSON(request.Query)
149+
}
150+
if historyTestResult.Data.Response != nil {
151+
resp := historyTestResult.Data.Response
152+
result.ExpectBody = resp.Body
153+
result.ExpectSchema = resp.Schema
154+
result.ExpectStatusCode = int(resp.StatusCode)
155+
result.ExpectHeader = pairToJSON(resp.Header)
156+
result.ExpectBodyFields = pairToJSON(resp.BodyFieldsExpect)
157+
result.ExpectVerify = SliceToJSON(resp.Verify)
158+
}
159+
if historyTestResult.Data.SuiteSpec != nil {
160+
result.SpecKind = historyTestResult.Data.SuiteSpec.Kind
161+
result.SpecURL = historyTestResult.Data.SuiteSpec.Url
162+
}
163+
}
164+
for _, testCase := range historyTestResult.TestCaseResult {
165+
result.StatusCode = int32(testCase.StatusCode)
166+
result.Output = testCase.Output
167+
result.Body = testCase.Body
168+
}
169+
return
170+
}
171+
172+
func ConvertToRemoteHistoryTestResult(historyTestResult *HistoryTestResult) (result *server.HistoryTestResult) {
173+
createTime, err := time.Parse("2006-01-02T15:04:05.999999999", historyTestResult.CreateTime)
174+
if err != nil {
175+
fmt.Println("Error parsing time:", err)
176+
}
177+
result = &server.HistoryTestResult{
178+
Message: historyTestResult.Message,
179+
Error: historyTestResult.Error,
180+
CreateTime: timestamppb.New(createTime),
181+
}
182+
TestCaseResult := &server.TestCaseResult{
183+
StatusCode: historyTestResult.StatusCode,
184+
Body: historyTestResult.Body,
185+
Output: historyTestResult.Output,
186+
Error: historyTestResult.Error,
187+
Header: jsonToPair(historyTestResult.Header),
188+
}
189+
result.TestCaseResult = append(result.TestCaseResult, TestCaseResult)
190+
result.Data = ConvertToGRPCHistoryTestCase(historyTestResult)
191+
return
192+
}
193+
94194
func ConvertToGRPCTestSuite(suite *TestSuite) (result *remote.TestSuite) {
95195
result = &remote.TestSuite{
96196
Name: suite.Name,
@@ -104,6 +204,58 @@ func ConvertToGRPCTestSuite(suite *TestSuite) (result *remote.TestSuite) {
104204
return
105205
}
106206

207+
func ConvertToGRPCHistoryTestSuite(historyTestResult *HistoryTestResult) (result *remote.HistoryTestSuite) {
208+
result = &remote.HistoryTestSuite{
209+
HistorySuiteName: historyTestResult.HistorySuiteName,
210+
}
211+
212+
item := ConvertToGRPCHistoryTestCase(historyTestResult)
213+
result.Items = append(result.Items, item)
214+
return
215+
}
216+
217+
func ConvertToGRPCHistoryTestCase(historyTestResult *HistoryTestResult) (result *server.HistoryTestCase) {
218+
createTime, err := time.Parse("2006-01-02T15:04:05.999999999", historyTestResult.CreateTime)
219+
if err != nil {
220+
fmt.Println("Error parsing time:", err)
221+
}
222+
result = &server.HistoryTestCase{
223+
ID: historyTestResult.ID,
224+
SuiteName: historyTestResult.SuiteName,
225+
CaseName: historyTestResult.CaseName,
226+
SuiteApi: historyTestResult.SuiteAPI,
227+
SuiteParam: jsonToPair(historyTestResult.Param),
228+
HistorySuiteName: historyTestResult.HistorySuiteName,
229+
CreateTime: timestamppb.New(createTime),
230+
HistoryHeader: jsonToPair(historyTestResult.HistoryHeader),
231+
232+
SuiteSpec: &server.APISpec{
233+
Kind: historyTestResult.SpecKind,
234+
Url: historyTestResult.SpecURL,
235+
},
236+
237+
Request: &server.Request{
238+
Api: historyTestResult.CaseAPI,
239+
Method: historyTestResult.Method,
240+
Body: historyTestResult.Body,
241+
Header: jsonToPair(historyTestResult.Header),
242+
Cookie: jsonToPair(historyTestResult.Cookie),
243+
Query: jsonToPair(historyTestResult.Query),
244+
Form: jsonToPair(historyTestResult.Form),
245+
},
246+
247+
Response: &server.Response{
248+
StatusCode: int32(historyTestResult.ExpectStatusCode),
249+
Body: historyTestResult.ExpectBody,
250+
Schema: historyTestResult.ExpectSchema,
251+
Verify: jsonToSlice(historyTestResult.ExpectVerify),
252+
BodyFieldsExpect: jsonToPair(historyTestResult.ExpectBodyFields),
253+
Header: jsonToPair(historyTestResult.ExpectHeader),
254+
},
255+
}
256+
return
257+
}
258+
107259
func SliceToJSON(slice []string) (result string) {
108260
var data []byte
109261
var err error

0 commit comments

Comments
 (0)