Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCR::Errors due to mismatch in API_BASE_URL in test setup #31

Closed
eikes opened this issue Nov 15, 2021 · 3 comments
Closed

VCR::Errors due to mismatch in API_BASE_URL in test setup #31

eikes opened this issue Nov 15, 2021 · 3 comments

Comments

@eikes
Copy link
Collaborator

eikes commented Nov 15, 2021

I just cloned this repository and noticed that the spec/ioki/vcr tests all failed with similar messages:

 VCR::Errors::UnhandledHTTPRequestError:

   ================================================================================
   An HTTP request has been made that VCR does not know how to handle:
     GET https://app.io.ki/api/platform/providers

The reason seems to be, that in the spec/fixtures/vcr_cassettes files the https://demo.io.ki/api/ API_BASE_URL is used, but this is not configured by default in the test setup where https://app.io.ki/api/ is used.

I was able to fix this by exporting the appropriate ENV variables as it is done in the .github/ci_workflow.env file:

export IOKI_PLATFORM_API_BASE_URL="https://demo.io.ki/api/"
export IOKI_PASSENGER_API_BASE_URL="https://demo.io.ki/api/" 
export IOKI_DRIVER_API_BASE_URL="https://demo.io.ki/api/"

This should be documented somewhere or maybe simply use the https://app.io.ki/api/ API_BASE_URL in the VCR files as well and remove these ENV vars from the CI setup? Or set the ENV variable in the spec_helper.rb file?

@eikes
Copy link
Collaborator Author

eikes commented Nov 15, 2021

Setting the env variable in the spec helper was the simplest:

ENV['IOKI_PLATFORM_API_BASE_URL']  ||= "https://demo.io.ki/api/"
ENV['IOKI_PASSENGER_API_BASE_URL'] ||= "https://demo.io.ki/api/"
ENV['IOKI_DRIVER_API_BASE_URL']    ||= "https://demo.io.ki/api/"

@A5308Y
Copy link
Collaborator

A5308Y commented Nov 16, 2021

Sounds good @eikes. Can you prepare a PR for this?

@A5308Y
Copy link
Collaborator

A5308Y commented Nov 16, 2021

@eikes Could you let me know about any other issue you have/had while setting up?
#20 is still on my list and your perspective would be very helpful here.

eikes added a commit that referenced this issue Nov 16, 2021
@A5308Y A5308Y closed this as completed in 3fb1794 Nov 22, 2021
A5308Y added a commit that referenced this issue Nov 22, 2021
Fixes #31 VCR::Errors due to mismatch in API_BASE_URL in test setup when run locally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants