From 8fa9490ccd2154e4d4cb55d4297515109c19abda Mon Sep 17 00:00:00 2001 From: Diego Lendoiro Date: Fri, 12 Jan 2018 09:33:28 +0100 Subject: [PATCH] healthcheck returns 200 status code --- Gemfile | 2 -- Gemfile.lock | 6 ------ spec/docker_runtime/runtime_spec.rb | 13 ++++++++----- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Gemfile b/Gemfile index 6a6978f..cc5bf5e 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,5 @@ group :test do gem 'docker-api' gem 'rake' gem 'serverspec' - gem 'rspec-wait' - gem 'rspec-retry' gem 'pry' end diff --git a/Gemfile.lock b/Gemfile.lock index b6f312f..49219f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -32,11 +32,7 @@ GEM rspec-mocks (3.7.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.7.0) - rspec-retry (0.5.6) - rspec-core (> 3.3, < 3.8) rspec-support (3.7.0) - rspec-wait (0.0.9) - rspec (>= 3, < 4) serverspec (2.41.3) multi_json rspec (~> 3.0) @@ -56,8 +52,6 @@ DEPENDENCIES docker-api pry rake - rspec-retry - rspec-wait serverspec BUNDLED WITH diff --git a/spec/docker_runtime/runtime_spec.rb b/spec/docker_runtime/runtime_spec.rb index 4021a4a..db8d37b 100644 --- a/spec/docker_runtime/runtime_spec.rb +++ b/spec/docker_runtime/runtime_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require 'rspec/wait' describe 'passbolt_api service' do @@ -31,10 +30,6 @@ describe 'passbolt_api service' do 'DATASOURCES_DEFAULT_PASSWORD=P4ssb0lt', 'DATASOURCES_DEFAULT_USERNAME=passbolt', 'DATASOURCES_DEFAULT_DATABASE=passbolt', - #'DATASOURCES_DEFAULT_PORT=3306', - #'PASSBOLT_GPG_KEYRING=/var/lib/nginx/.gnupg', - #'PASSBOLT_GPG_SERVER_KEY_PUBLIC=/var/www/passbolt/config/gpg/serverkey.asc', - #'PASSBOLT_GPG_SERVER_KEY_PRIVATE=/var/www/passbolt/config/gpg/serverkey_private.asc' ], 'Image' => @image.id) @container.start @@ -49,6 +44,9 @@ describe 'passbolt_api service' do @container.kill end + let(:http_path) { "/healthcheck/status.json" } + let(:healthcheck) { 'curl -s -o /dev/null -w "%{http_code}" http://localhost/healthcheck/status.json' } + describe 'php service' do it 'is running supervised' do expect(process('php-fpm')).to be_running.under('supervisor') @@ -79,4 +77,9 @@ describe 'passbolt_api service' do end end + describe 'passbolt healthcheck' do + it 'returns 200' do + expect(command(healthcheck).stdout).to eq '200' + end + end end