Execute a command-line command from CruiseControl.NET

瘦欲@ 提交于 2019-12-05 12:00:52

Formatting the command like this sets the environment variable correctly:

<exec>
    <executable>cmd</executable>
    <buildArgs>/C SETX SELENIUM_BROWSER googlechrome /M</buildArgs>
</exec>

Now I need to figure out why my NUnit tests aren't correctly picking it up.

UPDATE:

Should have used the environment element in the executable task to pass variables to the test. For example:

<exec>
    <executable>make</executable>
    <baseDirectory>D:\dev\MyProject</baseDirectory>
    <buildArgs>all</buildArgs>
    <buildTimeoutSeconds>10</buildTimeoutSeconds>
    <successExitCodes>0,1,3,5</successExitCodes>
    <environment>
        <variable>
            <name>MyVar1</name>
            <value>Var1Value</value>
        </variable>
        <variable name="MyVar2" value="Var2Value" />
    </environment>
</exec>

I actually implemented the browser setting in a little config text file as a workaround, but this element would have made it easier and I wouldn't have needed to run any command line commands.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!