Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
907318a6
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
9 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
907318a6
编写于
5月 22, 2023
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wait for ztf service to exit before client terminated
上级
7b8c0033
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
18 deletion
+27
-18
client/src/app/app.js
client/src/app/app.js
+19
-9
client/src/app/core/ztf.js
client/src/app/core/ztf.js
+5
-9
internal/server/modules/v1/service/test-exec.go
internal/server/modules/v1/service/test-exec.go
+3
-0
未找到文件。
client/src/app/app.js
浏览文件 @
907318a6
...
...
@@ -142,23 +142,33 @@ export class ZtfApp {
}
bindElectronEvents
()
{
app
.
on
(
'
activate
'
,
()
=>
{
logInfo
(
'
>> event: activate
'
);
this
.
buildAppMenu
();
// 在 OS X 系统上,可能存在所有应用窗口关闭了,但是程序还没关闭,此时如果收到激活应用请求,需要重新打开应用窗口并创建应用菜单。
this
.
openOrCreateWindow
()
});
app
.
on
(
'
window-all-closed
'
,
()
=>
{
logInfo
(
`>> event: window-all-closed`
)
app
.
quit
();
});
app
.
on
(
'
quit
'
,
()
=>
{
logInfo
(
`>> event: quit`
)
this
.
quit
();
});
app
.
on
(
'
will-quit
'
,
(
e
)
=>
{
e
.
preventDefault
()
app
.
on
(
'
activate
'
,
()
=>
{
logInfo
(
'
>> event: activate
'
);
logInfo
(
`>> event: app will-quit`
)
this
.
buildAppMenu
();
logInfo
(
`>> start to kill child process`
)
this
.
quit
();
logInfo
(
`>> end to kill child process`
)
// 在 OS X 系统上,可能存在所有应用窗口关闭了,但是程序还没关闭,此时如果收到激活应用请求,需要重新打开应用窗口并创建应用菜单。
this
.
openOrCreateWindow
()
app
.
exit
()
});
app
.
on
(
'
quit
'
,
()
=>
{
logInfo
(
`>> event: app quit`
)
});
}
...
...
client/src/app/core/ztf.js
浏览文件 @
907318a6
...
...
@@ -122,19 +122,15 @@ export function killZtfServer() {
logInfo
(
`>> not windows`
);
const
cmd
=
`ps -ef | grep
${
uuid
}
| grep -v "grep" | awk '{print $2}' | xargs -r kill -9`
logInfo
(
`>> exit cmd:
${
cmd
}
`
);
// const cp = require('child_process');
// cp.exec(cmd, function (error, stdout, stderr) {
// logInfo(`>> exit result: stdout: ${stdout}; stderr: ${stderr}; error: ${error}`);
// });
logInfo
(
`>> kill ztf service cmd:
${
cmd
}
`
);
const
stdout
=
execSync
(
cmd
,
{
windowsHide
:
true
}).
toString
().
trim
()
logInfo
(
`>>
exit
result:
${
stdout
}
`
)
logInfo
(
`>>
kill ztf service
result:
${
stdout
}
`
)
}
else
{
const
cmd
=
'
Get-WmiObject -class win32_process -filter "Commandline like
\'
%%
'
+
uuid
+
'
%%
\'
" | Select-Object Processid, Caption
'
;
logInfo
(
`>> list process cmd:
${
cmd
}
`
);
const
stdout
=
execSync
(
cmd
,
{
windowsHide
:
true
,
shell
:
'
powershell.exe
'
}).
toString
().
trim
()
logInfo
(
`>> list process result: exec
${
cmd
}
, stdout:
${
stdout
}
`
)
...
...
@@ -159,10 +155,10 @@ export function killZtfServer() {
if
(
pid
&&
pid
>
0
)
{
const
killCmd
=
`taskkill /F /pid
${
pid
}
`
logInfo
(
`>>
exit
cmd: exec
${
killCmd
}
`
)
logInfo
(
`>>
kill ztf service
cmd: exec
${
killCmd
}
`
)
const
stdout
=
execSync
(
`taskkill /F /pid
${
pid
}
`
,
{
windowsHide
:
true
}).
toString
().
trim
()
logInfo
(
`>>
exit
result:
${
stdout
}
`
)
logInfo
(
`>>
kill ztf service
result:
${
stdout
}
`
)
}
}
}
\ No newline at end of file
internal/server/modules/v1/service/test-exec.go
浏览文件 @
907318a6
...
...
@@ -36,6 +36,9 @@ func (s *TestExecService) Start(req serverDomain.ExecReq, wsMsg *websocket.Messa
execHelper
.
PopulateTestSetPropsWithParentRequest
(
&
req
)
for
idx
,
_
:=
range
req
.
TestSets
{
testSet
:=
&
req
.
TestSets
[
idx
]
if
testSet
.
TestTool
==
"robotframework"
{
testSet
.
TestTool
=
commConsts
.
RobotFramework
}
if
testSet
.
WorkspaceId
!=
0
{
po
,
_
:=
s
.
WorkspaceService
.
Get
(
uint
(
testSet
.
WorkspaceId
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录