Tag: rspec

Testing Dockerfile which runs on non root user using Serverspec

I have a Dockerfile which spins up Jenkins slave nodes using the Jenkins Swarm plugin. I have a non-root user “jenkins” setup in this image. There is nvm setup for the jenkins user. I am trying to test this Docker image using serverspec and I can’t seem to find a way to run a command […]

How to allow HTTP requests to other docker containers with RSpec?

I have a docker project with a few different moving parts, and I want one container to be able to call the API of another container. However, sending any kind of request in my rspec tests yields: WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: … How can I allow it to call the other […]

Use zeus with Rails 3 and docker

We have a Rails 3.2.9 app, and recently switched to Docker in development. By now, I’ve always used zeus local on my machine to preload my codebase and execute tests with Rspec faster. But how would you achieve this with docker? When I try to install zeus inside my container with gem install zeus and […]

Docker containers on travis-ci

I have a Dockerfile that I am attempting to test using RSpec, serverspec and docker-api. Locally (using boot2docker as I am on OS X) this works great and all my test pass, but on travis-ci none of the tests pass. My .travis.yml file is as such: language: ruby rvm: – “2.2.0” sudo: required cache: bundler […]

How can I reset a Dockerized Rails app for integration testing?

My (Rails and react.js) application under test depends on a primary API application to run that is in another repository. I have this API app running in docker, and my client application can communicate with it. Usually in Rails I use something like Database Cleaner to reset my DB between tests to ensure a clean […]

Running tests with Docker and Jenkins – Test Result

I have an application written in Rails. In order to test it I’ve built a docker image. Everything works fine. The problem, however, appears when I configure Jenkins to run those tests. Here’s what I do, at the building step: docker-compose up rspec Where rspec is a service defined at docker-compose.yml and contains the following […]

docker.local hostname in /etc/hosts not resolving on OSX for docker machine (causing rspec tests to fail)

I had a bug today where my rspec tests ran fine, down to the last expectation, but then I still got a “database connection timeout error”. This is running rails locally, connecting to a postgres instance inside of docker, using docker machine. Docker machine instructions guided me to create an entry in my /etc/hosts file: […]

Spring can't connect to docker selenium container to run capybara via rspec

It looks like running rspec command via spring is unable to connect to local docker container with selenium running on docker-machine under osx to execute capybara tests. When invoking rspec command not via spring server – everything works fine, I can see container logs, and while running with spring – I can see nothing, and […]

Rspec test failing against Docker container

DISCLAIMER: I am new to ruby,rspec etc. I am trying to find a test framework for my docker containers I have a docker container that runs the aws cli. I have tested this manually and it work, as part of my tests I want to get the AWS version and check it. I have created […]

Docker failing to see updated fixtures CSV in rspec test directory

This one is quite strange. I am running a very typical Docker container that holds a Rails API. Inside this API, I have an endpoint which takes an upload of a CSV and does some things and stuff. Here is the exact flow: vim spec/fixtuers/bid_update.csv # fill it with some data # now we call […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.