Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
c7c7ca10
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
c7c7ca10
编写于
12月 16, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix issues
上级
01c6dc91
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
22 addition
and
33 deletion
+22
-33
demo/demo3.sh
demo/demo3.sh
+0
-17
demo/sample/1_simple.php
demo/sample/1_simple.php
+1
-1
demo/sample/4_expect_saved_to_file.php
demo/sample/4_expect_saved_to_file.php
+1
-1
internal/pkg/helper/exec/report-ztf.go
internal/pkg/helper/exec/report-ztf.go
+1
-1
internal/pkg/helper/exec/result.go
internal/pkg/helper/exec/result.go
+1
-1
internal/pkg/helper/script/parser.go
internal/pkg/helper/script/parser.go
+1
-1
internal/server/config/log.go
internal/server/config/log.go
+17
-11
未找到文件。
demo/demo3.sh
已删除
100755 → 0
浏览文件 @
01c6dc91
#!/usr/bin/env zsh
:<<
!
title
=
demo1
cid
=
1
pid
=
1
1. 1
>>
1
2. 1
>>
1
3. 1
>>
1
4. 1
>>
1
5. 1
>>
1
!
str
=
"abc123"
echo
"1"
echo
"1"
echo
"0"
echo
"0"
echo
"1"
demo/sample/1_simple.php
浏览文件 @
c7c7ca10
...
...
@@ -2,7 +2,7 @@
<?php
/**
title
=
simple demo
title
=
simple demo
cid=1
pid=1
...
...
demo/sample/4_expect_saved_to_file.php
浏览文件 @
c7c7ca10
...
...
@@ -2,7 +2,7 @@
<?php
/**
title =
expect in file
title =expect in file
cid=0
pid=0
...
...
internal/pkg/helper/exec/report-ztf.go
浏览文件 @
c7c7ca10
...
...
@@ -129,7 +129,7 @@ func appendFailedStepResult(cs commDomain.FuncResult, failedSteps *[]string) (pa
step
.
Id
=
strings
.
TrimRight
(
step
.
Id
,
"."
)
status
:=
i118Utils
.
Sprintf
(
string
(
step
.
Status
))
*
failedSteps
=
append
(
*
failedSteps
,
fmt
.
Sprintf
(
"Step %s: %s
"
,
step
.
Id
,
status
))
*
failedSteps
=
append
(
*
failedSteps
,
fmt
.
Sprintf
(
"Step %s: %s
[%s]"
,
step
.
Id
,
status
,
step
.
Name
))
for
idx1
,
cp
:=
range
step
.
CheckPoints
{
//cpStatus := commonUtils.BoolToPass(step.Status)
...
...
internal/pkg/helper/exec/result.go
浏览文件 @
c7c7ca10
...
...
@@ -78,7 +78,7 @@ func ValidateCaseResult(scriptFile string, langType string,
if
errOutput
!=
""
&&
index
==
0
&&
len
(
checkpointLogs
)
>
0
{
checkpointLogs
[
0
]
.
Actual
=
errOutput
}
stepLog
:=
commDomain
.
StepLog
{
Id
:
strconv
.
Itoa
(
stepIdxToCheck
),
Name
:
stepName
,
Status
:
stepResult
,
CheckPoints
:
checkpointLogs
}
stepLog
:=
commDomain
.
StepLog
{
Id
:
strconv
.
Itoa
(
stepIdxToCheck
+
1
),
Name
:
stepName
,
Status
:
stepResult
,
CheckPoints
:
checkpointLogs
}
stepLogs
=
append
(
stepLogs
,
stepLog
)
if
stepResult
==
commConsts
.
FAIL
{
caseResult
=
commConsts
.
FAIL
...
...
internal/pkg/helper/script/parser.go
浏览文件 @
c7c7ca10
...
...
@@ -548,7 +548,7 @@ func GetCaseInfo(file string) (pass bool, caseId, productId int, title string, t
productId
,
_
=
strconv
.
Atoi
(
arr
[
1
])
}
myExp
=
regexp
.
MustCompile
(
`[\S\s]*title
=
([^\n]*?)\n`
)
myExp
=
regexp
.
MustCompile
(
`[\S\s]*title
\s*=\s*
([^\n]*?)\n`
)
arr
=
myExp
.
FindStringSubmatch
(
caseInfo
)
if
len
(
arr
)
>
1
{
title
=
strings
.
TrimSpace
(
arr
[
1
])
...
...
internal/server/config/log.go
浏览文件 @
c7c7ca10
...
...
@@ -34,10 +34,12 @@ func InitLog() {
zapConfig
.
EncoderConfig
.
EncodeLevel
=
nil
zapConfig
.
DisableCaller
=
true
zapConfig
.
EncoderConfig
.
TimeKey
=
""
logUtils
.
LoggerStandard
,
err
=
zapConfig
.
Build
(
zap
.
WrapCore
(
zapCoreInFile
))
logUtils
.
LoggerStandard
,
err
=
zapConfig
.
Build
()
if
err
!=
nil
{
log
.
Println
(
"init console logger fail "
+
err
.
Error
())
}
logUtils
.
LoggerStandard
=
logUtils
.
LoggerStandard
.
WithOptions
(
zap
.
AddCaller
(),
zap
.
AddCallerSkip
(
1
))
// print to console and info、err files without stacktrace detail
// by set DisableStacktrace to true
...
...
@@ -46,6 +48,8 @@ func InitLog() {
if
err
!=
nil
{
log
.
Println
(
"init exec console logger fail "
+
err
.
Error
())
}
logUtils
.
LoggerExecConsole
=
logUtils
.
LoggerExecConsole
.
WithOptions
(
zap
.
AddCaller
(),
zap
.
AddCallerSkip
(
1
))
}
// write exec results by using zap log
...
...
@@ -64,6 +68,7 @@ func InitExecLog(workspacePath string) {
config
.
OutputPaths
=
[]
string
{
logPathInfo
}
var
err
error
logUtils
.
LoggerExecFile
,
err
=
config
.
Build
()
logUtils
.
LoggerExecFile
=
logUtils
.
LoggerExecFile
.
WithOptions
(
zap
.
AddCaller
(),
zap
.
AddCallerSkip
(
1
))
if
err
!=
nil
{
log
.
Println
(
"init exec file logger fail "
+
err
.
Error
())
...
...
@@ -85,6 +90,7 @@ func InitExecLog(workspacePath string) {
log
.
Println
(
"init exec result logger fail "
+
err
.
Error
())
}
logUtils
.
LoggerExecResult
=
logUtils
.
LoggerExecResult
.
WithOptions
(
zap
.
AddCaller
(),
zap
.
AddCallerSkip
(
1
))
}
// flush buffer and release the file.
...
...
@@ -123,18 +129,18 @@ func getLogConfig() (config zap.Config) {
}
encoderConfig
:=
zapcore
.
EncoderConfig
{
TimeKey
:
"time"
,
LevelKey
:
"level"
,
NameKey
:
"logger"
,
CallerKey
:
"caller"
,
MessageKey
:
"msg"
,
StacktraceKey
:
"stacktrace"
,
LineEnding
:
zapcore
.
DefaultLineEnding
,
//EncodeLevel: zapcore.LowercaseLevelEncoder, // 小写编码器
TimeKey
:
"time"
,
LevelKey
:
"level"
,
NameKey
:
"logger"
,
CallerKey
:
"caller"
,
MessageKey
:
"msg"
,
StacktraceKey
:
"stacktrace"
,
LineEnding
:
zapcore
.
DefaultLineEnding
,
EncodeTime
:
zapcore
.
TimeEncoderOfLayout
(
"2006-01-02 15:04:05.000"
),
EncodeLevel
:
zapcore
.
CapitalColorLevelEncoder
,
//这里可以指定颜色
EncodeDuration
:
zapcore
.
SecondsDurationEncoder
,
EncodeCaller
:
zapcore
.
FullCallerEncoder
,
// 全路径编码器
EncodeCaller
:
zapcore
.
ShortCallerEncoder
,
// 路径编码器
//EncodeLevel: zapcore.LowercaseLevelEncoder, // 小写编码器
}
config
=
zap
.
Config
{
...
...
@@ -144,7 +150,7 @@ func getLogConfig() (config zap.Config) {
EncoderConfig
:
encoderConfig
,
// 编码器配置
//InitialFields: map[string]interface{}{"test_machine": "pc1"}, // 初始化字段
}
config
.
EncoderConfig
.
EncodeLevel
=
zapcore
.
LowercaseColorLevelEncoder
//这里可以指定颜色
//if commonUtils.IsWin() {
// zap.RegisterSink("winfile", newWinFileSink)
//}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录