Skip to content

Commit

Permalink
Dont actually healthcheck vbms and bgs yet (#3665)
Browse files Browse the repository at this point in the history
* merge conflict

* Dont actually use bgs and vbms healthchecks yet

* update the specs for bgs and vbms health check

* Doesnt make sense to track the health checker for coverage until vbms and bgs are live in prod
  • Loading branch information
charleystran authored Dec 18, 2019
1 parent f441042 commit eb1f862
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
12 changes: 8 additions & 4 deletions modules/claims_api/lib/claims_api/health_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ def self.mvi_is_healthy?
end

def self.bgs_is_healthy?
response = Faraday.get(BGS_WSDL)
response.status == 200
# response = Faraday.get(BGS_WSDL)
# response.status == 200
# BGS does not have upper level access yet, just return true
true
end

def self.vbms_is_healthy?
response = Faraday.get(Settings.vbms.url)
response.status == 200
# response = Faraday.get(Settings.vbms.url)
# response.status == 200
# VBMS does not have upper level access yet, just return true
true
end
end
end
8 changes: 6 additions & 2 deletions modules/claims_api/spec/lib/health_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@
allow(ClaimsApi::HealthChecker).to receive(:bgs_is_healthy?).and_return(true)
allow(ClaimsApi::HealthChecker).to receive(:evss_is_healthy?).and_return(true)
allow(ClaimsApi::HealthChecker).to receive(:mvi_is_healthy?).and_return(true)
allow(Faraday).to receive(:get).and_return(OpenStruct.new(status: 503))
# VBMS does not have upper level access yet, just return true
# allow(Faraday).to receive(:get).and_return(OpenStruct.new(status: 503))
allow(ClaimsApi::HealthChecker).to receive(:vbms_is_healthy?).and_return(false)
expect(ClaimsApi::HealthChecker.services_are_healthy?).to eq(false)
end

it 'returns correct status when bgs is not healthy' do
allow(ClaimsApi::HealthChecker).to receive(:evss_is_healthy?).and_return(true)
allow(ClaimsApi::HealthChecker).to receive(:mvi_is_healthy?).and_return(true)
allow(ClaimsApi::HealthChecker).to receive(:vbms_is_healthy?).and_return(true)
allow(Faraday).to receive(:get).and_return(OpenStruct.new(status: 503))
# BGS does not have upper level access yet, just return true
# allow(Faraday).to receive(:get).and_return(OpenStruct.new(status: 503))
allow(ClaimsApi::HealthChecker).to receive(:bgs_is_healthy?).and_return(false)
expect(ClaimsApi::HealthChecker.services_are_healthy?).to eq(false)
end
end
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
add_filter 'lib/vet360/response.rb'
add_filter 'modules/claims_api/app/controllers/claims_api/v0/forms/disability_compensation_controller.rb'
add_filter 'modules/claims_api/app/controllers/claims_api/v1/forms/disability_compensation_controller.rb'
add_filter 'modules/claims_api/lib/claims_api/health_checker.rb'
add_filter 'modules/va_facilities/lib/va_facilities/engine.rb'
add_filter 'version.rb'

Expand Down

0 comments on commit eb1f862

Please sign in to comment.