Our environment is evolving into a large number of microservices, which is pretty cool, but poses a problem the testing perspective. We deploy in LXCs so each service gets it own world where it has root, and it doesn't need to worry about stepping on any one else (or getting stepped on by anyone else). This works great in production. But in test we have a problem. In order to make efficient use of agent hardware and licenses we want to use a shared pool of agents. Some sevices may rev 20 times in a day while others may rev zero times. A week later it could flip.
I would like a way to get TeamCity agents to spin up a specific LXC or Docker image for each project and execute the tests in there. It is trivial to have a test step that calls "docker run" but I really would like to have a clean way to have the agent inject the custom scripts and code into the container. In this mode the agent would run outside the LXC, but the tests would execute in the LXC.
It would also be OK to have the agent execute inside the LXC, but then the TeamCity server would need to be able to connect to a host and ask it to launch an LXC / Docker container. This would be pretty slick actually.
In either case I want to make it super easy for developers who are used to using TeamCity to run tests to get them run inside the containers.
Any suggestions of how to make this work today, or ideas to add this capability in a future release?