0
votes

I am building an application using TeamCity and MSBuild, and in order to able to run my javascript integration tests as part of the build (using NUnit and Watin) and still be able to run the TeamCity Build agent as a Windows service, I need the tests to be run from an interactive command window. At least according to this thread: Watin Tests fail on CC.Net

I do however have problems getting the MSBuild "Exec" task to launch the cmd.exe with the /interactive flag. I have tried doing this

<Exec ContinueOnError="false" Command="start $(COMSPEC) /interactive /c $(SolutionDir)/Tests/RunTests.bat"/>

, which would spawn a new cmd window with the appropriate flags, but the problem then seems to be that the ContinueOnError no longer works, because it allways succeeds as long as spawning the new cmd window is successful. The bat file may fail, and the build will still go on.

Does anyone know how best to solve this task with MsBuild?

If you have other suggestions on how to run integration tests with Watin on a TeamCity server without keeping a logged in user on the server, please speak.

1

1 Answers

0
votes

1 Goto your teamcity project. 1. Add a build step 2. Make the Runner Type: Command Line 3. write your script there via custom script or call the script there.

Unless I am mistaken and there is a specific reason you need to use MSBuild? TeamCity supports alot of tools other then MSBuild so i would avoid it for this step unless there is a specific reason for it.