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

Fix issue

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