提交 35605730 编写于 作者: 雨爱无痕

Fix issue

上级 ff2496e4
...@@ -3,7 +3,6 @@ package execHelper ...@@ -3,7 +3,6 @@ package execHelper
import ( import (
"bufio" "bufio"
"errors" "errors"
"fmt"
"io" "io"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
...@@ -11,7 +10,6 @@ import ( ...@@ -11,7 +10,6 @@ import (
"time" "time"
fileUtils "github.com/easysoft/zentaoatf/pkg/lib/file" fileUtils "github.com/easysoft/zentaoatf/pkg/lib/file"
"github.com/gofrs/uuid"
commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts" commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts"
configHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/config" configHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/config"
...@@ -93,12 +91,11 @@ func ExecUnit(ch chan int, ...@@ -93,12 +91,11 @@ func ExecUnit(ch chan int,
func RunUnitTest(ch chan int, cmdStr, workspacePath string, wsMsg *websocket.Message) (err error) { func RunUnitTest(ch chan int, cmdStr, workspacePath string, wsMsg *websocket.Message) (err error) {
key := stringUtils.Md5(workspacePath) key := stringUtils.Md5(workspacePath)
uuidString := uuid.Must(uuid.NewV4()).String()
var cmd *exec.Cmd var cmd *exec.Cmd
if commonUtils.IsWin() { if commonUtils.IsWin() {
cmd = exec.Command("cmd", "/C", cmdStr, "-uuid", uuidString) cmd = exec.Command("cmd", "/C", cmdStr)
} else { } else {
cmd = exec.Command("/bin/bash", "-c", fmt.Sprintf("%s -uuid %s", cmdStr, uuidString)) cmd = exec.Command("/bin/bash", "-c", cmdStr)
} }
cmd.Dir = workspacePath cmd.Dir = workspacePath
...@@ -138,22 +135,6 @@ func RunUnitTest(ch chan int, cmdStr, workspacePath string, wsMsg *websocket.Mes ...@@ -138,22 +135,6 @@ func RunUnitTest(ch chan int, cmdStr, workspacePath string, wsMsg *websocket.Mes
} }
cmd.Start() cmd.Start()
go func() {
for {
select {
case _, ok := <-ch:
KillProcessByUUID(uuidString)
stdout.Close()
stderr.Close()
SetRunning(false)
if ok {
close(ch)
}
return
default:
}
}
}()
isTerminal := false isTerminal := false
reader1 := bufio.NewReader(stdout) reader1 := bufio.NewReader(stdout)
...@@ -175,6 +156,7 @@ func RunUnitTest(ch chan int, cmdStr, workspacePath string, wsMsg *websocket.Mes ...@@ -175,6 +156,7 @@ func RunUnitTest(ch chan int, cmdStr, workspacePath string, wsMsg *websocket.Mes
select { select {
case <-ch: case <-ch:
cmd.Process.Kill()
msg := i118Utils.Sprintf("exit_exec_curr") msg := i118Utils.Sprintf("exit_exec_curr")
if commConsts.ExecFrom != commConsts.FromCmd { if commConsts.ExecFrom != commConsts.FromCmd {
......
...@@ -296,7 +296,7 @@ const exec = async (data: any) => { ...@@ -296,7 +296,7 @@ const exec = async (data: any) => {
const checkProxyStatus = async (workspaceId, msg) => { const checkProxyStatus = async (workspaceId, msg) => {
if(msg.testSets == undefined){ if(msg.testSets == undefined){
return {path: ''}; return {path: 'local'};
} }
currentWorkspace.value = {}; currentWorkspace.value = {};
let workspaceInfo = {} as any; let workspaceInfo = {} as any;
......
<template> <template>
<View class="space-left"> <div class="space-left">
<View class="title space">{{t('remote_proxy')}}</View> <div class="title space">{{t('remote_proxy')}}</div>
<Button id="proxyMenuToggle" <Button id="proxyMenuToggle"
:label="currProxy.id == 0 || currProxy.id == undefined ? t('local_proxy') : currProxy.name" :label="currProxy.id == 0 || currProxy.id == undefined ? t('local_proxy') : currProxy.name"
class="rounded border lighten-16" class="rounded border lighten-16"
suffix-icon="caret-down"/> suffix-icon="caret-down"/>
</View> </div>
<DropdownMenu <DropdownMenu
v-if="proxies.length>0" v-if="proxies.length>0"
toggle="#proxyMenuToggle" toggle="#proxyMenuToggle"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册