情况是这样的,在构建/部署到服务器的过程之后,我正在尝试触发一组Gallio测试。构建脚本是Nant,我们通过Hudson将其激活到远程服务器。
经过一些努力,我在构建脚本中遇到了以下错误。注意:我清理了文件路径,并将它们替换为(描述)
Buildfile: file:///(Build script location)
Target framework: Microsoft .NET Framework 4.0
Target(s) specified: build-robot
[include] Including file (Build script location)
[property] Read-only property "doDeploy" cannot be overwritten.
[property] Read-only property "runSmokeTests" cannot be overwritten.
[tstamp] Tuesday, November 22, 2011 3:51:01 PM.
[tstamp] Tuesday, November 22, 2011 3:51:01 PM.
[echo] Setting RELEASE mode to true
[echo] The Output Folder is set to: (Nightly build server)
[echo] Loading Gallio Task from: (Source dir path)\References\Gallio\Gallio.NAntTasks.dll
[loadtasks] Scanning assembly "Gallio.NAntTasks" for extensions.
global.failure:
tear.down:
[echo] In tear.down...
clean:
[echo] Starting clean target...
[echo] End of clean target...
BUILD FAILED - 0 non-fatal error(s), 2 warning(s)
(output dir)(30,3):
Failure scanning
"(Source dir path)\References\Gallio\Gallio.NAntTasks.dll" for extensions.
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.这是我加载程序集的脚本区域。
<!-- Load Gallio Tasks for automated Testing -->
<echo message="Loading Gallio Task from: ${path::combine(repoDirectory,'Source\References\Gallio\Gallio.NAntTasks.dll')}" />
<loadtasks assembly="${path::combine(repoDirectory,'Source\References\Gallio\Gallio.NAntTasks.dll')}" if="${file::exists(path::combine(repoDirectory,'Source\References\Gallio\Gallio.NAntTasks.dll'))}" />
<echo message="Failed to find Gallio.NantTasks.dll" unless="${file::exists(path::combine(repoDirectory,'Source\References\Gallio\Gallio.NAntTasks.dll'))}" />
<echo message="${LoaderExceptions}" />
<echo message="Gallio Tasks Loaded..." />和Gallio任务本身。
<target name="run.automated.tests">
<echo message="Begining Automated Testing..." />
<property name="nant.onfailure" value="global.failure" />
<gallio result-property="exitCode" failonerror="false" >
<files>
<include name="${path::combine(outputDirectory,'bin\AutomatedQATest.dll')}" />
</files>
<!--
<runner-extension value="AutomatedQATest,Gallio.AutomatedQATest" />
<assemblies>
<include value="${path::combine(outputDirectory,'bin\AutomatedQATest.dll')}" />
</assemblies> -->
</gallio>
<fail message="Oh no!" if="${exitCode} != '0'}" />
</target>有什么想法吗?我今天大部分时间都在寻找答案,谷歌要么给我提出了一些被贬低的变通办法,要么给我提出了一些不起作用的想法。
谢谢你们!
发布于 2011-12-22 03:22:51
你会发现这是几个共同作用的问题。首先,任务没有正确加载: Gallio需要加载Gallio.dll和Gallio.Nant.tasks.dll。
其次,我试图运行的测试需要gui才能正常运行,为了让gui在远程机器上运行,您必须设置一个交互标志。Gallio没有为此设置标志,所以我最终绕过了这个问题,调用PSEXEC.exe在远程机器上运行Gallio.Echo.exe,打开交互模式,并设置为使用RDP-TCP会话id #1。
<exec program="psexec.exe" failonerror="false" >
<arg line="\\${test.auto1.serverpath} /accepteula -i 0 -u ${DevUsername} -p ${DevPassword} C:\Gallio\bin\Gallio.Echo.exe (The path) ${build.version}.${date.prefix}\bin\${theTargetTest} /rd:C:\Reports /rt:HTML /ra:zip /rnf:${projectName}-${date.cal}" />
</exec> 所以基本上在最后,我消除了让nant运行测试的需要,在我构建之后,让nant使用上面的命令直接在远程机器上使用正确的参数调用Gallio,压缩所需的部分,将其移动到服务器并解压缩。测试结束后,我压缩测试报告并将其移回hudson服务器。
希望这能为将来的人省去一些痛苦。
发布于 2011-12-16 19:02:00
启用Fusion日志记录以获取更详细的错误消息。
请参阅本教程:http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx
我在想有一个或多个缺失的依赖项。
https://stackoverflow.com/questions/8235179
复制相似问题