gpt4 book ai didi

testing - Teamcity 报告测试通过两次

转载 作者:行者123 更新时间:2023-11-28 20:44:05 25 4
gpt4 key购买 nike

当我使用 TeamCity 工具(使用 TeamCity 服务消息,准确地说是通过 .bat 脚本文件的标准输出,echo 命令)报告我的测试时,我得到的结果是,我的测试通过了两次,所有这些我所做的是读取包含以下内容(例如)的文件“test.log”:

##teamcity[testStarted name='5013']
##teamcity[testFinished name='5013']

我的 run.bat 文件包含以下内容:

@for /f "usebackq tokens=*" %%a in ("test.log") do (
echo %%~a
)

从技术上讲,我只有 1 个测试。不是应该告诉我已经过去了吗?相反,TeamCity 表示它已通过 2 个同名测试 (5013)。

另一个例子。看起来像这样的 test.log 文件

##teamcity[message text='Error!' errorDetails='52D4: ERROR CODE = 257' status='ERROR']
##teamcity[testSuiteStarted name='Autotests']
##teamcity[testStarted name='5013']
##teamcity[testFinished name='5013']
##teamcity[testStarted name='501E']
##teamcity[testFinished name='501E']
##teamcity[testStarted name='5052']
##teamcity[testFinished name='5052']
##teamcity[testStarted name='5169']
##teamcity[testFinished name='5169']
##teamcity[testStarted name='5251']
##teamcity[testFinished name='5251']
##teamcity[testStarted name='52D4']
##teamcity[testFailed name='52D4']
##teamcity[testFinished name='52D4']
##teamcity[testStarted name='5E00']
##teamcity[testFinished name='5E00']
##teamcity[testSuiteFinished name='Autotests']

它有 7 个测试,其中 1 个失败。 teamCity 表示 1 项测试失败 (52D4),13 项测试成功通过。

这是它在 TeamCity WEB UI 中的样子:

screenshot

如有任何帮助,我们将不胜感激!

最佳答案

好的,所以我想出了问题所在...我只需要在 echo 行之前添加一个 @...

@echo %%~a

不好意思打扰了

关于testing - Teamcity 报告测试通过两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20606042/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com