I have an application written in Rails. To test this, I created a docker image. Everything is working fine.
The problem, however, occurs when I configure Jenkins to run these tests. Here is what I do during the construction phase:
docker-compose up rspec
Where rspec is the service defined in the docker-compose.yml file and contains the following command:
command: "rspec spec/"
When rspec returns an error, the assembly is still in progress. Here is an example output:
... 21:42:24 [36mrspec_1 |[0m should save second profile 21:42:24 [36mrspec_1 |[0m 21:42:24 [36mrspec_1 |[0m Failures: 21:42:24 [36mrspec_1 |[0m 21:42:24 [36mrspec_1 |[0m 1) New profile Should persist new_profile_pricture 21:42:24 [36mrspec_1 |[0m Failure/Error: jump_to_four_phase_with(new_profile_picture) 21:42:24 [36mrspec_1 |[0m RuntimeError: 21:42:24 [36mrspec_1 |[0m Timeout for '#new_profile' (1) appearance reached! ... 21:42:25 [36mcomposes_rspec_1 exited with code 1 21:42:25 [0m[Profiler] $ /bin/sh -xe /tmp/hudson4606189750126491465.sh 21:42:25 Finished: SUCCESS
36mcomposes_rspec_1 returned 1, and the build still succeeded.
If I check the container against its id using docker ps -a , I get "Exited (1) 2 minutes ago"
Do you guys know what's going on?
Is there an easy way to fail assembly when the container fails?
ruby-on-rails docker continuous-integration jenkins rspec
igorvpcleao
source share