Testing Gallio与Nant和Hudson的集成
在这种情况下,我试图在服务器的构建/部署过程之后启动一组Gallio测试。构建脚本是Nant,我们通过Hudson将其激活到远程服务器 经过一番努力,我在构建脚本中遇到了以下错误。 注意:我清理了文件路径,并将其替换为(描述) 这里是加载程序集的脚本区域Testing Gallio与Nant和Hudson的集成,testing,build,hudson,nant,gallio,Testing,Build,Hudson,Nant,Gallio,在这种情况下,我试图在服务器的构建/部署过程之后启动一组Gallio测试。构建脚本是Nant,我们通过Hudson将其激活到远程服务器 经过一番努力,我在构建脚本中遇到了以下错误。 注意:我清理了文件路径,并将其替换为(描述) 这里是加载程序集的脚本区域 <!-- Load Gallio Tasks for automated Testing --> <echo message="Loading Gallio Task from: ${path::combine(repoDir
<!-- 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>
有什么想法吗?我今天大部分时间都在寻找答案,谷歌要么给我提供了被贬低的变通方案,要么提供了行不通的想法
谢谢大家 启用融合日志记录以获取更详细的错误消息 请参见本教程:
我认为缺少一个或多个依赖项。来看看这是几个共同作用的问题。首先,任务没有正确加载:Gallio要求加载Gallio.dll和Gallio.Nant.tasks.dll 其次,我试图运行的测试需要gui正常运行,以便 远程计算机上的gui必须设置交互标志。Gallio没有这方面的标志,因此我最终通过调用PSEXEC.exe在远程机器上运行Gallio.Echo.exe,并启用交互模式,并设置为使用RDP-TCP会话id#1,来解决这个问题。nant中的命令如下所示
<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运行测试的需要,在我构建之后,让它在远程机器上直接用上面的命令调用Gallio,使用正确的参数,压缩所需的位,将其移动到服务器并解压缩。测试完成后,我压缩测试报告并将其移回hudson服务器
希望这能为将来的人省去一些痛苦。您使用的是什么版本的Gallio?
<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>