Reputation: 9159
How to perform automated integration testing at each build with TeamCity?
Normally there would be these steps:
The problem is that these steps depend one on another; it all works well until step 4. Here you start the server but it won't go to step 5 until step 4 is finished. But if step 4 is finished, the server is stopped and thus the tests from step 5 won't have a server to work on.
The only workaround I have thought of is pretty weird and ugly (and I don't know if it really works): trigger the tests first in a daemon thread which at first is supposed to wait for 2 minutes (to let the server time to start); since the thread is a daemon thread the JVM can stop and while the thread still goes on with triggering the test. After this it can go to next step which starts the server and until the server is stared the timer runs out and triggers the tests.
Upvotes: 0
Views: 847
Reputation: 9569
It depends on what "Start server" means. We do exactly this, but we treat "start server" as actually starting the server - the step ends when the server is fully functional. Then we add a step 6 "Stop server". In step 5, we use TeamCity's NUnit runner to run the tests. It works great.
Upvotes: 1