Skip to content

Commit 7124dc4

Browse files
authored
fix: http type of test suite cannot save (#276)
1 parent 375d48a commit 7124dc4

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

cmd/service.go

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ You could choose the alternative images:
3232
Docker Hub: docker.io/linuxsuren/api-testing
3333
GitHub Container Registry: ghcr.io/linuxsuren/api-testing
3434
Scarf: linuxsuren.docker.scarf.sh/linuxsuren/api-testing
35+
AliYun: registry.aliyuncs.com/linuxsuren/api-testing
3536
DaoCloud: docker.m.daocloud.io/linuxsuren/api-testing`,
3637
PreRunE: opt.preRunE,
3738
RunE: opt.runE,

console/atest-ui/src/views/TestSuite.vue

+15-6
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ watch(props, () => {
5353
})
5454
5555
function save() {
56-
const oldImportPath = suite.value.spec.rpc.import
57-
if (typeof oldImportPath === 'string' && oldImportPath !== '') {
58-
const importPath = oldImportPath.split(',')
59-
suite.value.spec.rpc.import = importPath
56+
let oldImportPath = ""
57+
let hasImport = false
58+
if (suite.value.spec && suite.value.spec.rpc) {
59+
oldImportPath = suite.value.spec.rpc.import
60+
hasImport = true
61+
if (typeof oldImportPath === 'string' && oldImportPath !== '') {
62+
const importPath = oldImportPath.split(',')
63+
suite.value.spec.rpc.import = importPath
64+
}
6065
}
6166
6267
API.UpdateTestSuite(suite.value, (e) => {
@@ -69,9 +74,13 @@ function save() {
6974
ElMessage.error('Oops, ' + e.message)
7075
}
7176
72-
suite.value.spec.rpc.import = oldImportPath
77+
if (hasImport) {
78+
suite.value.spec.rpc.import = oldImportPath
79+
}
7380
}, (e) => {
74-
suite.value.spec.rpc.import = oldImportPath
81+
if (hasImport) {
82+
suite.value.spec.rpc.import = oldImportPath
83+
}
7584
ElMessage.error('Oops, ' + e)
7685
})
7786
}

console/atest-ui/src/views/net.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ interface ImportSource {
7676
}
7777

7878
function UpdateTestSuite(suite: any,
79-
callback: (d: any) => {}, errHandle?: (e: any) => {} | null) {
79+
callback: (d: any) => void, errHandle?: (e: any) => void | null) {
8080
const requestOptions = {
8181
method: 'POST',
8282
headers: {

pkg/testing/remote/grpc_store.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func (g *gRPCLoader) DeleteSuite(name string) (err error) {
190190

191191
func (g *gRPCLoader) Verify() (readOnly bool, err error) {
192192
// avoid to long to wait the response
193-
ctx, cancel := context.WithTimeout(g.ctx, time.Second*3)
193+
ctx, cancel := context.WithTimeout(g.ctx, time.Second*5)
194194
defer cancel()
195195

196196
var result *server.ExtensionStatus

0 commit comments

Comments
 (0)