Running Ruby tests in Docker
Since the Ruby runner doesn't seem to support running the build using the Docker Wrapper - which is strange because the documentation on the wrapper explicitly mentions using a `ruby:2.4` image - I tried using the command line runner to execute the Ruby test suite.
Inspired by this post, I changed the "Container Settings" -> "Additional run arguments" setting and put in
`-v %system.agent.work.dir%/log:/var/app/current/log -v %system.agent.home.dir%/plugins/rake-runner/rb/patch/common/teamcity:/var/app/current/lib/teamcity`.
It does not complain about that option, but, unfortunately, the error message described, caused by the `LoadError` when not finding the TeamCity Ruby code, is still shown.
But it also doesn't find the hostnames from the services (database) started from `teamcity-services.yml` in the previous Docker Compose step as described in that documentation. And adding `--net=host` to the Docker options conflicts with the system-defined network configuration provided by the wrapper. I also checked whether the service port 5432 was available on `localhost` - no luck.
After about an hour of experimentation, I have yet to find a way to start my Rails' application test suite, so any hints are appreciated!
Please sign in to leave a comment.
Dear Marcus,
using
%system.agent.home.dir%/plugins/rake-runner/rb/patch/common/teamcity:%system.teamcity.build.workingDir%/lib/teamcity
should allow using the TeamCity Ruby Code.