Skip to content

Commit

Permalink
template in bgs url to claims_api cassettes
Browse files Browse the repository at this point in the history
use filter sensitive data for bgs url rather than erb templating
  • Loading branch information
nihil2501 committed Apr 8, 2024
1 parent 733ed1a commit 7433e13
Show file tree
Hide file tree
Showing 33 changed files with 74 additions and 84 deletions.
5 changes: 1 addition & 4 deletions config/settings/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ bgs:
client_station_id: 281
client_username: VAgovAPI
url: https://internal-dsva-vagov-dev-fwdproxy-1893365470.us-gov-west-1.elb.amazonaws.com:4447
# Put this in `config/settings/test.local.yml` and then erb-template in
# `Settings.bgs.url` to cassettes that are run with the VCR option `erb: true`.
# `BGSClientHelpers#use_bgs_cassette` provides erb-templating enabled cassettes
# and supplies a template local `bgs_base_url`.
# You can use this in `config/settings/test.local.yml`.
# bgs:
# url: https://localhost:4447
# ssl_verify_mode: "none"
Expand Down
8 changes: 0 additions & 8 deletions modules/claims_api/spec/support/bgs_client_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ module BGSClientHelpers
end

VCR_OPTIONS = {
# Allows the same cassette to match in different test environments when the
# base URL for BGS differs between them.
# https://benoittgt.github.io/vcr/#/cassettes/dynamic_erb?id=pass-arguments-to-the-erb-using-gt-
erb: { bgs_base_url: Settings.bgs.url },

# Consider matching on `:headers` too?
match_requests_on: [
:method, :uri,
Expand All @@ -46,9 +41,6 @@ module BGSClientHelpers
# - They will be nicely organized at `bgs/:service/:operation/:name`
# - Cassette matching will be done on canonicalized XML bodies, so
# reformatting cassettes for human readability won't defeat matching
# - ERB templating will be enabled with a value `bgs_base_url` supplied so
# that the same cassette will function without modification in multiple
# environments like CI and locally
def use_bgs_cassette(name, &)
metadata = RSpec.current_example.metadata[:bgs].to_h
service, operation = metadata.values_at(:service, :operation)
Expand Down
1 change: 1 addition & 0 deletions spec/support/vcr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
c.filter_sensitive_data('<APP_TOKEN>') { Settings.mhv.rx.app_token }
c.filter_sensitive_data('<AV_KEY>') { VAProfile::Configuration::SETTINGS.address_validation.api_key }
c.filter_sensitive_data('<DMC_TOKEN>') { Settings.dmc.client_secret }
c.filter_sensitive_data('<BGS_BASE_URL>') { Settings.bgs.url }
c.filter_sensitive_data('<EE_PASS>') { Settings.hca.ee.pass }
c.filter_sensitive_data('<EVSS_AWS_BASE_URL>') { Settings.evss.aws.url }
c.filter_sensitive_data('<EVSS_BASE_URL>') { Settings.evss.url }
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions spec/support/vcr_cassettes/claims_api/bgs/claims/claim.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions spec/support/vcr_cassettes/claims_api/bgs/claims/claims.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7433e13

Please sign in to comment.