fix: http type of test suite cannot save (#276)

This commit is contained in:
Rick 2023-11-16 10:18:48 +08:00 committed by GitHub
parent 375d48add4
commit 7124dc4e29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 8 deletions

View File

@ -32,6 +32,7 @@ You could choose the alternative images:
Docker Hub: docker.io/linuxsuren/api-testing
GitHub Container Registry: ghcr.io/linuxsuren/api-testing
Scarf: linuxsuren.docker.scarf.sh/linuxsuren/api-testing
AliYun: registry.aliyuncs.com/linuxsuren/api-testing
DaoCloud: docker.m.daocloud.io/linuxsuren/api-testing`,
PreRunE: opt.preRunE,
RunE: opt.runE,

View File

@ -53,10 +53,15 @@ watch(props, () => {
})
function save() {
const oldImportPath = suite.value.spec.rpc.import
if (typeof oldImportPath === 'string' && oldImportPath !== '') {
const importPath = oldImportPath.split(',')
suite.value.spec.rpc.import = importPath
let oldImportPath = ""
let hasImport = false
if (suite.value.spec && suite.value.spec.rpc) {
oldImportPath = suite.value.spec.rpc.import
hasImport = true
if (typeof oldImportPath === 'string' && oldImportPath !== '') {
const importPath = oldImportPath.split(',')
suite.value.spec.rpc.import = importPath
}
}
API.UpdateTestSuite(suite.value, (e) => {
@ -69,9 +74,13 @@ function save() {
ElMessage.error('Oops, ' + e.message)
}
suite.value.spec.rpc.import = oldImportPath
if (hasImport) {
suite.value.spec.rpc.import = oldImportPath
}
}, (e) => {
suite.value.spec.rpc.import = oldImportPath
if (hasImport) {
suite.value.spec.rpc.import = oldImportPath
}
ElMessage.error('Oops, ' + e)
})
}

View File

@ -76,7 +76,7 @@ interface ImportSource {
}
function UpdateTestSuite(suite: any,
callback: (d: any) => {}, errHandle?: (e: any) => {} | null) {
callback: (d: any) => void, errHandle?: (e: any) => void | null) {
const requestOptions = {
method: 'POST',
headers: {

View File

@ -190,7 +190,7 @@ func (g *gRPCLoader) DeleteSuite(name string) (err error) {
func (g *gRPCLoader) Verify() (readOnly bool, err error) {
// avoid to long to wait the response
ctx, cancel := context.WithTimeout(g.ctx, time.Second*3)
ctx, cancel := context.WithTimeout(g.ctx, time.Second*5)
defer cancel()
var result *server.ExtensionStatus